First of all, let’s explain why consensus is needed. In distributed networks, there should not be any central authority. Consensus means that the majority of participants agree on the single version of the truth at a given moment. So there are more independent authorities and thus the decision power is distributed.

Within cryptocurrencies, users send transactions and some of them might be fraudulent. There also might be fraudulent authorities that add fraudulent transactions into a block. It would be easy to cheat if there would be a single central authority. It is much harder to cheat in a distributed environment where there are more entities participating in the mutual consensus. If there is a certain number of honest entities then it is hard or impossible to cheat. Both Cardano PoS and Bitcoin PoW requires over 50 % honest entities to ensure that the networks add blocks correctly and securely.

So the mutual distributed consensus is made to avoid a single point of failure. Everybody can join open networks, there is no KYC, so it can be expected that there will be cheaters. The consensus protocol must be robust and ensure that transactions between people will be safely processed in a reasonable time. You can understand it as an attempt to eliminate cheaters in the decision process and still be able to add new blocks in a secure way.

How distributed entities come to a consensus

Distributed consensus can be generally described in a few steps.

  1. Selection of a node with the right to produce the next block.
  2. The node with the right to produce the next block will create the block and distribute it to other nodes.
  3. All other nodes in the network verify the block and either accept it or reject it.
  4. The process continues from step 1. It is needed for the confirmation of all previous blocks. The more added blocks are above a block the higher is the probability that the block will stay in the blockchain forever.

It is quite easy, is not it? There are always more entities that are able to produce a block. However, at a given time all entities must make a consensus about a single block. There must be some rule that determines who will get the right to produce a block in step 1. Then steps 2 and 3 must follow to get again to step 1.

A node with the right to produce the next block will select transactions, validate them, and puts them into the new block. The node usually adds some required proof and/or signature and distributes the block.

All nodes in the network keep their own version of the blockchain and every single node autonomously decides whether to accept the received block or reject it. Every single node verifies the validity of all transactions in the block and all necessary property of the block including proof and/or signature. If the block is valid it can be expected that all honest nodes append the block at the end of the blockchain. The next node with the right to produce a block, if it is an honest node, will very probably extend the previously added block.

Under certain circumstances, a fork of blockchain might appear.

 

 

 

 

0*rsgnFdRGvSlIOSas.png?q=20

0*rsgnFdRGvSlIOSas.png

 

Block in a blockchain

A node can get into a situation where it must decide where to continue. Related to the picture above, after Block 3 there is a fork. The node currently working on the next block can continue building the blue branch (Block 4a) or the yellow branch (Block 4b). After some time only one branch will survive and the other will be orphaned. In our case, the blue branch won.