All You Need to Know About Consensus Algorithms

All You Need to Know About Consensus Algorithms

Consensus algorithms are the backbone of all blockchains. They are what makes all blockchain protocols different from one another. Without consensus algorithms, what you have is just an inflexible database. So what are consensus algorithms?

What are Consensus Algorithms? 

A consensus algorithm is a process that allows users to achieve agreement on a single data value among distributed processes or systems. With consensus algorithms, users can agree on a single piece of information. This is what makes blockchain protocols reliable at all times. 

The most enticing feature of blockchain networks is decentralization. In a centralized system, only one party makes all decisions on the network. They can change data as they want. However, this is not the case with decentralized systems. 

In a decentralized system, data is recorded in a database which is the blockchain network. Everyone on the blockchain network must have an identical copy of the database so as not to provide conflicting information. Public key cryptography makes sure that users on the network cannot spend each other's coins. However, there has to be a single source of truth that participants in the network can rely on. 

That is why Satoshi Nakamoto, the creator of Bitcoin, proposed a Proof-of-Work consensus algorithm. This requires that users that want to have blocks on the network provide a stake. The stake is some kind of value that a validator gives which discourages them from acting dishonestly in a blockchain network. If they cheat, they lose their stake which could be computing power, cryptocurrency, or reputation. 

You might wonder why anyone would want to place a stake in a blockchain network. This is because there is a reward available for solving mathematical problems on the blockchain network. This process in a decentralized network accounts for transparency which is another main feature of blockchain networks.

Consensus algorithms help;

  1. Decide if users can commit a distributed transaction to a database
  2. Designate a node as a leader for some distributed task in the network 

There are well over 20 consensus algorithms today but today, I will talk about six (6) consensus algorithms. 

Types of Consensus Algorithms

1. Proof of Work (PoW)

The Proof of Work (PoW) consensus algorithm is the Adam of blockchain consensus algorithms. The Bitcoin network first implemented the Proof of Work algorithm. In Proof of Work, validators (referred to as miners) hash the data they want to add until they produce a specific solution.

Proof of Work Consensus Algorithm


A hash is a random string of letters and numbers that is created when you run data through a hash function. Changing even one detail of data in a blockchain network and your data output will become different.

In Proof of Work, the protocol gives conditions for what makes a block valid. However, the issue with the Proof of Work consensus algorithm is that you require high mining power to run them. The Proof of Work algorithm relies mostly on accurate data and information and is completely lacking in transaction speed. If the problem is too complicated it takes a lot of time to generate a block thus delaying transactions. The issue of scalability gave birth to the many consensus algorithms we have today. 

2. Proof of Stake 

The Proof of Stake (PoS) consensus algorithm was proposed as an alternative to the PoW algorithm. In the PoS algorithm, there's no need for high equipment for mining. All you need is a functional computer system and a stable internet connection. 

In the PoS algorithm, there's a minimum amount of funds needed for staking.

Proof of Stake Consensus Algorithm


The funds are then locked up in a wallet (they can't be moved while you're staking). You and the other validators will usually agree on which transactions will be included in the next block. In a way, you're betting on which block will be chosen, and the protocol will make the decision.

If your block is chosen, you will be paid a percentage of the transaction fees based on your stake. You stand to gain more if you have more funds locked up. You'll lose a portion (or all) of your stake if you try to cheat by proposing bogus transactions.

Two clear advantages of the PoS algorithm are that it reduces the threat of a 51% attack and the transaction speed of PoS is faster than that of the PoW consensus algorithm.

3. Delegated Proof-of-Stake Consensus

The Delegated Proof of Stake is a variant of the traditional Proof of Stake algorithm. The system is highly reliable, and it provides a new level of flexibility to the equation.

Delegated Proof of Stake is the best way to go if you want a fast, efficient, and decentralized consensus algorithm. The stakeholders' issue is entirely resolved democratically here. Every network component can become a delegate. The nodes are referred to as delegates instead of miners or validators in this case. This system can make a transaction in less than a second by determining block production. 

Delegated Proof of Stake Consensus Algorithm


In DPOS, witnesses can generate blocks of information. There also is a concept of voting to elect the top witnesses. The voting only occurs when the system thinks it’s fully decentralized.

All the witnesses are paid right after it produces a block. The rate gets previously selected through a voting system.

4. Leased Proof-Of-Stake (LPoS)

Another variant to the Proof of Stake algorithm is the Leased Proof of Stake. The new consensus algorithm blockchain was introduced by the Waves blockchain platform. Just like any other blockchain technology platform, Waves also ensures to offer a better catch with a limited amount of power consumption.

The original Proof of Stake had some limitations for staking. Individuals with a limited amount of coins might never actually participate in the staking ever. To maintain the network successfully, only a handful of an individual with more stakes to offer is left behind. This process allows the system to create a centralized community within a decentralized platform, which is not the desired one.

In Leased Proof of Stake, the smallholders can finally get their chance of staking. They can lease their coins to the network and take the benefit from there.

5. Proof of Elapsed Time (PoET)

The Proof of Elapsed Time (PoET) is one of the best consensus algorithms. This particular algorithm is used mainly on permissioned blockchain networks where you’ll have to get permission for accessing the network. These permissions networks need to decide on mining rights or voting principles.

To make sure that everything runs smoothly the PoET algorithms use a particular tactic for covering transparency into the whole network. The Consensus algorithms also ensure a secure login into the system, as the network requires identification before joining the miners.

This consensus algorithm gives a chance to pick the winners using fair means only. Everyone plays on a level field. 

Proof of Elapsed Time Consensus Algorithm


Every individual on the network has to wait for an amount of time; however, the time limit is random.

The participant who has finished his/her fair share of waiting time will get to be on the ledger to create a new block.

To justify these scenarios the algorithm has to consider two facts.

  • Whether the winner actually chose the random number in the first place? He or She could choose a random short time and get the win first.
  • Did the individual really wait the specific time he/she was assigned?

PoET depends on a special CPU requirement. It’s called Intel Software Guard Extension. This Software Guard Extension helps to run unique codes within the network. PoET uses this system and makes sure the winning is purely fair.

6. Proof-of-Authority (PoA) Consensus Algorithm

The last consensus algorithm that we are going to discuss is Proof-of-Authority. It is used for the centralized system. This means that approved accounts (chosen by the system administrators) do the validations across the network. It is mainly used in private networks due to its centralized nature.

----------------------------------------------------------------------------------------------------

Like I said earlier, there are well over 20 consensus algorithms. Some others not included here are Direct Acyclic Graph (DAG), Proof of Burn (PoB), Proof of Identity (PoI), Proof of Activity (PoA), Proof of Importance (PoI), and so many more. 

Did you find this interesting? If so, I'll like to hear your thoughts on it. What consensus algorithms are you familiar with?

To view or add a comment, sign in

More articles by Anietie D.

Others also viewed

Explore content categories