What Is a Blockchain Consensus Algorithm?

DATE PUBLISHED: NOV 19, 2021
15 MIN

Before we define a blockchain consensus algorithm, it’s crucial to understand what ‘consensus’ means. Simply put, it is a way of coming to an agreement. A blockchain is a decentralized system that’s devoid of a single governing element. To establish some sort of trust between each other, participants should agree on some operating principles that would satisfy everyone. This is the innate function of consensus mechanisms.

Start Trading on 3Commas Today

Get full access to all 3Commas trading tools with free trial period

So, what is a blockchain consensus algorithm? It means a set of particular mathematical rules and functions establishing an agreement between network users and maintaining network operability.  A consensus mechanism ensures that the blockchain is updated, transactions are processed in the right order and manner, and the chain contents’ integrity is preserved over various nodes of the distributed network. 

Consensus vs protocol

Terms ‘protocol’ and ‘consensus’ are often regarded as the same thing. However, a protocol defines the basic rules of blockchain functionality, while a consensus serves as a mechanism that enables operation. A consensus algorithm helps the system to take particular measures for achieving certain results. In a blockchain, algorithms serve to validate transactions and blocks. Thus, Bitcoin and Ethereum are protocols, while Proof-of-Work and Proof-of-Stake are their consensus algorithms.

Old-world approach to solve new-world problems

The paradigm of distributed consensus is not blockchain-specific and was designed to propose solutions for many other distributed systems (for example, NoSQL databases). The problem of the Byzantine consensus (when nodes ‘misbehave’) was first formulated in the 1980s, and methods for solving it appeared in the late 1990s.

However, blockchains differ from other networks in terms of operation. In conventional Byzantine consensus algorithms, participants’ identities are verified through signatures or crypto primitives, and all nodes are known in advance. They change rarely and in a predictable way. With Bitcoin blockchain, mechanics are exactly the opposite. 

Network participants stay anonymous, they can connect or disconnect from the network. At the same time, a blockchain has certain properties, for example, censorship prohibition and objectivity (to determine the current version of the transaction log, you do not need to trust any authoritative sources — the root of trust is in the blockchain itself).

Let’s take a closer look at the different mechanics of consensus used in blockchain.

Proof-of-Work (PoW)

This mechanism is used in the Bitcoin algorithm. To verify a transaction, participants need to publicly prove the work done. This rule saves system integrity in case an attacker creates fake voters. The more work is done, the faster a new block is generated and the faster miners get their reward. PoW is considered the easiest and at the same time the most stable algorithm from a decentralization and anonymity standpoint. Currently it is used for BTC, LTC, DOGE and some other cryptocurrencies.

Pros

Cons

  • High security.
  • Decentralized transaction validation.
  • Allows miners to earn.
  • The possibility of 51% attack is pretty low.
  • Low transaction speed and high fees.
  • Excessive energy consumption.
  • Mining requires expensive equipment.

Proof-of-Stake (PoS)

The Proof-of-Stake is very similar to voting among the shareholders of a company — the ones with the majority of shares have the highest voting power. Thus, it is not a matter of vote number — it is about their weight.

The advantage of PoS is participants’ motivation to honestly confirm transactions. In PoW, a 51% attack is theoretically possible, although it would be meaningless to hackers. In a PoS system, an attack is possible if more than half of the stakeholders join forces and funds. 

So far, there is no time-tested and 100% safe PoS-based method, they are all under development. At the same time, developers are attempting to unite the advantages of PoW and PoS in the new Ethereum consensus algorithm through the Casper protocol.

Pros

Cons

  • A significant reduction in electricity consumption (relative to the PoW method).
  • To perform an attack, participants should concentrate over 50% of coins, which would be too expensive. Besides, any malicious action will affect the cost of the cryptocurrency.
  • Some participants are motivated to concentrate funds which might lead to the centralization of the network.

Delegated Proof-of-Stake (DPoS)

DPoS appeared in 2014 and is used in such blockchains as EOS, Steemit, Ark, List and BitShares. The main idea behind Delegated Proof-of-Stake is that each user can vote for delegates — those who approve transactions. The identities of the delegates are known in advance. 

Owners of the highest consensus token volumes have the highest voting power. One client can vote for several delegates. When delegates are chosen, they will generate blocks and verify transactions randomly. With each block created, the delegate's rating grows. If a block generator is suspected of cheating, other candidates can cancel their actions by approving the correct transactions and generating the right amount of blocks.

In all DPoS algorithms, the tokens held by participants are used for staking — an alternative to mining. However, in this case, profit is made by holding coins. 

Pros

Cons

  • Very high transaction processing speed. 
  • High safety. 
  • Minimum technical requirements to participants.
  • Large participants can centralize the network by owning huge token volumes. In all other cases, fraud is impossible.

Proof of Importance (PoI)

Proof of Importance (PoI) crypto consensus is an extended version of PoS that’s used for the NEM blockchain. In addition to considering the number of participants with coins, the algorithm analyzes users’ behavior. For example, where, when and how often coins are transferred by participants. This way, power is not concentrated in the hands of the richest participants.

Stability is maintained by granting the priority votes to the participants with the best reputation. The protocol encourages those who regularly use the currency for trading purposes and interact with other participants while increasing their overall activity. Other criteria that are taken into account by POI include 1) time of account activity; 2) the number of coins available. 

The Proof of Importance solves serious disadvantages of the POW algorithm — centralization and energy costs. The algorithm involves mining in the form of commissions received for transfers from one account to another.

Pros

Cons

  • The most active nodes become the leading ones. Voting power does not depend on the volume of stored coins.
  • Miners have to maintain coin flow to have power.

Proof-of-Burn (PoB)

In this case, a miner sends coins to a random address of the generated hash, so it is almost impossible to spend funds from this address since the probability of brute-forcing keys is close to zero. The chances of block mining increase as the number of coins burned grows. Economically, this process of burning coins can be thought of as buying a mining rig. Naturally, such an algorithm makes sense to use only at the later stages of cryptocurrency existence, when there is something to "burn". This method is also well-suited for transferring from "old" to "new" cryptocurrencies.

Pros

Cons

  • Exceptional security.
  • It impacts the total amount of coins and, consequently, their price. 
  • Not suitable for a new blockchain with a small number of blocks mined and a small volume of coins in circulation

Proof-of-Authority (PoA)

Proposed by Gavin Wood from Ethereum in 2015, the PoI consensus mechanism became increasingly popular. It solves one problem that Proof-of-Stake overlooks. While in PoS, it’s supposed that the power is concentrated in hands of the largest token volume holders, it does not necessarily imply that people with the same amount of coins are equally interested in network maintenance. The idea behind PoA is that people stake not their coins, but their identity. Validators in PoA need to sustain a good reputation for the right to mine blocks.

Hence, there’s no need to consider monetary discrepancies between validators. Yet, the identity requirement makes PoA not applicable in large networks, such as Bitcoin. Besides, entities with validating experience are most commonly accepted, so it’s almost impossible for a regular person to become a validator. PoA is well-suited for:

  • Enterprise-level networks like The Waves Enterprise Blockchain Platform.
  • Testnets. For example, Polkadot launched its beta version on PoA before switching to PoS. 
  • Sidechains. Ethereum’s POA Network connected via a two-way bridge relies on pre-chosen validators whose identities are known and verified.

Pros

Cons

  • The number of owned coins does not matter — validators’ reputation is taken into account instead.
  • Optimal speed and performance.
  • Lack of scalability.
  • PoA is not applicable for large blockchains and should rather be used in testnets, sidechains and corporations in need of a proprietary blockchain.

Byzantine Fault Tolerance (BFT)

The Multisignature and Byzantine Fault Tolerance consensus algorithms are worth considering together. They are used to reach an agreement among a limited group of people. In the case of Multisignature, these are only a few participants, in Byzantine Fault Tolerance, dozens. Byzantine Fault Tolerance only makes sense when all parties know each other.

Pros

Cons

  • Ability to maintain data correctness even in case of attacks and vulnerabilities.
  • It ensures information processing in heterogeneous environments.
  • High efficiency in terms of computations and energy.
  • The more nodes are involved the higher is security.
  • The approach is hard to implement. In case of mistakes, network security is put at risk. 
  • A growing number of nodes harms network scalability and bandwidth.
  • It requires initial trust between participants.

Federated Byzantine Agreement (FBA)

The FBA decentralized consensus was originally implemented in Ripple and later enhanced by Stellar Consensus Protocol (SCP). The mechanism allows reaching agreement among a large number of participants the total number of which is unknown.

Each participant trusts a limited number of other participants forming a "circle of trust" or “quorum” in which they easily reach an agreement. Hence, a quorum is a minimum number of nodes required for a solution to be correct. Ultimately, many quorums somehow allow reaching full agreement across the entire network. ‘Quorum slices’, in their turn, are a set of nodes that would be enough to prove another node’s validity. 

Pros

Cons

  • All nodes are known and verified even before the process of block generation starts.
  • High throughput and network scalability. 
  • Low transaction cost.
  • As in the case of SCP, there is no incentivization for nodes and no system for token emission.

Other algorithms

Proof of Elapsed Time

It randomly decides on the block generator depending on the time they spent waiting. For this purpose, each node is assigned some random waiting time. The user whose time finishes first will produce a block. This approach is applicable only when the system can verify that no users are operating multiple nodes and the time is genuinely random.

Proof of Capacity

Another interesting approach to public consensus definition, PoC is implemented through solutions to mathematical puzzles that are stored on hard drives. When the device is filled with calculations, it can serve users to produce blocks. Thus, participants with the highest capacity have higher chances of producing blocks. 

Proof of Activity

This is a combination of PoW and PoS, which means users can both mine and stake coins. In this case, miners generate new blocks to earn token rewards but blocks do not include transactions. Instead, those are empty templates that include free space for transaction title and block reward address. After that, a validating node is selected randomly to sign a block and confirm it for the ledger. The network fee is split between miners and block validators.

They are gaining popularity because of their potential to solve scalability problems. DAG is a directed graph with data based on topological sorting. Its development proceeds in one direction only — from early to late blocks. 

Due to the blockless device, all transactions are made on the DAG networks, so this process takes much less time than in the case of PoW and PoS. There are no miners on the DAG network. Confirmation is carried out directly in the transactions themselves, so they are processed instantly.

Bottom Line

A blockchain consensus algorithm is an essential part of any network. It defines the entire governance process and ensures that participants follow the rules while keeping the integrity of data blocks. As shown in this article, various consensus mechanisms are used to achieve agreement between users but so far, none of them has proved to be perfect. Each approach has pros and cons and should be chosen according to the nature of cryptocurrency and underlying blockchain.