Consensus Protocols: Different types and how they work

Consensus Protocols: Different types and how they work

There are a number of blockchain networks and protocols out here on the web. At one point you must have contemplated on how a specific blockchain network works and what powers it. A consensus is a core component that powers the blockchain.

Consensus Algorithm

A consensus is a set of protocols that define how a specific blockchain transaction takes place. We can also simply define it as how a group of nodes reach agreement.

Blockchains are decentralized, to ensure immutability and tamper proof transaction log anyone can verify the authenticity of data. Unlike traditional databases where there is a central administrator to manipulate the data.

How Consensus Protocol Work

The consensus protocol specifies on how to get multiples nodes to agree if a data item should be added on the blockchain. For an efficient consensus mechanism two things have to be put into consideration:

  1. Liveness: Ensuring requests from clients are eventually processed, this can be achieved through validity by ordering a broadcast message within the consensus. If a message is delivered to one honest node it will be delivered to all honest nodes through agreement.

  2. Safety: If an honest node accepts or rejects a value then all the honest nodes should follow. Consistency ensures that all honest nodes extract the same order for all delivered messages.

Types of Consensus Protocols

There are many different algorithms for building a consensus based on requirements related to scalability, performance, consistency, failure model and threat model. Here are some examples of consensus mechanisms utilized by various blockchain networks and distributed ledgers.

Proof-Of-Work (PoW) Consensus

It is also called Nakamoto consensus after a pseudonymous author Satoshi Nakamoto. Proof-Of-Work(PoW) fueled the innovation of bitcoin. The Idea of Proof-Of-Work(PoW) was first introduced in 1993 as an approach to combat spam emails. The technique was formally called Proof-Of-Work in 1997.

Proof-Of-Work works by having all nodes on the blockchain solving a mathematical puzzle for them to be eligible to add a new block to the blockchain. To solve these complex mathematical puzzles computers have to run a program that consumes more power and energy. These puzzles are solved by miners and the first one to get a solution gets a miner reward.

Proof-Of-Stake (PoS)

Proof-Of-Stake uses an election process, by randomly electing a leader(node) among the stakeholders which then appends a block to the blockchain. Proof-Of-Stake (PoS) has no miners but instead it has validators. To become a validator a node has to deposit a certain amount of coins as stake, whereby the size of the stake will determine if the validator will be chosen to append the next block on the blockchain.

Proof-Of-Capacity

In Proof-Of-Capacity, participants vote on new blocks determined by their capacity to allocate a non-trivial amount of disk space. Proof-Of-Capacity is an improvement of Proof-Of-Work consensus, since it is energy intensive due to usage of hard drives for mining. Once mining is completed the miner can wipe off the hard drive, thus it is considered as an environmentally friendly consensus.

Proof-Of-Elapsed-Time (PoET)

Proof-Of-Elapsed-Time (PoET) is a Nakamoto style consensus algorithm, designed to be a production-grade protocol capable of handling many network participants. Proof-Of-Elapsed-Time (PoET) is used by private or permissioned blockchain networks. PoET comes from intel,and it relies on a special CPU instruction set called Intel Software Guard Extension(SGX) replacing the computational work used PoET.

PoET ensures safety and randomness of the leader election process across the largest amount of network participants, without requiring specialized hardware and costly power consumption. Each node is assigned a waiting period by the network in order to mine, the one with the shortest period wins.