Blockchain technology is known for its innovative capabilities, but many people still do not fully understand what it is and what it entails. In this article, we aim to provide a brief introduction to the concept of blockchain and its key characteristics. We will explore the structure, types, applications, security, and future of blockchain technology, which has grown rapidly over the last decade and continues to gain popularity. We should note that although digital currency is often associated with blockchain, the technology is much more than just a means of payment. We hope this article helps to shed some light on the fascinating world of blockchain.
Video definition of blockchain in simple language
What is blockchain?
The term blockchain consists of two words Block and Chain, which can literally mean a chain of blocks; But to understand the concept of blockchain technology, we need to define all the pieces of the puzzle. It is good to know that Satoshi Nakamoto used the two words blockchain and chain separately in his original documents, and in 2016, we made the compound word blockchain famous.
In general, it can be said that China’s blockchain, in other words, blockchain, is a database consisting of a list of transaction records that is always growing and increasing in number. These records are called blocks that are connected to each other through cryptography. Blocks are placed in a chain of nodes with a peer-to-peer network, and the storage tank that is formed is called a digital ledger. In other words, blockchain is known as a type of distributed ledger that makes the history of digital assets immutable and transparent using decentralization and cryptographic hash.
A simple example to understand blockchain is to compare it with the Google Doc service. When a user creates a document and shares it with a group of people, we actually distribute the document rather than copying or assigning it. This process creates a decentralized distribution chain where everyone has access to the document at the same time. We make changes to a document that we share with a group of people without blocking any of them, and we record all of the changes on the document without delay. Moreover, the changes are completely transparent.. Of course, blockchain technology is much more complex than Google Docs.
The historical course of blockchain from the beginning and innovations of this technology
During the past few decades, some technologies have had a great impact on all levels of society and created a revolution in the way people live. For example, when we introduced the mobile phone, we revolutionized not only the entertainment industry but also the way some groups earn money. Even today, we unveil new smartphones with amazing capabilities every day.
We are currently in the middle of another technological revolution that we call the blockchain network. This network is a distributed network of databases that we make grow and stabilize every moment.
With a brief look at the last decade, we can see that the first major blockchain innovation was the birth of Bitcoin as the first cryptocurrency. Currently, we use Bitcoin for various payments daily, and its market cap hovers between $10-20 billion.
We realized that we could separate the underlying technology of Bitcoin from cryptocurrency and use it to facilitate the achievement of other goals, which was the second blockchain innovation.
We introduced the “smart contract” in the second generation of the blockchain system called Ethereum, which is the third innovation of this technology. We can predict a bright future for it.
The fourth major innovation in blockchain-based networks was the introduction of Proof-of-Stake instead of Proof-of-Work to establish network security. Currently, most blockchain networks use the proof-of-work process to maintain network security, based on which the group that has the most processing power to produce (extract) blocks makes the final decision and reaches a consensus about transactions and blocks; But on the other hand, the PoS process allows people to participate in the production and validation of the block transaction according to the number of native coins of the network that they own and make available to it. In other words, by investing in the blockchain network, people will get permission to validate and extract, and receive more rewards from the network.
The fifth innovation on the blockchain technology horizon is the Scaled Blockchain. Currently, in the blockchain world, every computer on the network processes all transactions. This problem causes slow network speed. Scalable blockchain can increase processing speed without reducing security. In this method, by recognizing the number of computers we need to validate each transaction and dividing the processing work between them, we sort the result faster. Finally, with the dramatic increase in transaction processing speed, the blockchain network is ready to compete with payment networks such as VISA and SWIFT.
Now let’s go back in time and explore the history of blockchain. In summary, in tracing the initial steps for the emergence of blockchain, we can go back more than three decades:
- David Chaum first proposed a blockchain-like protocol in his treatise “Computer Systems Established, Maintained, and Trusted by Mutually Suspicious Groups”.
- Stuart Haber and W. Scott Stornetta introduced the cryptographic blockchain for the first time.
- Computer scientist Nick Szabo studied and theorized on the Bit Gold project as a decentralized digital currency. Some people believe that the possible Satoshi Nakamoto is Mr. Sabu.
- Stefan Konst published his theory of secure crypto chains along with ideas for implementation.
- A developer or developer with the pseudonym Satoshi Nakamoto published the first white papers to create a model of the blockchain network.
- Nakamoto implemented the first blockchain network as a public distributed ledger for transactions made with Bitcoin.
- We separated blockchain technology from digital currency and examined its capabilities for other financial and inter-organizational transactions. The second version of blockchain has emerged, which includes cross-currency applications. The Ethereum blockchain system incorporated computer programs into blocks that replaced financial instruments such as bonds, known as smart contracts.
Blockchain architecture; How does blockchain work?
In general, the blockchain network consists of several layers, which include the following:
- Infrastructure (hardware, nodes)
- Networking (node discovery, information replication and validation)
- Consensus (with the help of Proof of Work PoW or Proof of Stake PoS)
- Data (blocks and transactions)
- Application layer (smart contract and decentralized applications)
To understand blockchain technology and before talking about how to implement it, we first review the essential concepts. Blockchain stores all the information in a section called the ledger of the system. In the blockchain network, we call any information that we exchange a “transaction”. In the past, we only used blockchain for digital currency transactions, but today, we can exchange different types of data in the platform of the blockchain-based network.
Each chain consists of several blocks and each block has three basic elements:
- The data in the block.
- We call a 32-bit number that we generate randomly when we create a block a “Nonce”. This number will generate the header hash of the block.
- We combine a hash, which is a 256-bit number, with a Nonce number. This number must start with a large number of zeros, which means that it will be a very small decimal number.
When we create the first block of the chain, the nonce number generates the cryptographic hash. We seal the data inside the block and forever tie it to the Nance and Hash number unless we mine it.
In the process of mining, miners create new blocks on the chain. In blockchain, each block has a unique Nance and Hash number; But on the other hand, it also refers to the hash of the previous block in the chain; Therefore, mining a block is not easy at all, especially in large chains, it will be extremely difficult.
Miners use special software to perform complex mathematical calculations to obtain a specific nance number that produces an acceptable hash of the blockchain. Because the Nance number is 32 bits and the hash is 256 bits, there are approximately 4 billion possible combinations for the Nance number and the hash that we must mine to get the correct combination. We will have found the “Golden Nonce” and our new block will be added to the chain when we successfully find the correct combination.
Making changes to any block in the chain requires re-mining all subsequent blocks. For this reason, it is very difficult to manipulate the blockchain network because it takes a lot of time and requires a lot of computing power to get the golden nance. Also, when we mine a new block, all active nodes in the network accept the changes within it and the miner receives a reward.
One of the most important features of blockchain is decentralization. This means that no computer or organization can become the owner of the chain. Instead, its network consists of a distributed ledger of nodes connected to the chain. A node in a blockchain network is any electronic device that can store a copy of the blockchain and help the network function. Each user receives a unique identification number.
Each user on the network is known as a node and all users have an updated version of the ledger. Any node has a different method to communicate with other nodes, which method varies from blockchain to blockchain.
In the first step, a user requests a transaction on the network. By registering the request, a block is created with all the transaction information. This block is encrypted to ensure the security of information. Then, the new block is broadcast to all active nodes in the network so that other nodes can verify the validity of the user’s request. Blockchain uses the Consensus Algorithm process to verify and validate requests. When the created block is valid, it is placed on the chain, and the transaction requested by the user is executed.
The main layers in blockchain architecture can be classified from inner to outer in the following order.
1- Application layer
In fact, this layer includes decentralized applications (dApps), dApp browsers, user interface, and application hosting. Decentralized applications can be accessed using the dApp browser. Unfortunately, common browsers such as Chrome and Firefox do not have the ability to navigate between decentralized applications; But with decentralized browsers, you can browse the normal internet. DAPs can be accessed from the browsers inside the Metamask or TrustVolt application.
Then, application hosting allows the user to launch and run all decentralized applications in this layer. Without this element, no decentralized application can run on the Internet. It is clear that the hosting protocol is also completely decentralized. In addition, the maintenance of these hosting servers is completely secure. Decentralized applications are often similar to today’s applications, the only difference being that they have a decentralized network.
2- Service layer
This layer provides access to important tools that help you build or run a decentralized application layer. Also, in this layer, it is possible to participate in blockchain control and access off-chain calculations, payment channels (State Channels), data feed (Data Feed), and side chain (Side Chain).
These sections can be briefly defined as the Data Feed process allowing nodes to receive the most up-to-date version of information from all valid sources about the network. Off-chain computing allows computational processing to be performed outside of the blockchain network, increasing privacy. In fact, payment channels refer to the communication path between two nodes.
Apart from these elements, there may be other parts in this layer of blockchain. Oracles, multiple signatures, smart contracts, digital assets, wallets, distributed file storage memory, digital identities, etc.
3- Semantic layer
The Semantic Layer includes the consensus algorithm, virtual machines, and other requirements for user participation, etc.
Without a consensus algorithm, the blockchain network loses its meaning. The consensus algorithm is a necessary process for agreement between the nodes of the blockchain network. Thus, in this process, all nodes must agree to verify information in the network; Therefore, no user can initiate a transaction and add it to the ledger unless they agree with other users to add the block after validating the information. We have explained different types of consensus algorithms. For example, the first algorithm is called proof of work, and we use proof of shares and their other derivatives as other algorithms in blockchain.
Participation requirements placed in this layer refer to the rules that can be used to decide whether new users join the network. This element is mostly used in private blockchain technologies.
We embed the virtual machines in this layer in the network in order to increase the security and execution environment for all tasks. We often use this feature to implement smart contracts.
We use the sidechains of this layer to allow developers to develop decentralized applications on separate blockchains so that the core of the main network is not overshadowed.
4- Network layer
This layer consists of a Trusted Execution Environment, RLPx protocol, block delivery network, etc.
A Trusted Execution Environment (TEE) helps the architecture avoid extensibility issues. This feature not only makes the network solve these problems but also increases the security of the network. Also, it helps to have storage outside the main network to optimize the network load. The RLPx protocol is also a set of network protocols that help exchange information between two users on the blockchain.
5- The infrastructure layer
The last layer in the blockchain technology architecture is the infrastructure layer, which includes three levels of hardware, system, and server. Nodes and any devices that connect to the network will be classified in this layer. Another part of the blockchain that is placed in this layer is the network’s decentralized storage memory. Tokens are another component of this layer.
One of the interesting parts of blockchain is the forking process. But what is a blockchain fork? Fork in computer science means “branching” and “multi-branching”. To accurately define this concept and understand its process in blockchain, we first go to its roots in software engineering. In project fork software engineering (Project Fork) or in other words, project branching occurs when developers separate a copy of the source code from the original software and develop it independently. This process makes software distinct and separate from the original software. Of course, developers should not necessarily create branches intentionally and with a previous purpose, and in the software environment, this process may occur unexpectedly.
To understand the concept of blockchain fork, it is necessary to consider the decentralized nature of blockchain. This feature of blockchain means that participants must be able to agree on parts of the blockchain network, including protocols and blocks. This collective agreement among the nodes of the blockchain network verifies the transactions within each block. Sometimes, the nodes in the network cannot reach a consensus about the future state of the blockchain. This lack of consensus leads to the creation of various forks, dividing the main chain of blocks into two or more branches, all of which are valid.
In general, there are three types of blockchain forks, which of course can be divided into more subcategories. These three types of forks occur in different conditions. Blockchain forks are:
In this type of branching, the new protocol is changed to be compatible with the previous one (Backward-Compatible). In this case, the blockchain software that runs on the nodes in the network undergoes a slight change, and the blocks that were extracted according to the new protocol are also considered valid by the nodes that have the old version of the blockchain. For example, the SegWit update to the Bitcoin network added a new class of addresses to the network known as Bech32. However, the addition of a new class of addresses did not invalidate the previous P2SH addresses, and a node with a P2SH address can have a valid transaction with a node with a Bech32 address.
In this type of blockchain fork, we see a wider change. In this type of branching, the blockchain protocol undergoes a so-called backward-incompatible change. by way of explanation, the blockchain software changes in such a way that newly mined blocks according to the new protocol will not be validated by the previous version of the blockchain. When a hard fork happens, a new currency is born. For example, Bitcoin Cash was born after the hard fork of Bitcoin.
Nodes that update the hard fork will receive the digital currency of the new version equal to the number of digital currencies they have from the previous version. For example, if someone had 100 Bitcoins and ran a Bitcoin Cash Hard Fork Update, they would receive 100 Bitcoin Cash in addition to the number of Bitcoins.
Another example of hard forks is the update of Casper in Ethereum, which leads to a change in the agreement and consensus protocol of the nodes. During this update, Proof of Work (PoW) is going to be converted to Proof of Stake (PoS).
3-Temporary Fork / Accidental Fork
This type of fork happens when two miners extract a new block at the same time, and the entire network may not agree on the selection of a new block, and some nodes accept the block mined by group A, and some others accept the block mined by group B. to accept This general lack of agreement on a block, which often occurs due to the time difference, causes the generation of new chains. In this type of fork, there are one or more blocks with the same height.
Random forks are also called temporary forks; Because one of the branches will disappear and all the nodes will be directed to only one of them.
Blockchain fork applications
In total, there are three basic uses for forks, and since a bunch of forks are done with programming; Therefore, programmers follow a specific goal. These applications include 1-adding new functionality; 2-Solving security problems; 3-The returning contaminated transactions or return of stolen cryptocurrencies.
Types of blockchain networks
The types of blockchain networks are divided into at least four categories, which are: public blockchain, private blockchain, consortium blockchain, and hybrid blockchain.
In short, the public blockchain network is a permissionless distributed ledger technology that anyone via the internet can join and transact and participate in invalidations. Validation of transactions in this type of network is done through consensus methods with proof of work or proof of stake, etc. Most blockchain networks consider economic incentives and financial rewards for active users in the network. For example, Bitcoin, Ethereum, Litecoin, and NEO are among these blockchain networks. Among the applications of public blockchain networks, voting and fundraising can be mentioned.
We call a blockchain that runs in a limited environment, membership in which requires permission and is controlled by an organization, group, or individual a private blockchain network. Therefore, the administrators define the access, authority, and how the users operate. This type of network also brings transparency, confidence, and security for selected users. Of course, because we need to obtain permission and the main managers of the network exist, this type of blockchain loses the nature of being decentralized. For example, Multichain and Hyperledger Fabric and Corda networks are classified among private blockchain networks.
The superiority of private blockchain over the public blockchain is in the processing speed and consensus of its users. Also, a private blockchain is more expandable; Because in this type of network, only a certain number of nodes are able to validate transactions. We use private blockchains in the field of supply chain management of organizations, asset ownership verification, internal voting, etc.
Consortium blockchain is a type of blockchain that covers the need for public and private blockchain features at the same time. For example, several organizations intend to cooperate with each other, and by setting up such a network, they can easily manage the cooperation process. In a blockchain consortium, we make parts of organizations public, while other parts remain private. In a consortium blockchain, we carry out the process of consensus and agreement by predetermined nodes, but although attendance is not possible for the general public, it will still have the nature of being decentralized because several separate organizations manage this network.
To ensure the correctness of the operation of this type of blockchain, the validator node can perform two actions validating the transaction and initiating or receiving the transaction. On the other hand, a node that is a member of the network will only be able to initiate or receive transactions. We use consortium blockchain networks in banking and payment networks, research, etc. Marco Polo, Energy Web Foundation, and IBM Food Trust are examples of consortium blockchain networks.
A hybrid blockchain is a network that uses a combination of two types of public and private blockchains. Although this type of blockchain may seem similar to the consortium blockchain; But their nature has fundamental differences. Users in this network can control people’s access to data stored in the blockchain. In this way, only a part of the network data is open to public access without permission, and the other part of the data will only be accessible to selected users by obtaining permission. The flexibility of a hybrid blockchain is that users are able to easily switch from one private blockchain with the ability to access multiple public blockchains.
Transactions on the hybrid blockchain are verified within the network; But, users can also transfer it to the public blockchain for verification. We make public blockchains more complex and involve more nodes for validation, which doubles the security and transparency of the blockchain network. Dragonchain and XinFin are examples of hybrid blockchains.
In fact, we can call a side blockchain that is connected to the blockchain as the main chain in two ways a sidechain. A sidechain enables the exchange of digital assets at a predetermined rate between itself and the main chain.
Suppose a global decentralized network of several blockchains, each of which has its own rules, goals, and efficiency, and while being independent, they also form a single ecosystem. We can call a single ecosystem consisting of several independent blockchains a sidechain..
This complex cryptographic mechanism allows tokens and other digital assets to move freely between the main chain and the side chain. A clear example for the chain side is Liquid Network a consensus platform for exchanges and trading platforms that increases the speed and security of transactions. Since we connect the Liquid network to Bitcoin as its main chain, only activities involving Bitcoin are possible.
Side folds are classified in different ways according to their function. For example, even though both Liquid and Rootstock networks are considered sidechains; their use is very different. Rootstock application is designed with the aim of effective implementation of smart contracts.
Application of blockchain
As mentioned, blockchain is a reliable way to store information about all types of transactions. Next, we will examine its uses.
Blockchain technology provides the foundation for cryptocurrencies such as Bitcoin. The US dollar is controlled by the Federal Reserve. Under this centralized credit system, the user’s data and currencies are technically at the behest of the bank or local government. If the bank is hacked, the user’s private information is at serious risk. If the bank goes bankrupt or the government of the user’s country of residence is not stable enough, the financial value of the user’s assets will be at risk. In 2008, when some banks ran out of liquidity, a financial rescue plan was implemented partly with the help of taxpayers’ money. These concerns led to the conception and development of Bitcoin in the first place.
Blockchain now allows cryptocurrencies such as Bitcoin to operate by extending itself across a network of computers, without the need for a specific credit center. As a result, not only possible risks are greatly reduced, but transaction and financial processing fees are also eliminated.
Another application of blockchain is the smart contract. It build a smart contract, which is a code that is built into the blockchain, to facilitate and confirm an agreement on a contract or even negotiate terms. The users accept the execution of the smart contract under the necessary conditions. We will fulfill the clauses of the agreement automatically when the necessary conditions are met.
For example, a tenant wants to rent an apartment through a smart contract. The landlord agrees to send the building code to the tenant as soon as the security deposit is paid. Both parties of the contract send their desired parts to the smart contract to automatically exchange the code to the apartment by paying the deposit on a certain date. If the landlord does not send the door code by the specified date, the smart contract will also fully automatically return the tenant’s security deposit. In addition to saving time, this process has eliminated the payment of deposit and refund fees.
Banking and financial services
Perhaps no industry will benefit more from the application of block-chain technology in its business activities than banking. International financial institutions are active only during office hours and five days a week. Thus, if a person intends to deposit the amount of a check into his account at 6 pm on Friday, we will not deposit this money into his account until Monday morning. Even if the deposit is made during office hours, the transaction confirmation may take up to three days due to the high volume of bank transactions.These are the issues that today’s banking is struggling with.
Blockchain never sleeps and has no holidays. By integrating the block-chain network into banks, customers can see transactions processed in less than 10 minutes. Basically, we need this amount of time to add a new block in the block-chain, and it doesn’t matter if the user’s request is registered on a holiday or outside office hours. In addition to time, according to research and calculations, people can save 15 to 20 billion dollars annually in banking services, fees, and insurance by using banking based on the block-chain network.
The video game
In November 2017, their launched the Cryptokitties game. A month after its launch, this game became the focus of the news because a Cryptokit character, which was a virtual pet in the game, sold for over 100,000 dollars. This game showed how we can use blockchain technology in the video game industry.
Another application of blockchain technology, according to Santander Bank, is its use in the capital market; Of course, using this technology in the blockchain network is not as easy as using it to transfer money.
In the blockchain business system we developed for trading, each transaction includes a Letter of Credit that ensures the accurate execution of the transaction by the buyer and the seller.
Some media outlets are trying to create a content distribution network using blockchain. For example, on the Decent platform, content producers share their products on the blockchain network to find customers for them. If we find a buyer, we will pay the product fee immediately. Also, Comcast is another blockchain network that allows people to book TV ads.
Even though blockchain technology consumes a lot of energy; it has all the necessary features for managing energy consumption. For example, in this network, you can define all energy sources and measure each user’s energy consumption, and issue invoices in real-time.
Because blockchain technology is democratic, we can use it for direct election voting purposes with a little creativity. Among its features suitable for voting, we can mention the impossibility of changing the history of transactions, collective security, not tracking users, and accessing people’s information, etc.
Every country has a civil registry that collects the identity information of people from name to date of birth and death, number of children, etc. This information is constantly growing; As a result, countries face many challenges in managing and maintaining information security. Maybe it’s time to facilitate the recording of personal information records and their protection by using block-chain technology.
Block-chain technology can help us manage the time-consuming and heavy process of tax calculation and minimize human error. Moreover, it can help us avoid tax evasion.
It is clear that block-chain is a kind of decentralized database that shares certain information with all active nodes in the network. Suppose that we can store any kind of data in it. On the other hand, the possibility of validating and verifying the authenticity of information will also create a revolution in the storage of shared information.
Health and treatment
Medical institutions can use block-chain to redefine the way they store patient records. This technology allows us to record and encrypt patient records in the block-chain so that they are only available to certain people.
Other uses of block-chain include the production of non-exchangeable tokens (NFT), energy exchange, domain name services, supply chain management, its use in the Internet of Things and smart homes, etc. These applications still show a corner of the power of blockchain and this technology still has a long way to go.; Because block-chain technology is very flexible and has a great ability to enter every part of human life.
Blockchain vulnerabilities and attacks
Block-chain technology is vulnerable like any other phenomenon and may be subject to attacks. According to published research, more than 40 types of vulnerabilities threaten block-chain and digital currency platforms. To learn more about block-chain network penetration and hacking, refer to the linked article. Next, we are going to mention some vulnerabilities of the block-chain network.
It can divide block-chain security vulnerabilities into four general categories, each of which has its own attacks and hacking scenarios. These four categories are
1- Peer-to-Peer network-based attacks
- Eclipse attack
- Sybil attack
2- Attacks based on Ledger and Consensus
- Selfish Mining Attack
- Mining Malware attack
- Attack 51%
- Timejack Attack
- Finney Attack
- Race attack
- Double Spending Attack
3- Attacks based on smart contracts
- The DAO attack
4- Wallet-based attacks
- Parity Multisig Wallet Attack
- Dusting attack
Advantages of blockchain
For all the complexities involved in blockchain, the technology’s capabilities as a decentralized method of record keeping are almost limitless. We can mention the following advantages of using blockchain.:
- Increasing security in privacy
- Reduced payment fees
- Reducing possible errors because the use of block-chain increases the accuracy of doing work.
- Network decentralization prevents possible manipulations.
- Blockchain ensure full security and privacy for all transactions.
- Block-chain performance transparency
- It allows citizens of underdeveloped countries or unstable governments to keep their personal information safe or use its banking services.
Disadvantages of blockchain
- High cost of Bitcoin mining
- A Low number of transactions per second
- Their non-conflict nature makes transactions vulnerable to being used in illegal activities and exchanges.
- Government laws and regulations about digital currency
The future of blockchain
Block-chain technology has created many surprises so far and it is not far from a mind that it will make many impossible things possible in the near future. Maybe in the future, we will see that self-driving electric cars and drones will use the blockchain network to pay for services such as charging stations and landing sites. It can complete international financial transfers in a few hours instead of several days and then down to a few minutes..
In fact, predicting the growth path of block-chain is much more difficult than one might think. Did anyone notice the rise and growth of social networks? Who would have predicted that clicking pictures of our friends’ faces would replace spending time watching TV? Forecasters often overestimate the speed of future events and ignore the long-term effects of events.
But the capabilities of the blockchain industry suggest that future changes will be as large as the original invention of the Internet. What we can be sure of is the maturity of blockchain technology and its rooting in all areas of human life in the future, and considering the long way it has traveled in just 10 years, bigger events will appear sooner than we think.