Consensus plays an important role in our lives. Without it, involved parties would be unable to make decisions on important issues.
Imagine a case when there is an urgent matter to solve, and a whole country is incapable of acting. In such situations, decision-makers have to come to an agreement to solve the issue. There’s no way around it.
And the same applies to blockchain systems that utilize consensus mechanisms so participants can come to an agreement within the network.
Without a proper consensus algorithm, a blockchain network would become no more than a simple, immutable database. As a result of the lack of an agreement within the network, miners would be unable to process and verify transactions, rendering the whole ecosystem unusable.
And here, we’d like to introduce you to the world of consensus mechanisms while exploring how the different types of algorithms work.
- To reach a general agreement on the validity of transactions, consensus algorithms are responsible for ensuring that network participants follow its rules.
- The objectives of blockchain consensus mechanisms include facilitating a unified agreement between nodes, incentivizing participants to follow the rules, ensuring fairness and equity, preventing issues like double-spending, and making sure that the network remains fault-tolerant.
- While Proof-of-Work (PoW) is the most popular consensus mechanism among blockchain solutions, there’s a wide variety of algorithms decentralized projects can use to facilitate an agreement between network participants.
- Due to the decentralized nature of blockchain technology, the consensus mechanism plays a critical role in maintaining that the network remains secure and functional.
What Is a Blockchain Consensus Algorithm?
Simply put, a consensus algorithm is a mechanism that allows the participants of a blockchain network to come to a general agreement.
Consensus algorithms are critical for blockchain solutions as these systems are decentralized by nature, meaning there is no central authority within the network.
Due to the above-mentioned, nodes (also referred to as miners or validators) – who maintain blockchain networks – have to agree on the validity of transactions.
A consensus algorithm makes this possible by ensuring that network participants follow its rules as well as guaranteeing trustless transactions within the blockchain system to eliminate issues like double-spending.
What Are the Goals of Consensus Mechanisms?
In this section, we’ve listed the most important objectives of consensus mechanisms that will help you in understanding how the algorithms work.
Facilitate a unified agreement: In centralized systems, trusting an authority is necessary to keep the network operational. However, consensus algorithms allow blockchains to function without requiring the participants to trust each other. And this underlying mechanism of the ecosystem is responsible for facilitating a unified agreement between network participants, ensuring that all processed data is valid and that the distributed ledger is up-to-date.
Align an economic incentive: Since a decentralized system like a blockchain network regulates itself on its own, it’s important to align the interests of the participants to ensure that it functions efficiently. To make this possible, the consensus mechanism uses economic incentives to reward users for good behavior while punishing bad actors.
Ensure fairness and equity: The consensus algorithm is also responsible for ensuring fairness and equity among network participants. Therefore, anyone should be able to join the network, and everyone should have equal rights to vote.
Prevent double spending: Double spending is one of the greatest risks that comes with digital payments. Since this issue could negatively affect the value of digital assets (and may render them useless), the consensus algorithm eliminates double-spending by ensuring that only verified and valid transactions are included on the public ledger.
Ensure a fault-tolerant blockchain: By ensuring that the blockchain is fault-tolerant as well as consistent and reliable, the consensus algorithm allows the network to continue operating even when major threats, failures, and other incidents occur.
The Overview of the Most Exciting Blockchain Consensus Algorithms
At the time of writing this article, over 5,000 digital assets exist in the market.
While many of them utilize popular algorithms – such as Proof-of-Work (PoW) and Proof-of-Stake (PoS) –, a part of them has created their own mechanisms to fuel their ecosystems and reach consensus via alternative ways.
In this section, we’ll introduce you to the most exciting blockchain consensus algorithms.
Let’s dive in!
PoW blockchain examples: Bitcoin, Ethereum, Litecoin
Proof-of-Work (PoW) is by far the oldest and most popular consensus algorithm among blockchain networks.
Proposed by BTC creator Satoshi Nakamoto in the original Bitcoin whitepaper, PoW combines the features of existing concepts – such as P2P networks, Merkle chains, and cryptographic signatures – to create a distributed trustless consensus.
The consensus mechanism requires miners to actively use their computational power to solve complex mathematical puzzles in order to verify transactions and add them to the blockchain.
It’s important to note that miners in PoW networks are competing with each other to receive block rewards (after new coins are generated by the miner), while they also get their share from transaction (miner) fees.
An interesting fact about the PoW model is that the mathematical problems solved by the miners have no use in theory as the results of the calculations can not be used anywhere elsewhere.
However, in practice, the puzzles ensure that miners are committing a significant amount of resources – a combination of time and in is tekent in mining equipment – to avoid causing harm to PoW networks.
Even if malicious miners decide to cause harm to the ecosystem, they are hurting themselves too as they have to spend a fortune to carry out the attack.
For a 51% attack, the bad actor has to purchase mining equipment that has the computational power of taking over the majority of the network (which would cost over $1 billion in case of Bitcoin).
Because of the same reason, PoW networks where miners are able to maintain high amounts of computational power are considered to be safe.
Furthermore, as the Proof-of-Work model is the longest-used consensus mechanism in the blockchain industry that has gone through numerous tests and trials, PoW is considered as a stable algorithm.
However, PoW’s age is also considered a drawback since multiple newly released consensus algorithms can operate at faster speeds while maintaining a more efficient network.
Also, the continuous operation of numerous hardware mining rigs amasses a lot of energy unnecessarily, which causes harm to the environment.
According to the University of Cambridge’s energy index, Bitcoin consumes more power in a year than Chile, a South American country with a population of 17.5 million.
Furthermore, due to the rising popularity of application-specific integrated circuit (ASIC) mining rigs, some PoW blockchains are facing the threat of increased network centralization as ASIC equipment is expensive and not everyone can afford them.
However, this issue only affects blockchains networks where the hash algorithm that allows ASIC miners to participate in the network (e.g., Bitcoin).
PoS blockchain examples: Ethereum (in the near future), QTUM, Decred
Many in the blockchain space see Proof-of-Stake (PoS) as the solution to the inefficiencies of the PoW model.
With PoS, there is no mining involved. Instead, users who’d like to participate in the network are required to stake – or lock up some of their coins in a network wallet for a certain period of time – to validate blocks.
The amount of coins a validator has staked is used as the measure in PoS networks to determine who will be the one that verifies the next block via a pseudo-random election process.
For example, if a user stakes 50% of the total number of staked coins, he has a 50% chance of being chosen to validate the next block on the blockchain.
As validators don’t mine but instead forge new coins in PoS blockchain networks, successful stakers will be rewarded with transaction fees only (unlike in PoW networks where miners receive a combination of block rewards and miner fees).
Since stakers don’t have to operate mining rigs to validate blocks in PoS systems, this consensus model is more energy-efficient than the PoW algorithm.
Furthermore, blockchains utilizing the PoS consensus mechanism generally offer better protection against 51% attacks as malicious parties will lose the total or a part of their stake after the network detects a fraudulent transaction.
Bu contrast, bad actors in PoW networks get to keep their mining equipment after an unsuccessful attack.
Also, to execute a successful attack, malicious parties would have to acquire 51% of the cryptocurrency’s total circulating supply, which is over 9.3 million BTC (equaling nearly $56 billion at the time of writing this article) in Bitcoin’s case.
One of the downsides of PoS systems is the presence of the “nothing-at-stake” problem, which could occur in the case of hard forks (major network upgrades where the new version of the blockchain is not compatible with the previous version).
Since, unlike with the PoW model, there is nothing to stop PoS validators from voting to multiple versions of a blockchain in the case of an ongoing hard fork, this issue could prevent network participants from reaching consensus.
However, multiple blockchains have been experimenting with measures (such as punishing malicious validators) to solve this issue.
Delegated Proof-of-Stake (DPoS)
DPoS blockchain examples: EOS, TRON, Aelf
The Delegated Proof-of-Stake (DPoS) consensus algorithm works similarly to the PoS model as this mechanism also requires network participants to stake their coins.
However, the major difference between the two algorithms lies in who actually does the validation of the blocks.
While the stakers are the validators themselves (in case they are selected) in PoS networks, stakeholders in the DPoS model outsource the validation of the blocks to a number of delegates.
The delegates – also referred to as witnesses – secure the blockchain system on behalf of the stakeholders, while being responsible for ensuring consensus in the network during the validation of new blocks.
DPoS blockchain networks utilize a democratic voting system, in which the stakeholders cast their votes on the delegates who will present an individual proposal to the stakeholders to secure their votes.
While the voting power is based on the amount of coins network participants have locked up in their wallets, the rewards of a successful block validation are shared between the delegates and the stakeholders who have elected them.
As a result of this process, DPoS allows for better screening of block validators as stakeholders will cast their votes based on their reputation. Also, stakeholders can expel or replace misbehaving or non-efficient delegates with other witnesses anytime.
Unlike in PoW and PoS systems, validators are not competing with each other in DPoS networks. Instead, they are working together to generate and validate new blocks.
While the collaboration-specific focus of this consensus algorithm allows blockchains to achieve fast speed and high scalability – in addition to being energy-efficient like PoS systems –, the structure of the network also comes with a higher level of centralization.
Furthermore, EOS – one of the most popular blockchain networks that utilizes DPoS – is facing issues that allow stakeholders locking down large amounts of cryptocurrency to cast their votes on themselves, highlighting a vulnerability within Delegated Proof-of-Stake systems.
PoA blockchain examples: DockToken, VeChain, POA.Network
Proof-of-Authority is a unique consensus mechanism that uses a reputation-based model to validate transactions and generate blocks.
Originally proposed by Ethereum co-founder and former CTO Gavin Wood, instead of using their cryptocurrency funds, validators within PoA blockchains stake their reputation by leveraging their real identities.
These trustworthy validators are pre-approved and selected by network participants to act as moderators of the system that are responsible for block verification and generation.
PoA blockchains make it difficult for candidates to become validators on purpose as they not only need to stake their reputation, but they also have to be willing to invest money to support the ecosystem.
This allows the network to eliminate validators that have a dubious reputation while incentivizing honest nodes for a long-term commitment.
However, for the consensus algorithm to work, network participants have to use the same standard method for all candidates to provide them equal chances of becoming validators.
As the number of validators is limited in PoA networks, the consensus mechanism allows the blockchain to achieve a high level of scalability.
Because of the same reason, PoA blockchains are highly centralized, which makes the consensus algorithm a good choice for private, permissioned chains for enterprise use but could raise some questions when utilized for distributed, permissionless systems.
In addition to the high level of centralization, the limitations of the consensus model include the lack of privacy as the identities of validators are visible to all participants within PoA blockchains, which could increase the chances of the third-party manipulation of nodes.
Consensus Algorithms Based on Byzantine Fault Tolerance (BFT)
Byzantine Fault Tolerance (BFT) is a feature of blockchain networks that helped to create the most interesting blockchain consensus mechanisms.
To understand BFT, let us present a logical dilemma to you, which has been frequently discussed in the distributed computing space.
The basic concept of the dilemma, called the Byzantine Generals’ Problem, includes multiple generals of the Byzantine army that have surrounded a city in a siege.
Each general is located at a distance from the others, and they will have to communicate with each other to decide on their next move: to attack or retreat.
However, for their move to be successful, the generals have to reach a common consensus.
To achieve the above-mentioned, each general has to make a decision (attack or retreat), which can’t be changed later. Furthermore, all Byzantine generals have to agree on the same decision, which they will have to execute in a synchronized way.
The main issues of the generals include message delivery problems – as they have to use couriers to carry a message to the other generals, which could be delayed, lost, or destroyed – as well as malicious actors in case one of the leaders decides to send fraudulent information to confuse the other generals.
In terms of blockchain networks, the Byzantine generals represent the nodes (miners, delegates, stakeholders, etc.) that have to reach a consensus on the current state of the ecosystem and execute the same action to avoid failure.
However, to achieve this goal, the majority of the nodes have to act honestly as, in the opposite case, the network will be prone to attacks (e.g., 51% attacks) and failures.
Byzantine Fault Tolerance represents a group of consensus mechanisms (that we briefly explore in the following sections) that are resistant to the failures related to the Byzantine Generals’ Problem.
Therefore, a blockchain utilizing a BFT variant has the capabilities to remain functional even when some of its nodes act maliciously or cease to operate.
Practical Byzantine Fault Tolerance (pBFT)
pBFT blockchain example: Zilliqa
The Practical Byzantine Fault Tolerance consensus algorithm is based on the assumption that node failures will eventually occur (a general’s message is not delivered to the others) while other network participants will eventually communicate malicious information (a general sends a fake message to confuse the other leaders).
All nodes within pBFT blockchain networks are ordered in a sequence where one of them gets to be the leader who will function as the primary node while the others serve as backup nodes.
While all nodes communicate with each other, they have to verify the source of the message and prove that it was not modified during the transfer.
In case the backup nodes find the leader faulty or malicious, they can replace it with the next leader in line.
Due to the above-mentioned, pBFT systems can operate continuously if the blockchain can maintain that at least two-thirds of the nodes are honest and functional. And, the more nodes are present in the network, the more the chance it can remain operational.
The structure of the pBFT consensus model allows the blockchain to operate with high performance, consume low amounts of energy, and require no confirmations to finalize transactions.
On the other hand, as there is heavy communication between the nodes, pBFT operates with the highest efficiency when the consensus group sizes are small.
However, when there is only a small group of nodes in the network, blockchains utilizing the pBFT model are prone to Sybil attacks, an attack-type where a single malicious actor can create or manipulate a large number of nodes to compromise the network.
A good way to mitigate Sybil attacks is to increase the number of nodes within the network. However, that would result in a lower level of scalability and a slower network.
Federated Byzantine Agreement (FBA)
FBA blockchain examples: Ripple, Stellar
Introduced in Stellar Network’s whitepaper, the Federated Byzantine Agreement (FBA) is designed to solve the inefficiencies of pBFT while taking advantage of the latter consensus algorithm’s benefits.
While the pBFT algorithm uses the concept of a quorum, FBA utilizes quorum slices. Let us explain this with an easy example.
You apply for a job at a company’s marketing team. To accept your application, the organization requires all of its employees to review your application, and the majority of the workers have to state that you are a good fit for the position.
This is called a quorum in distributed computing. However, requiring all the workers to get involved in a hiring decision making is unnecessary.
Instead, it would make more sense to convince the marketing team only to make a decision as its members will be the ones you will be directly working with (if they hire you).
In this example, the marketing team is your quorum slice that, after an agreement is reached, will communicate with the other teams and stakeholders within the company to hire you for the position.
In terms of blockchain, distributed solutions utilizing the FBA algorithm use quorum slices (instead of quorums) to reach consensus when deciding on the chain’s current state.
The above-mentioned structure allows FBA to achieve a higher level of scalability and security, as well as decentralized control and flexible trust.
Delegated Byzantine Fault Tolerance (dBFT)
dBFT blockchain example: NEO
Think of Delegated Byzantine Fault Tolerance (dBFT) as the DPoS of BFT-focused blockchain consensus mechanisms – that is exclusively used in NEO’s network.
Like in DPoS systems, stakeholders use delegates – called bookkeepers – to reach consensus and generate new blocks. Also, holders of NEO tokens vote for their bookkeeper of choice in real-time, rather than using a fixed term.
An interesting aspect of bookkeepers is that they have to use their real identities, which they have to verify in order to secure stakeholder votes.
Due to this fact, there’s no anonymity on dBFT blockchains. Because of the same reason, the level of centralization remains high as distributed solutions utilizing this consensus model have to operate in a fully regulated way.
On the other hand, dBFT features a rapid block generation (taking between 15 to 20 seconds), high scalability, energy-efficiency, as well as transaction finality (as they can’t be reversed or modified after confirmation).
Consensus Mechanism: the Root of Blockchain Networks
While it’s important to reach consensus in our everyday lives, it’s even more crucial for nodes to come to an agreement within blockchain networks.
Due to the above-mentioned reason, consensus algorithms are among the most important components of blockchain solutions as these mechanisms are responsible for making sure that an agreement is reached within the network so transactions are verified, and new blocks are generated.
Also, as there is no central authority within blockchain networks, the consensus algorithm’s rules are responsible for making sure that the system is secure and operational.
Did you know that you can trade (almost) all of the coins listed in this article on AAX?