My Voice

Breaking down the blockchain architecture Everyone knows what blockchain does, but hardly a few people know how. To get an understanding of how it functions, it is important to study the basic components of blockchain architecture.

blockchain architectureGartner, a leading research and advisory company, defines blockchain as an expanding list of cryptographically signed, irrevocable transactional records shared by all participants in a network. It provides many benefits to businesses like greater transparency, enhanced security, and improved traceability that makes blockchain so special. And, these benefits are possible because of the relatively novel architecture of blockchain. Most database technologies use a client-server network where all data is stored by a server at one place and controlled by some administrators. On the contrary, blockchain uses a distributed network where every participant in the network has the right to maintain, enter, and update data. And this data travels through various components of blockchain architecture before they are added as a block of data in the blockchain.

Components of Blockchain architecture

The working of blockchain is not as simple as it might sound. Hence, to get a detailed understanding, let’s use the example of Bitcoin’s blockchain while discussing components of the blockchain architecture in general.

blockchain architecture
blockchain architecture

Node

Blockchain is a peer-to-peer network that works on IP protocol. Nodes in this network are every single entity or computer that processes and verifies transactions. Every node has a replicated copy of the entire blockchain database that contains all the details of a transaction. When several nodes have similar transactional details in their database, then they are said to be in consensus.

The function of a node in blockchain can be further explained as when a new transaction or a modification to an existing transaction comes, certain algorithms that are proposed for that transaction are evaluated in every node. If a majority of nodes of these algorithms come to a consensus that it is a valid transaction, then the transaction is accepted into the ledger, and a new block is added to the chain of transactions; otherwise, it is denied. For instance, if a new Bitcoin is added to the blockchain, then the details are sent to every node. Each node then verifies the addition of Bitcoin with other databases of the network and accordingly adds it to the ledger or denies it.

Transactions

Transactions are the smallest building blocks of a blockchain system. Transactions generally hold data, a sender address, and a recipient address. It is the transactions that change the state of the agreed-upon blockchain. They are bundled in the form of blocks and delivered to each node. As these transactions get distributed within a blockchain network, they are verified and processed by each node, and if most of them come in consensus, then the data is added to the blockchain. Transactions contain one or more inputs, which are a reference to outputs of previous transactions. They also contain one or more outputs that specify an amount and an address.

Considering the Bitcoin example, each transaction moves the value of some bitcoin from one address to another. For instance, suppose Bob wants to send Bitcoin to Alice, then transactions will move the Bitcoin value from his address to her address. So when Bob creates a transaction to transfer Bitcoin, it will have a reference for the previous transaction’s output. And, the output of this transaction will be a public key to which Alice will hold the private key and a value of Bitcoin to be sent. Once the transaction gets verified, Alice will receive the Bitcoin value, and the details will be added to the blockchain.

Block

Blocks are the components that bundle a set of transactions and distribute them among each node of a blockchain network. Miners create these blocks. Every block consists of metadata and some transactions that are selected by miners. Metadata about a block is stored in the block header, which is used by nodes to verify the data of a block. Metadata of a block constitutes various fields like:

  • Version – the current version of a block.
  • Previous block header hash – it is the reference hash of a block’s parent block.
  • Merkel root hash – it is a cryptographic hash of all the transactions present in the block.
  • Time – it is the time when a block is created.
  • nBits – the encoded form of the target threshold and current difficulty of the block.
  • Nonce – an abbreviation for “number used once,” it is a random number added to a block by miners.

In context to Bitcoin blockchain, users create transactions that sit in a pool until a miner bundles it to create a block. Miners can act however they want and include whatever transactions they want. Then consensus rules decide which transactions are valid and should be acted upon.

Miners

As previously stated, miners are the nodes that bundle transactions and creates valid blocks that are accepted by the rest of the networks. Miners add a hash function to every block. Hash functions have a few properties like they are one-to-one functions, which means the same input will provide the same hash function, and they are also one-way functions, which means it is impossible to work them backward. Thus one of the most important factors contributing to the blockchain network’s security is hashing functions. Due to hashing, it becomes impossible to change metadata of a block as changing even minute details of block header will result in the creation of a new hash function altogether, which will be verified again before adding it to the blockchain ledger.

The mining process involves creating a hash function and checking to determine whether the hash function meets the current difficulty level of the block. Miners get some incentive to create a valid block. In Bitcoin, this incentive is creating new coins from coinbase transaction. The coinbase transaction is a transaction without any input value. It is a transaction that is present in every block that has a single output value, which is the address controlled by the miner. If the miner’s block gets approved by the entire network, then their address gets credited with the new bitcoin.

Another aspect of the mining process is the difficulty level of a block. The difficulty level is a consensus rule that defines the amount of work required by a miner to create a valid block. A block becomes valid only if the hash function can prove that enough work is done to create a block. This is proved if it fits a certain format. For instance, in Bitcoin, the format is that the hash must start with a certain number of zeros. For example, a hash “000000000000000000004189fg154sd184rty” contains twenty zeros, and hence it becomes difficult to find a resultant hash that starts with the current difficulty level of twenty zeros. Every other node in the network that receives this block can trust that it would have taken a lot of computing power and energy to create it. Hence, they agree to compensate the miner by rewarding with new coin generated by the coinbase transaction of that block.

Consensus

All the previous concepts that referred to processing and verifying the validity of blocks before adding them to the blockchain is called consensus. It is a set of rules that everyone node in the network is playing by. The consensus rules ensure that the database copy of an individual node in the blockchain environment is consistent with each other and also the most updated one. As a blockchain network grows in size, the consensus algorithms grow stronger as the number of participants enforcing their own database increases. There are various types of consensus rules like Proof-of-Work, Proof of Stake, and Simplified Byzantine Fault Tolerance that defines rules for various actions. For instance, one of Bitcoin’s consensus defines rules for the value of coin created by the coinbase transaction, which will be rewarded to the miner. The rule says that the value should be cut to half after every 200,000 blocks created. For example, if the first 200,000 blocks created a value of 60 Bitcoins, then 200,001 – 400,000 blocks will create a value of 30 Bitcoins.

Suppose the current Bitcoin blockchain rewards 15 Bitcoins to miners, and a miner creates a block that creates 30 Bitcoins, then each node will verify that block and run it through their consensus rule. And, then every node will ignore the block as it does not meet the rules which says that every new block created should reward 15 Bitcoins.

Based on how a developer creates a platform with the help of the above-mentioned blockchain architecture components, the blockchain network can be classified into different types like a private, public, consortium, and hybrid blockchain. These different types of blockchain networks provide various advantages according to the need of a business. For instance, public blockchain provides increased transparency, and private blockchain provides enhanced security.

Leave a Comment

Your email address will not be published. Required fields are marked *

*