May 15, 2022

Blockchain Technology: What Are Consensus Algorithms?

Blockchain Technology: What Are Consensus Algorithms?

The decentralized nature of blockchain technology is the core reason behind the development of the first cryptocurrency, Bitcoin and, subsequently the others. How can distributed systems such as blockchains forgo the authority of third parties and synchronise transactions seamlessly through the network? The answer to this is cryptography and consensus algorithms (consensus mechanisms or consensus protocols) that help sustain blockchain development in such a trustless infrastructure. By using consensus, thousands of nodes scattered around the world can agree on the creation of blocks mathematically.

Consensus algorithms are mechanisms that determine agreement on a single data value across distributed systems. In this article, we learn about consensus protocols, understand why blockchains need them, and scrutinise them from an environmental angle.

Why do blockchains need consensus algorithms?

In blockchain technology, it is important for all the parties of the blockchain network to come to a consensus and be able to trust unknown nodes in a distributed setting. Consensus algorithms control how such a system behaves and how efficiently it performs. Here are some reasons why consensus algorithms matter for blockchain:

Shift of trust

Blockchain brought about a paradigm shift in trust without the presence of a central authority. The peer-to-peer nature of blockchain databases, along with distributed time-stamping servers, makes it possible to exchange information autonomously between parties. As opposed to one person or entity as the record keeper, blockchains use advanced cryptography and consensus mechanisms to achieve the same results- they withstand outages, manipulation, and unnecessary complexity, resulting in fairly secure, transparent, and immutable records.

No single point of failure

A single point of failure (SPOF) refers to a risk that results from a flaw in the design, configuration, or implementation of a system. SPOF can stop the operation of the entire system because of a single fault or malfunction. The performance of a blockchain depends on the consensus mechanism and so are the level of speed of transactions, scalability, and security. Consensus protocols are designed to be fault-tolerant, so the network can reach a consensus even if some members misbehave.

Collaboration

Consensus mechanisms ensure that participants in the system work in unison to reach a result that serves the interest of the group. Across various protocols, there are several self-enforcing rules to incentivize honest nodes that cooperate.

Cryptocurrencies and Consensus Algorithms

A cryptocurrency network must ensure that every node maintains an identical copy in the blockchain and to follow the legitimacy of transactions and avoids issues such as double-spending.

Proof-of-Work (PoW) and Proof-of-Stake (PoS) are the two most popular consensus protocols. In a technical sense, PoW and PoS are Sybil resistance mechanisms that prevent Sybil attacks, where selfish nodes can create multiple fraudulent identities.

Proof-of-Work consensus blockchains (e.g., Bitcoin and the current implementation of Ethereum) require participating nodes or miners to compete, where the first to generate a valid cryptographic hash is selected to propose their block to the ledger. Increasing hashing power is the only way to increase a PoW miner's chances of being a block author, so gaining more network hashing power incurs a proportional financial cost. Miners must work for a predetermined amount of crypto as an incentive. While PoW offers a high degree of decentralisation, machine trust and high security, it comes with a long confirmation time of blocks and is also energy-intensive, resulting in wastage of hardware and resources.

Like PoW systems, Proof-of-Stake consensus blockchains such as Ethereum (post-merge), involve network participants who gain access to the blockchain, based on their stake of crypto in exchange for incentives. PoS network participants or validators are therefore required to invest financial resources to increase their chances of being selected as block authors. A stake is often slashed (i.e., confiscated) if a validator breaks certain protocol rules like containing invalid transactions in a block.  

How feasible are consensus protocols?

Consensus protocols are now key components of blockchain technology, playing a critical role in the longevity of various networks. But how feasible are they? According to the Cambridge Bitcoin Consumption Electricity Index, Bitcoin network’s annualized power demand is 150.28 TWh (at the time of writing), whereas Ethereum consumes 105.77 TWh electrical energy (at the time of writing), equivalent to the power consumption of Kazakhstan. However, Ethereum’s energy expenditure per second post-merge will be around 0.667 kWh, which is a reduction by nearly a factor of 225, as compared to the current PoW network.

Conclusion

It is important to understand blockchain in the context of consensus algorithms since distributed ledger technologies and their underlying protocols are the backbones behind different use cases getting mapped out. With time, we can certainly expect better transaction validation and non-functional requirements, such as the capacity and performance to improve. Meanwhile, there are obvious signs of the potential of blockchains extending beyond the financial sector and into a wider economy, being oriented by consensus protocols.