A Guide to Consensus Algorithms

A Guide to Consensus Algorithms

Proof of Work, Proof of Stake, and Proof of Authority are the most popular consensus algorithms. Discover them.

A Guide to Consensus Algorithms

Consensus algorithms have somehow gained a mystic appearance in the industry. This article attempts to demystify the main differences between them by first defining consensus algorithm before diving into the primary mechanisms, briefly describing alternative implementations.

After that, differences and similarities between consensus mechanisms are drawn out to allow you to identify what fits your business needs.

What is a consensus algorithm?

In blockchain and other distributed ledgers, the consensus can be defined as:

in a distributed network, the consensus mechanism is how machines and validators agree in how to process and organize transactions.

Consensus algorithms are among the core elements in how a network processes transactions while keeping all participants synchronized in the network’s data.

Since the launch of Bitcoin in 2009, the number of consensus algorithms has exponentially increased, serving the needs of thousands of blockchains.

Yet, amidst this growing complexity, there are three core families of mechanisms: Proof of Work (computing-based), Proof of Stake (incentive-driven), and Proof of Authority (identity-based)

What are the main consensus algorithms?

There are three leading families of consensus algorithms that can be used for distributed ledgers: Proof of Work ("PoW"), Proof of Stake ("PoS"), and Proof of Authority ("PoA").

Proof of Work ("PoW")

In Proof-of-Work blockchains, validators are miners who need to solve a computational problem to organize and produce a block. The world’s first blockchain, Bitcoin, relies on Proof of Work. For instance, Bitcoin transactions are organized and validated through a process named “mining".

By definition, PoW blockchains allow anyone to compete for validating transactions on the network. Since there is a monetary cost to confirm transactions (due to the computation problem leading to electricity costs), misbehavior is discouraged and extremely costly.

There is a wide range of mining algorithms such as SHA-256d (Bitcoin, Bitcoin Cash), Script (Litecoin), RandomX (Monero), Equihash (ZCash), or ETHhash (Ethereum).

Proof-of-Work consensus has its significant share of criticisms, notably due to its high environmental cost, high costs, miner concentration, and other vector attacks (e.g., Sibyl attack, 51% attack low mining participation). These have led to the fast expansion of alternative consensus algorithms such as Proof of Stake and Proof of Authority.

Proof of Stake ("PoS")

Unlike Bitcoin, Proof-of-Stake ("PoS") blockchains rely on the concept of masternodes. In this case, masternodes are the network validators of the ledgers and serve the same function as miners in Bitcoin: masternodes validate and organize transactions in blocks. To do so, each of them is required to lock a significant amount of cryptocurrencies (e.g., ATOM) as a monetary commitment to avoid bad behavior.

In the event of wrong operations (or apparent misconduct), committed funds would be slashed with usually different penalties for each specific event. For instance, a masternode being offline typically is likely to receive a financial penalty lower than an attempt to re-organize a network.

In Proof-of-Stake networks, masternodes are rewarded by collecting transaction fees on the network. Furthermore, while a standard node allows third parties to monitor and verify transactions independently, masternodes are nodes that also validate incoming transactions (and collect network fees to do so).

There are a wide variety of PoS implementations, such as Delegated Byzantine Fault Tolerance ("DBFT"), Delegated Proof of Stake ("DPoS"), and Proof of Stake Voting ("PoSV"). For instance, some of these allow users to vote for masternode in a democratic process called vote delegation and to collect some of the network fees by doing so.

Popular networks like Cosmos use PoS-based implementations for consensus finding. However, the most anticipated public network is perhaps Ethereum, which is expected to transition to a Proof-of-Stake consensus algorithm by the end of 2020.

Proof of Authority ("PoA")

With the use of Proof of Authority ("PoA"), validators have their identity verified, resulting in an incentive to behave to prevent any reputational loss and other real-world legal actions well.

For instance, a company acting as a validator on a PoA network that would purposely be censoring transactions from a competitor would likely face legal actions and reputational damage.

The use of Proof of Authority was proposed in 2017 by Joseph Lubin, one of Ethereum’s co-founders who co-founded ConsenSys. PoA is currently used in multiple Ethereum testnets and even in public and private blockchains.

There are a variety of implementations for Proof of Authority for distributed ledgers. The most notable applications are Clique POA, Raft, IBFT, and PBFT.

Hybrid consensus mechanisms ("PoW/PoS")

Some consensus mechanisms are also referred to as “hybrid" as they combine elements from both Proof of Stake and Proof of Work. Usually, they rely on both masternodes and miners for finding consensus on the network.

For instance, Dash is a popular public permissionless network with a focus on user privacy. Dash relies on a pool of miners (i.e., PoW) and a system of masternodes (i.e., PoS). Masternodes are used to validate specific transactions and in charge of the network governance while miners also receive fees for organizing blocks and verifying timestamps.

Other consensus mechanisms

Proof of Elapsed Time ("PoET")

Proof of Elapsed Time is designed as an alternative to Proof of Work through the use of a lottery system. Each participant is assigned a waiting time and a number. If selected, the validator becomes the next block producer.

The main network relying on PoET is Hyperledger Sawtooth.

Proof of Burn ("PoB")

Proof of Burn relies on a mechanism that let validators send funds to a non-spendable address to prove their work. There are multiple implementations of this mechanism, but it is considered an alternative of Proof of Work: the required computing resource cost is replaced by a “burn transaction" leading to a financial loss from the perspective of block validators.

Auxiliary PoW ("AuxPoW")

Auxiliary PoW is a mechanism allowing users to rely on the existing computing power for Proof-of-Work blockchain used for consensus and to redirect this power to other blockchains referred to as child blockchain in a process called merged mining. For instance, Dogecoin is a cryptocurrency designed a joke on the Internet that has got extremely popular. It is currently merged-mined with Litecoin as their miners can also decide to mine Dogecoin with no associated cost (and collect additional rewards!).

Due to their use of the same computing resources between some cryptocurrencies, merged mining prevents competition between two blockchains for the same pool of miners.

Differences and similarities between consensus algorithms

Proof of WorkProof of StakeProof of Authority
Energy consumptionHighMedium to lowLow
TrustTrustlessTrustlessTrust-based
Transaction costsYesYesNo
Validator requirementsHardware (e.g., ASIC, GPU) (+ nodes)Software (+ nodes)Software (+ nodes)
Validator incentivesBlock subsidy rewards + transaction feesTransaction fees + staking rewardsReputation alignement (+ potential transaction fees)
Costs to operate the networkHighLowLow
Permission for validatorsPermissionlessPermissionless (Permissioned can be an option)Permissioned
Private/Public?PublicPublic or PrivatePublic or Private
Examples of consensus finding algorithmsSHA-256d, Script, RandomXDPoS, DBFT, PoSVRaft, IBFT, Clique POA, PBFT
Examples of projectsBitcoin, Litecoin, MoneroAlgorand, CosmosQuorum

What consensus algorithm is right for me?

When it comes to choosing a consensus algorithm, it is fair to say that no size fits all. In general, the choice of a consensus algorithm depends on your preferences and your set of requirements, scope, and range of use cases.

Several questions need to be answered to decide what consensus mechanism to select:

  • Will your scope of use cases be enterprise-restricted or part of a consortium?
  • What type of data will be shared on the network?
  • Will your data need encryption?

Finally, the choice of a consensus algorithm works in tandem with deciding the distributed ledger solution that fits your needs.

Read more about similar topics