Satoshi Nakamoto first highlighted the importance of consensus algorithms for blockchain networks, in the Bitcoin Whitepaper. Since then, thousands of blockchain projects are emerging continuously, each one adopting a consensus algorithm or in other words – its algorithmic governing rules. As Satoshi explained, “Any needed rules and incentives can be enforced with this consensus mechanism”.
Consensus algorithms achieve the necessary type of agreements within distributed networks or systems, therefore are perfectly applicable to blockchain ecosystems. Ideally, these mechanisms must enable reliability and fault tolerance, which enhance trust even among unknown peers. Typical “duties” of consensus algorithms include deciding which nodes are reliable to broadcast transactions and defining which transactions are eligible to be included on the blockchain.
Consensus algorithms determine how protocols differ in terms of speed, decentralization, security, the finality of transactions, and other important aspects. According to Vitalik Buterin’s blockchain trilemma, a blockchain can only be optimal on two of the three key functionalities – scalability, security, and decentralization. This blog post goes through the main characteristics of some of the most common consensus algorithms within the blockchain ecosystem.
Proof of Work
Proof of Work (PoW) became popular for being the consensus mechanism behind Bitcoin. It enables the selection of a miner (that must also be a node). Miners compete with each other in order to solve complex mathematical problem. The miner that solves this puzzle first, will be eligible to mine the next block of the chain.
Miners contribute significant processing power in order to hash and propagate block data and become eligible to mine blocks. Therefore, this process is costly for the miner and wasteful to the environment due to the competition and the complex computations needed to win the mining race. PoW proved to be secure for Bitcoin, however, several issues emerge through the years such as increased centralization from mining pools, low transaction throughput, and high fees.
The miner puts together a bundle of information including among others a timestamp, the hash of the previous block, and a nonce (random number) to create the block header. This block header is hashed using the SHA-256 algorithm. If the output results in lower mathematical output than a given target which is the same for all competing nodes, a new block is created. If not, the miner tries to solve this puzzle again by changing the nonce.
You can watch this demo to get a feel of how the SHA-256 hashing algorithm and the adjustment of nonce changes a given output.
Proof of Stake
Proof of Stake (PoS) relies on the number of tokens held by nodes rather than computational power, in order to determine who will validate the new block. Nodes must stake a specific amount of tokens, similar to a bank deposit. The more tokens a node stakes, the more the chances of a node being the validator for the next block. Ethereum is soon going to switch from PoW to PoS. Additionally, other popular blockchains adopt this mechanism including Solana, Tezos, Algorand, and Cardano.
This process saves a lot of computational energy and does not require special mining equipment. Therefore, it is much more environmentally friendly than PoW. Moreover, it has a faster execution time and the transaction fees are relatively low. However, PoS favors nodes holding large amounts of tokens, while some blockchains also require locking tokens for an extensive-time period.
The validating process on PoS is similar to PoW up until the hashing of the block header. After the hashing occurs, the token age derived from the address of the competing validator is evaluated. If it is higher than a given target, the node becomes the validator of the next block.
Delegated Proof of Stake
This consensus algorithm is an evolution of the PoS, as it allows users to vote for the next block validator by spending a number of tokens. Therefore, this is a situation of token holders electing delegates, rather than creating blocks themselves.
Delegated Proof of Stake (DPoS) is sustainable, scalable, and very efficient in terms of energy consumption. Thus, it eliminates the need for computational power by token owners. The inclusion of the voting mechanism ensures a degree of security among peers. It is relatively more centralized than PoS. This is because the delegates have the authority to define protocol rules and the status of transactions.
Token holders vote on delegates by committing their tokens into a centralized staking pool, which corresponds to a specific delegate.
Proof of Burn
Proof of Burn (PoB) is another alternative to PoW that saves energy consumption. The protocol rules allow users to burn tokens and create new blocks proportionately to the tokens burnt. Miners do not waste physical resources. The burning of coins indicates the commitment of a user toward the network.
Miners actually compete to mine a new block by burning their tokens to get a “mining rig”. The more tokens burnt, the most powerful their mining rig is. Burning of tokens occurs by sending them to an unspendable address with no private keys. PoB supports periodic burning of tokens i.e. the significance of burnt tokens reduces as new blocks are mined.
PoB enhances scarcity and security in a blockchain network. Mining usually occurs by burning Bitcoins or a native token such as in the case of BNB.
Proof of Authority
This mechanism involves a high degree of centralization in comparison to alternative consensus algorithms. Proof of Authority (PoA) is ideal among governmental or private institutions and entities, where a centralized party assigns nodes with the responsibility of creating new blocks.
Therefore, PoA cannot be trusted for public blockchains but is rather suitable for permissioned networks. However, even in centralized ecosystems like a governmental authority the authority or the administrator may be malicious. This aspect carries the risk of modifying transactions and the history of the chain.
In ideal instances, PoA is very secure as the validators are known and usually trusted by participants. The network is fast and efficient in terms of energy consumption. The concept behind PoA is that conventional internal procedures can be executed with high efficiency, speed, and low transaction costs via the use of blockchain technology. The main disadvantage of such a network is the lack of decentralization.
Proof of Elapsed Time
Proof of Elapsed Time (PoET) aims to achieve fairness among participants via a lottery system to determine block winners. The lottery mechanism is transparent and ensures a transparent ecosystem. Leading microchip manufacturer Intel developed the PoET consensus algorithm, in order to equally share the chances of block creation among the network.
Nodes enter into a sleep mode and perform various tasks to enhance network efficiency. Each node “sleeps” according to a different wait time. The node that “wakes up” first is the winner of the next block. Then, the mining process is similar to PoW, but without the hassle of high computational power.
PoET is mostly ideal for private blockchain networks such as Hyperledger Sawtooth.
An interesting scientific analysis of the main consensus protocols can be found here.
Follow The Crypto App blog for more blockchain educational material.