Different Types of Consensus Algorithms Explained
At the heart of every cryptocurrency is a distributed ledger. In many ways, this ledger is very similar to those used in accounting for thousands of years. Users’ available funds and every transaction they make are recorded.
However, there’s a crucial difference between traditional accounting ledgers and those used in cryptocurrencies (also known as blockchains). Blockchains do not rely on a central authority to record transactions.
Traditional accounting ledgers require users trust whoever updates them. This central authority – perhaps a bank or some other payments company – is the only entity allowed to record transactions. If every user were free to update the ledger, the system would quickly fail since there would be nothing to stop them from cheating the system for their own gain.
By contrast, anyone can technically update a public blockchain ledger. However, there needs to be some mechanism in place to ensure that everyone has an identical copy of all previous transactions. It’s also important that all updates are fair, always abide by pre-agreed rules, and are made in an organised way. This mechanism is known as a consensus algorithm.
Consensus algorithms allow network users who don’t know or trust one another to cooperate when maintaining a blockchain. They bring order and predictability where otherwise there would be chaos. And they do so without relying on a trusted central authority.
General Features of Consensus Algorithms
Although there are many different consensus algorithms today, they all rely on those wishing to update the blockchain putting up some form of stake. Stakes can be financial; something intangible but expensive, like computational energy; reputational; or something else entirely. However, it’s important that there is something that participants stand to lose by acting dishonestly.
The second crucial element is a reward for honest participation. Not many people would choose to risk something valuable with absolutely nothing to gain. Different cryptocurrencies use different reward structures but there is always something to gain by supporting the network.
Finally, consensus algorithms need to ensure that the entire network can check for dishonest participants very quickly. The network must confirm that the data added to the blockchain is consistent with the network rules before including another block.
Proof of Work (PoW)
Proof of Work is the original consensus algorithm. Although the Bitcoin network made it famous, Proof of Work was not invented by the coin’s anonymous creator, Satoshi Nakamoto. It was originally created in the 1990s as a way to discourage denial-of-service attacks.
In a PoW system, network participants are known as miners. Miners compete with one another to solve a complex computational problem first. Essentially, they apply a cryptographic algorithm to a data set to produce a hash. A hash produced by a good algorithm is a long string of letters and numbers with a few crucial properties:
- It’s hard to guess what the hash of a specific data set will be without computing it directly.
- Every specific data set produces a unique hash.
- It is computationally infeasible to generate two different data sets with the same hash.
- It’s easy to check that a hash corresponds to a specific data set.
The data used to produce the hash comes from the transactions to be included in the next block plus a random data added by the miner. If the hash produced is the first to satisfy certain criteria, the miner gets to add their block to the blockchain. If the network is happy that the block satisfies its rules, the miner receives a reward. In the case of Bitcoin, this reward comprises freshly minted BTC and the transaction fees paid by users.
The stake in a Proof of Work system is the computational effort put into finding a valid hash. On average, it takes the entire network combined around 10 minutes of constant hashing to find a valid hash. Therefore, miners risk wasting 10 minutes of computational effort if their block is invalid and rejected by the network. It might not sound a lot but the sophistication and power demands of the computer units searching for hashes today makes running one for 10 minutes very expensive.
Proof of Work Advantages:
- The most tested consensus algorithm. No other system has proved itself capable of supporting a network worth hundreds of billions of dollars.
- Its incentive structures are so neatly aligned that the Bitcoin network’s security gets stronger as blockchain progresses
Proof of Work Disadvantages:
- Huge electricity demands, which have an impact on the environment.
- When a network gets very big, like Bitcoin, not many miners can afford the equipment needed to compete.
Proof of Work Cryptocurrencies:
- Bitcoin (BTC)
- Ethereum (ETH)
- Bitcoin Cash (BCH)
- Litecoin (LTC)
- Monero (XMR)
- Zcash (ZEC)
In fact, a huge majority of blockchain-based cryptocurrencies use Proof of Work to reach consensus.
Proof of Stake (PoS)
The most popular alternative to the Proof of Work algorithm is Proof of Stake, or PoS. Unlike PoW, it doesn’t rely on expensive, high-powered computer systems or huge amounts of electricity. Instead, the stake is the crypto holdings of those wanting to add blocks to the blockchain.
The idea behind PoS was to create a consensus algorithm that was not as environmentally destructive, like Proof of Work is. The concept was first discussed in 2011 on the BitcoinTalk forum and elaborated on by Sunny King and Scott Nadal in the PPCoin whitepaper in 2012.
Instead of miners, Proof of Stake systems rely on validators. Those wanting to add transactions to a PoS blockchain lock coins in a wallet. They then put together a block of transactions and the network chooses a proposed block.
There are different mechanisms used to select which block to add. They include: randomisation, favouring validators that have not been selected for a long time, and basing selection on the total stake.
To encourage honest participation, validators are rewarded with transaction fees included in their submitted block. To discourage dishonest participation, validators lose some or all of their stake for breaking the rules.
Proof of Stake Advantages:
- Energy efficient. Those validating transactions don’t need huge supercomputers.
- Currencies using it are often free from inflation. Rewards come from transaction fees alone, therefore, PoS systems often have a static coin supply.
- Theoretically secure. To subvert the network rules (spend coins twice, etc.) users must hold more than 51% of all the cryptocurrency in existence. Acquiring that would drive the price up and, following an attack, the value of the coins would plummet.
Proof of Stake Disadvantages:
- Not tested at scale. PoS has not been deployed on a multi-billion-dollar network. That’s set to change with the launch of Ethereum 2.0.
- Issues with block validator selection. It’s important that the richest validators do not always win and, thus, continually increase their chance of being selected again.
- In the event of a fork, validators risk nothing by attempting to add blocks to both chains.
Proof of Stake Cryptocurrencies:
- Ethereum 2.0
- Cardano (ADA)
- Tezos (XTZ)
Delegated Proof of Stake (DPoS)
Delegated Proof of Stake was created by Dan Larimer in 2014. Larimer wanted to build a consensus algorithm that could process more transactions per second than either PoW or PoS systems.
The DPoS algorithm relies on a system of delegates to validate blocks with stakeholders voting for them by staking their own cryptocurrency. It’s the delegates themselves that add blocks to the blockchain but the rewards are shared proportionately between both delegates and those voting for them. If the elected delegate does not follow network rules, coin holders can remove them.
DPoS systems, like Steemit (STEEM) and EOS, are generally much faster and can process many more transactions per second than either PoS or PoW systems. This is because fewer numbers of participants need to reach consensus.
However, critics say that DPoS creates centralization because of the lower number of transaction validators. It’s also possible for wealthy participants to vote for themselves as validators.
Other Consensus Algorithms
Smaller cryptocurrencies have experimented with alternate methods to arrive at consensus. While a full explanation is outside the scope of this introduction to consensus algorithms, we have given a brief description of some implementations below:
- Proof of Burn. Validators send cryptocurrencies to an address that cannot be spent from. When they add valid blocks, they receive rewards in excess of the value burned. Counterparty (XCP) uses such a system.
- Proof of Authority. Approved accounts validate transactions. Since their identity must be validated and recorded on the blockchain, their reputation is at stake. VeChain (VET) uses such a system.
- Proof of Capacity. Validators allocate an amount of disk space to solve a memory-intensive problem. It’s similar to Proof of Work but demands less power. Examples of projects using it are Storj (STORJ) and Burstcoin (BURST).