Bitcoin – Consensus in Bitcoin

Distributed consensus algorithms can’t be used directly in the bitcoin type of architecture as it is designed and developed based on a permissionless blockchain architecture where anyone can join the network without authentication.

Consensus algorithm

The objective of the consensus algorithm is to agree unanimously on the validity of transitions of the newly added block in the existing blockchain. In the later sections, we will see how the miners do their work and participate in the consensus.

Miners in the bitcoin network
Miners in the bitcoin network

There can be multiple miners in the bitcoin network. Individual miners can propose their new block based on the transactions they have seen or received and validated, after the last addition of a new block in the blockchain. In the below diagram, there are three miners, and all may or may not have the same set of transactions in their proposed block. However, their objective is the same, add a new block to the existing blockchain and earn rewards.

Bitcoin miners
Bitcoin Miners

After the addition of the last block in the blockchain, they start including all those transactions in the new block, provided that the total size of the block does not overflow at a certain threshold. The consensus objective is to decide which particular block needs to be added to the existing blockchain as three blocks are proposed by the different miners in the above diagram.

The challenge here is that the miners do not know each other because it is an open and permission-less network. So anyone can participate in the network as a miner, and collect the transactions coming from the clients and propose a new block. Thus, under this scenario, how will you ensure that the miners will come to a consensus?

Why does the traditional distributed consensus algorithm not work in Bitcoin permissionless environment?

  • Broadcast the information and then apply a choice function – In the traditional distributed consensus algorithms. Whenever they are proposing some new blocks, every miner will broadcast the information in the network and wait for a certain amount of time. If they receive any other blocks from the other miners, they accept the block and apply a choice function to select one block. The problem with this particular mechanism is that whenever we are saying that the miner will wait for a certain duration, that is technically infeasible under this particular environment. Firstly, the miners do not know each other and do not know how many other miners are there in the network? Secondly, the network is inherently asynchronous in a sense like whenever a miner will propose a block; there can be arbitrary delays in the transmission of those new blocks. In this particular environment having a consensus may not be feasible.
  • According to the Impossible theorem, in a purely asynchronous distributed network in the presence of a single failure, the consensus is not feasible. So In this particular architecture, even if a single malicious miner, other miners may not be able to collect all the blocks from the legitimate miners. So applying this kind of traditional distributed consensus algorithm based on broadcasting or message passing is infeasible.

Challenge-Response based Consensus algorithm for Bitcoin permissionless environment.

The challenge-response consensus algorithm works well in the bitcoin permissionless environment. In this setting, the network imposes a challenge, and the interested party (miners) needs to solve that challenge. So, whoever responds first with a valid solution, receives the reward as bitcoins from the network once all the peer nodes widely accept the solution within the bitcoin network.

  • Any valid block (a block with all valid transactions) can be accepted, even if a miner proposes it. Moreover, it is not necessary that the block need to be proposed by multiple miners together. Once the block is accepted and linked with the existing blockchain, it is considered as a round.
  • The protocol work in rounds. Broadcast the accepted block to the peers and collect the next set of transactions. Once a valid block is accepted, it means the system has reached a consensus; from that point, another round starts. The miners start getting the transactions, and they will find out which all the transactions are not already committed in the blockchain, and based on that, they can propose the new block.

Every miner independently tries to solve the challenge, and after some time, one of the miners will prove first that the challenge has been solved. The “Proof first” is important because this says that every individual miner was trying to solve a challenge imposed by the network. Still, a particular miner can solve the challenge first. This particular algorithm is known as Proof of Work.

References

  • NPTEL lecture series on Blockchains Architecture, Design and Use Cases by Prof. Sandip Chakraborty, IIT Kharagpur.

 1,553 total views,  2 views today

Scroll to Top
Scroll to Top