The consensus algorithm is the rules by which blocks are generated and transactions are confirmed in the blockchain.
Depending on the algorithm used in some blockchains, a mining mechanism works for the extraction of new coins, while in others – staking , some networks work faster, but are subject to centralization, others slower, but they are difficult to take under the control of unscrupulous network participants. Therefore, it is important to understand the differences between PoW, PoS, PoA and other consensus algorithms in order to correctly assess the prospects for a blockchain project.
We present a detailed guide to the most demanded consensus algorithms used in advanced blockchains.
What is a blockchain consensus algorithm?
Let’s start with the basics. Blockchain is a decentralized network of blocks containing various data. In cryptocurrencies, these blocks store information about all transactions within the network. All blocks are written to the network sequentially one after the other and linked in a chain. Moreover, each block contains information about all previous blocks. Nothing can be deleted from such a network, edited or changed retroactively – after all, you would have to rewrite the entire chain from the very beginning.
In the blockchain, a special built-in mechanism called the consensus algorithm is involved in verifying transactions and confirming that they are recorded correctly.
The blockchain consensus algorithm is a way by which the decentralized nodes of the network reach agreement (or consensus) about the current state of data in all blocks. A node is any computer connected to the blockchain that verifies and confirms transactions and stores a copy of the blockchain.
The consensus algorithm ensures that protocol rules are followed and that all transactions are valid . In other words, he is responsible for ensuring that all the nodes of the network agree with the addition of a new block to it. In this way, the consensus algorithm maintains the integrity and security of the network.
That being said, it is important to understand the difference between the consensus algorithm and the protocol:
- The protocol is the rules of the blockchain operation, according to which the network nodes interact, transaction data is transmitted and the block mining is confirmed.
- The consensus algorithm is a mechanism for checking the implementation of the rules: whether balances and signatures are correct, whether all transactions are correct.
So, for example, Bitcoin and Ethereum are protocols, and Proof-of-Work and Proof-of-Stake are consensus algorithms.
What consensus algorithms are used in cryptocurrencies?
There are many options for consensus algorithms. Let’s take a closer look at the most popular among the best blockchain projects.
Proof-of-Work (Proof-of-Work, PoW) is a consensus algorithm that was first introduced on the network of the first Bitcoin cryptocurrency.
A bit of history:
- The concept was first presented in 1993, and in 1997 Adam Back, one of the contenders for the role of Satoshi Nakamoto , developed on its basis the Hashcash algorithm, which was supposed to protect email from spam.
- In 2004, Hal Finney , another Satoshi candidate, proposed using PoW for electronic currencies.
- And in 2008, this algorithm was used by Satoshi Nakamoto himself in his bitcoin cryptocurrency.
- Later, Proof-of-Work (PoW) was also used in the blockchain of other early cryptocurrencies: Litecoin, Ethereum (before the launch of the update that triggered a multi-year transition to PoS), Bitcoin Cash, Bitcoin Gold, Dash, Dogecoin, Monero and Zcash.
The essence of PoW is as follows: network nodes (miners) must solve complex mathematical problems (hash functions) in order to confirm transactions and prevent other participants from spending the same coins twice. The node that first found the solution receives a reward – new network coins.
At the same time, the complexity of mining protects the network from possible threats in the form of DDoS attacks, 51% attacks (when attackers gain control over transaction confirmation and block creation) and other types of attacks. If the tasks were too easy, attackers could easily compromise the network.
PoW was a breakthrough for its time and allowed the first cryptocurrencies to be launched. It makes the network decentralized and hack-resistant. So, Bitcoin is almost impossible to hack – it would take a quantum computer and huge resources to gain control over the network.
But with the popularization of cryptocurrencies and their mass adoption, the disadvantages of this algorithm began to become more noticeable. Moreover, these vulnerabilities now hinder and restrict the development of early cryptocurrency projects.
Among the main disadvantages of PoW:
- Mining is too energy consuming. Many nodes on the network compete with each other, constantly performing complex calculations. But in fact, most of them are wasted, since the reward goes to only one node. Mining bitcoin uses more energy than countries such as Switzerland or Greece;
- Users have to pay fees to miners to verify transactions. The more congested the network, the higher its commissions. For small transactions, commissions may even exceed the amount of the transfer itself;
- Low speed and poor scalability. PoW blockchains are sorely lacking in speed. For example, the maximum throughput of the Bitcoin network is only 7-10 transactions per second. Such low rates are not suitable for mass and everyday use;
- Centralization of miners joining in pools. This reduces the security of the network, increases the difficulty of mining and contributes to the growth of fees.
Proof-of-Stake (Proof of Stake, PoS) is a consensus algorithm introduced on the Bitcointalk forum in 2011 as an alternative to PoW. The purpose of this algorithm is to strive to correct the main disadvantages of PoW, in particular, the low speed and poor scalability of the network.
In 2012, this algorithm was first integrated into the PPCoin blockchain (currently PeerCoin). Today, PoS-based blockchains are powered by Cardano, Binance Chain, IOTA, Nano, TRON, TomoChain and Ziliqa. And in December 2020, after several years of development, the Ethereum network also began the transition from PoW to PoS as part of the launch of Ethereum 2.0 .
There is no mining in PoS. Instead of solving mathematical problems, new coins are mined through staking – a mechanism that allows you to add new blocks by proving ownership of the network’s cryptocurrency, which was also called forging. The nodes of such a network are called validators, and their balance is called a stake. The more coins a node has in the wallet, the more chances it has to confirm a new block and receive a reward.
Thus, staking can be compared to a bank deposit. The more coins are frozen on the network, the higher the reward. For validators, this is an opportunity to earn passive income .
But staking, like mining, is costly and technical. To become a validator, you must have the minimum required number of coins. For example, in Ethereum 2.0 it is 32 ETH (about $ 100,000 at the current exchange rate). These coins must be kept locked in the wallet for at least several months. You will also need to configure the equipment and keep it connected to the network at all times.
The main advantages of the PoS algorithm:
- Low power consumption compared to PoW algorithms;
- No special equipment (miners) needed;
- High speed and scalability. For example, the speed of the TRON network is 2,000 transactions per second;
- Low commissions;
- Participation in the development of the project. Validators must take part in voting on the future development of the project.
The main disadvantage of the PoS algorithm is the threat of centralization. The validators with the most coins will ultimately control most of the network. Therefore, in recent years, blockchain developers have introduced new versions of the PoS algorithm, which will be discussed below.
Proof-of-Authority (PoA) is a merit and rating consensus algorithm. It is considered an efficient mechanism for private blockchains, was first conceptualized in 2014 by one of the creators of Ethereum, Gavin Wood, and has been used for several years in the Microsoft Azure cloud platform, which includes more than 200 products and services.
PoA is a kind of attempt to combine PoW and PoS. There is no mining here at all, and, therefore, there is no race of computing equipment, as well as huge energy costs. In PoA, validators do not use the power of equipment or the number of coins to generate blocks, but their own reputation.
So, a fixed number of validators, which were chosen by network participants or project developers, are responsible for the network’s performance. This approach guarantees high transaction processing speed and good scalability. At the same time, validators are interested in their work being honest and transparent, otherwise they will lose their status and reputation as a reliable network participant.
The main disadvantage of PoA is the possibility of excessive centralization and lack of motivation for users who do not receive mining or staking rewards. Moreover, within the framework of classical PoA, an ordinary user cannot influence the operation of the blockchain network in any way, since this is done by trusted nodes, as a rule, belonging to the same company.
Crypto projects using PoA are well aware of the shortcomings of consensus and are trying to get around them in various ways. For example, the developers of the UMI cryptocurrency, in an attempt to get rid of PoA restrictions, created their own variation of this algorithm. The main differences between the PoA mechanism in UMI and the classic PoA are decentralization and staking.
Decentralization is achieved by dividing the nodes into two key groups:
- Master nodes – create blocks and confirm transactions. These are the UMI team and the main partners of the project;
- Validator nodes – ensure the operability of the network, check the correctness of blocks and control the work of the master nodes. Anyone can run such a node
The reward for maintaining the UMI network is available through staking. But since there is no staking in classic PoA, the mechanism in UMI is implemented using a smart contract. A smart contract is a special program on the blockchain that automatically performs specified actions when predetermined conditions are reached. A smart contract at UMI ensures that all conditions are met, staking works correctly, and rewards are accrued 24/7.
Here are other features of staking at UMI that were achieved thanks to the smart contract:
- There is no need to freeze coins during staking. They can be withdrawn at any time without loss of interest;
- Coins are credited directly to the wallet of users who have full control over their assets
- There is no minimum stake requirement – a user with any balance can start staking and generate new coins;
- Safety and availability for everyone. The user does not need to launch a node, configure equipment and network parameters, or understand technical nuances. It is enough just in a couple of clicks to connect to one of the existing staking pools (today there are two of them: ROY Club and ISP Club) or create your own. At the same time, the creators of the pools do not have access to the users’ assets, only the users themselves have it;
- Staking is backed by liquidity in bitcoin.
Thanks to this, the UMI ecosystem has become a unique decentralized environment for the crypto market, allowing any participant to transfer coins within the network for free and multiply them using staking, which brings up to 40% of new coins per month.
At the end of 2020, the test version of the updated UMI network took the 4th place in terms of speed among other blockchains, and the average time for generating a new block in the latest version is only 1 second. These changes will soon be integrated into the mainnet. All this makes UMI the optimal blockchain environment available for truly massive use. So, already now the speed of the UMI blockchain is 4,369 operations per second, after the upcoming updates it should increase to 65,535, and can potentially reach 1 million tps and higher.
Delegated Proof-of-Stake (DPoS)
Delegated Proof-of-Stake (Delegated Proof-of-Stake, DPoS) is a type of PoS algorithm created by developer Dan Larimer in 2014. DPoS was conceived as an alternative to PoW and PoS. Its purpose is to deprive validators of the ability to centralize. Famous DPoS blockchains include EOS, Steemit, and Tezos.
DPoS is a more democratic version of Proof-of-Stake. The main difference between the two algorithms is that in DPoS, coin holders (witnesses) transfer their right to approve operations and receive a reward, that is, they delegate their vote to a pre-selected validator (delegate).
Any user of the network can become a delegate. But at any time, witnesses can withdraw their vote – this way avoids unnecessary centralization and capture of the network by unscrupulous participants.
Delegates are united in a special pool, which has the right to make changes to a number of network parameters: the time of mining new blocks, their size, and so on. But delegates cannot cancel transactions or perform fake operations. Therefore, the witnesses have power over the network.
The main advantages of the DPoS algorithm are high speed and greater scalability. There are significantly fewer nodes in the network than in PoW or PoS, which allows you to quickly create new blocks.
Among the disadvantages: with low activity of network participants, the threat of centralization remains, and it is also possible to carry out DDoS attacks and dishonest behavior of delegates, which can cause network failures.
Leased Proof-of-Stake (LPoS)
Leased Proof-of-Stake (Leased Proof of Stake, LPoS) is another variant of the PoS algorithm developed specifically for the Waves blockchain .
LPoS aims to solve the problem of “property qualification” in the classic PoS, in which users with insufficient balance cannot participate in staking and earn new coins. This turns into centralization.
As part of the LPoS algorithm, any network participant can transfer their coins to validators, receiving a share of the profit in exchange. In this case, the coins remain in the user’s wallet, but they cannot be used, transferred or exchanged. The rental can be canceled at any time. It is beneficial for validators to rent coins, as this increases their steak, and, consequently, the chance of a reward.
This approach allows you to earn coins even with a small stake, but makes the network prone to centralization: validators can rent so many coins that they can control the network.
Proof-of-Importance (PoI) is another variation of the PoS algorithm developed for the NEM blockchain in 2015.
Unlike classic staking, in PoI, it is important not only the number of coins blocked in the stake, but also the user’s activity (the number of transactions), and the time of his stay in the network. The more active the user and the higher his reputation in the community, the more his staking income. This encourages members not to store coins in wallets, but to actively use them.
In NEM, the staker reward (coin payout) mechanism is called harvesting. This is an algorithm for keeping track of user activity and balance. The credited coins are first transferred to the user’s passive wallet, and after the accumulation of “merits” are transferred to his active account. One of the conditions for starting harvesting is a minimum stake of 10,000 XEM (≈ $ 2400).
Proof-of-Space (PoSpace; also known as Proof-of-Capacity, PoC) is an algorithm that uses hard disk space to confirm a block, rather than the processing power of a computer.
This is an unusual concept that promises high speed and democracy, but it has not gained widespread acceptance among crypto projects. This algorithm, for example, is used by such little-known projects as Burstcoin and SpaceMint.
The miner reserves a certain space on the hard disk for confirming blocks. First, sets of possible solutions to mathematical problems are generated in the hard disk, then mining itself occurs. The miner does not need to look for a solution to the mining problem – it is already in the memory of one of the hard drives. The more disk memory, the more solutions can be stored there and the more chances that this miner will find the solution.
The advantages of PoC are low power consumption and the ability to mine from any device, even from a smartphone .
Proof-of-Burn (PoB) is an alternative algorithm to the classic PoW and PoS.
The miner sends coins to a special address to which it is impossible to pick up private keys. This means that coins from this wallet cannot be spent either – they are burned. As a reward for this, the miner creates a new block and receives a reward for it in the form of new network coins. The more coins you burn, the higher the chances of getting a block reward.
The advantages of the algorithm: low power consumption and efficiency, because you do not need to spend money on expensive mining equipment. In addition, if the demand persists or grows, the algorithm can increase the value of the remaining coins – after all, their number is constantly decreasing.
The main disadvantage of PoB is that it is only suitable for mature projects in which the main issue of coins has already been completed and they have something to burn. Therefore, the algorithm is not popular, but it is still sometimes used, for example, in the Counterparty blockchain (XCP).
Proof-of-Elapsed-Time (PoET) is a consensus algorithm from Intel. It is considered one of the most balanced and perfect consensus algorithms and is used mainly by enterprise blockchains such as Hyperledger.
PoET works like a lottery. In each node of the network, a random waiting time is generated for a specific block – each time it is different. After that, the node is “frozen” (goes into a waiting period). The block is mined by the node with the shortest block waiting time. A special SGX system makes sure that all this happens in a truly random way.
The main disadvantage of PoET is that it requires the mandatory use of an Intel Software Guard Extension processor that supports SGX.