Do you know the Different Consensus Protocols in a Blockchain?

Do you know the Different Consensus Protocols in a Blockchain?

There have been loads of iterations of peer-to-peer decentralized currency systems which failed before Bitcoin because they were unable to answer the biggest problem when it came to reaching a consensus. This problem is called “Byzantine Generals Problem”.

A group of Byzantine generals who want to attack a city, how do they send their message across given :

  • The generals and their armies are very far apart so centralized authority is impossible, that makes coordinated attack tough.
  • The city has a huge army and the only way that generals can win is if they all attack at once.

The purpose of a consensus algorithm in a Blockchain network is to make sure that the network’s participants agree on the current state of the Blockchain without the need to trust each other or to have a central authority.

A consensus algorithm, does two things: it ensures that the next block in a blockchain is the one and only version of truth, and it keeps powerful adversaries from derailing the system and successfully forking the chain.

Here is a list of consensus mechanisms that popular Blockchain implementations use:

Proof Of Work

Satoshi Nakamoto, Bitcoin’s creator, solved the problem by inventing the proof of work consensus protocol. This is how it works on the blockchain:

  • The miners solve cryptographic puzzles to “mine” a block in order to get them added to the blockchain.
  • The puzzles have been designed in a way which makes it hard and taxing.
  • When a miner solves the puzzle, the block is presented to the network for verification.
  • Other miners then verify whether the block belongs to the chain or not and it is an extremely simple process.

Unfortunately there are quite a few issues with proof-of-work that community is witnessing now:

  • Proof Of Work(PoW) is an extremely inefficient process because of the sheer amount of power and energy that it eats up in solving the puzzle.
  • Group that can afford faster and more powerful ASICs usually have better chance of successful mining than the others.
  • As a result of this, bitcoin isn’t as decentralized as it claims to be. Check the hashrate distribution graph:

As you can see, ~60% of the hashrate is divided among 4 mining pools alone!
Image Credit: Blockchain.info

Proof Of Stake

A consensus algorithm that depends on validators economic stake in the network.

Ethereum is soon planning to move to Proof of Stake(PoS) from Proof of Work (PoW). NXT uses PoS.

This is how the process will work:

  • The blockchain keeps track of a set of validators.
  • Anyone who holds the blockchain’s base coins can become a validator by sending a special type of transaction that locks up their coins into a deposit.
  • The process of creating and agreeing to new blocks is then done through a consensus algorithm that all current validators can participate in.
  • Validators will get a reward proportionate to their bets on the block.

Delegated Proof Of Stake

Both EOS and Graphene use this consensus mechanism.

This method is a variation of proof of stake in which the responsibility of creating blocks is delegated to third party nodes, known as “witnesses”.

This is how it works on a high level:

  • Anyone who holds tokens on a blockchain can select the block producers through a continuous approval voting system.
  • Anyone can participate in the block producer election and they will be given an opportunity to produce blocks proportional to the total votes they receive relative to all other producers.

Proof of Importance

This is again a variation of PoS, it tries to overcome the problem of ‘rich getting richer’ in PoS, rich are more likely to sign the next block, and the more blocks they obtain, the richer they get. The problem is the same, richer users will gain wealth much faster than others making system centralised.

POI system not only rewards those with a large account balance, but also takes into account the frequency i.e. how much they transact to others and who they transact with.

This is how it works:

  • Each user is given a trust score, the higher it is, the more chance they have of being rewarded.
  • Trust score is calculated based on vested coin balance and frequency of the transactions.
  • Rewarding is done through harvesting, a mining process in which a node will calculate blocks and they are added to the blockchain.

Delegated Byzantine Fault Tolerance (dBFT)

NEO is using dBFT.

Here’s a high level approach that it follows:

  • Coin holders elect nodes that does the bookkeeping, vote on the validity of transactions, these are called consensus nodes.
  • These elected nodes broadcasts the transaction to the entire network.
  • A consensus node termed as speaker is selected that prepares block proposal and broadcasts on the network.
  • Multiple consensus node called Delegates receive the proposal and validate:
    • Is the data format consistent with the system rules?
    • Is the transaction already on the blockchain?
    • Are the contract scripts correctly executed?
    • Does the transaction only contain a single spend?(i.e. does the transaction avoid a double spend scenario?)
    • The Delegates sign the block.

When a Consensus Node receives a full block, current view data is purged, and a new round of consensus begins.
There’s no way of predicting which of these methods will prove to be the best, only future will tell.

Akhilesh Mourya

February 8, 2018

Comments

  1. Very Impressive Blockchain tutorial. The content seems to be pretty exhaustive and excellent and will definitely help in learning Blockchain course. I’m also a learner taken up Blockchain training and I think your content has cleared some concepts of mine.

Leave a Reply

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