Consensus in Blockchain

Definition

We know that Blockchain is a decentralized Database. This means that every member of a Blockchain network has a copy of the blockchain database. But have you ever thought of what happens when a new data needs to be added to the Ledger? Who validates this new data? In a Centralized system this is no issue as the Central Authority takes care of validating and adding the data to the Central repository. For example in the conventional banking system (centralized) all your transactions are validated and added to the centralized database by the Bank itself.

In a Blockchain, Miners are the members of the Blockchain network who compete among themselves to add Blocks (containing digital data) to the Blockchain. Miners adhere to the Consensus Mechanisms developed for the specific blockchain, in order to validate Blocks to be added to the Blockchain ledger.

Types

There are a number of Consensus Mechanisms devised for different Blockchain networks (like Bitcoin and Ethereum). Please see the list below.

  • Proof of work (POW)
  • Proof of stake (POS)
  • Delegated proof of stake (DPOS)
  • Proof of authority (POA)
  • Practical Byzantine fault tolerance (PBFT)
  • Directed acyclic graphs (DAGs)

Currently these consensus mechanisms have been widely adopted by different blockchain and DLT frameworks. A particular model can be chosen over others as per an organization’s business demands. Performance, scalability, and security are major factors before picking any one of them over others.

Proof of Work (PoW)

  • The PoW is the first Consensus mechanism developed for Blockchains. It was devised to reach consensus in the Bitcoin Blockchain.
  • Miners compete with each other to solve a mathematical puzzle using their CPU power. The Miner who solves the puzzle first is the winner.
  • The winning Miner propagates the Block to be added to the Blockchain. Other Miners start validating the transactions in the Block till it reaches an agreed-on-percentage (51 percent or 90 percent as per the configuration).
  • Then the winning Miner gets the chance to add Block to the Blockchain and is rewarded (with cryptocurrencies, for example).

Used in: Bitcoin, Ethereum
Advantages: Time tested; Safe
Disadvantages: Too slow and massive Power consumption

Proof of Stake (PoS)

  • The PoS is based on the economic stake of a validating member in the Blockchain. By stake we mean the money which the validator has deposited in the network.
  • In order to become a validating member to validate transactions to be added to the network one must deposit some economic stake in the network.
  • In PoS each validating member gets his/her turn to vote and propose a Block in the Blockchain network. The weight of his/her vote depends on the size of his/her economic stake.

Used by: Ethereum’s upcoming Casper model of consensus
Advantages: Security, reduced risk of centralization, and energy efficiency
Disadvantages: more prone to attack as there is no computational factor like with POW to keep the network safe

Minting: In PoS the entire process of validating and adding a new Block to the Blockchain network and getting rewarded with a fraction of the cryptocurrency, is called Minting (not Mining)

Delegated Proof of Stake (DPoS)

  • The DPoS is a slight variation of the PoS.
  • In DPoS all the members of the network vote to select the final validators or approvers of the new Block in the network.

Used by: EOS, Bitshares
Advantages: Super-fast, scalable, and high energy efficiency
Disadvantages: None

Proof of Identity

  • This is yet another modified version of the Proof of Stake.
  • In Proof of Identity, identity is at stake rather than monetary value.
  • Member nodes who produce their valid identity proofs are the approvers for the Blocks to be added to the Blockchain.

Used by: Ethereum’s Parity
Advantages: Security, no mining, high in scalability and performance

Practical Byzantine Fault Tolerance (pBFT)

  • pBFT is a Consensus mechanism devised to combat the Byzantine General’s Problem of a distributed network like the blockchain, when some member nodes of the network are malicious or faulty. These malicious or faulty nodes intentionally send incorrect information and try to achieve system failure.
  • The Byzantine General’s problem was well explained in a paper by LESLIE LAMPORT, ROBERT SHOSTAK, and MARSHALL PEASE at Microsoft Research in 1982:
    Imagine that several divisions of the Byzantine army are camped outside an enemy city, each division commanded by its own general. The generals can communicate with one another only by messenger. After observing the enemy, they must decide upon a common plan of action. However, some of the generals may be traitors, trying to prevent the loyal generals from reaching an agreement. The generals must decide on when to attack the city, but they need a strong majority of their army to attack at the same time. The generals must have an algorithm to guarantee that
    (a) all loyal generals decide upon the same plan of action, and
    (b) a small number of traitors cannot cause the loyal generals to adopt a bad plan.
    The loyal generals will all do what the algorithm says they should, but the traitors may do anything they wish. The algorithm must guarantee condition (a) regardless of what the traitors do. The loyal generals should not only reach agreement, but should agree upon a reasonable plan.
  • Similarly the pBFT Consensus ensures that the system does not fail even if some malicious nodes are operating in the network.
  • A pBFT enabled Blockchain network to function, the total number of malicious nodes (m) in the network must not be equal to or greater than one-third of the total number of nodes in the network.

Used by: Hyperledger, Ripple, Stellar
Advantages: High transaction throughput
Disadvantages: Centralized/permissioned


Leave a Reply