August 25, 2023

The Secret Ingredient of Blockchain: What Is Consensus Algorithm and How Does It Work

The world of technology and innovation never stands still. One of the most significant achievements in recent years has been the blockchain technology. But have you ever wondered how this mechanism ensures reliability and agreement in a decentralized environment? Meet consensus algorithms — the secret ingredients that enable true decentralization.

This article is for those who want to understand the essence without getting lost in technical details. Using examples, we will explore the most popular consensus algorithms and their role in technology development.

What Are Consensus Algorithms?

Imagine that you and your friends are writing a story in a virtual book. But how do you ensure that each of you follows the same plot despite having different ideas? Consensus algorithms are like the glue that holds your world together, preventing dragons from existing in a realistic novel — a bit like rules of the game for everyone. Thus, several independent participants agree on a version of the "truth."

In a world where participants can be anonymous and trust is rare, consensus algorithms become the foundation for decentralized systems. They not only provide agreement but also enable the creation of applications that are impossible in centralized environments. For example, smart contracts that automate transactions without intermediaries have become a reality thanks to these algorithms.

Types of Consensus Algorithms

There are numerous consensus algorithms, each designed to address unique problems and fit specific contexts.

Proof of Work (PoW)

Proof of Work is known thanks to Bitcoin, where participants (miners) solve complex mathematical problems to add new blocks to the chain and earn newly minted coins.

Proof of Work is a puzzle that becomes more difficult as more people simultaneously solve it. The one who solves it first takes the entire reward.

Despite the antiquity of this consensus algorithm, it is considered one of the most reliable. It's used by hundreds of blockchains, including Dogecoin, Monero, Ethereum Classic.

Proof of Stake (PoS)

They say size doesn't matter, but not in this case. If computational power played the decisive role in the previous algorithm, here it's the size of ownership that matters.
Imagine you're a shareholder in a company. You participate in the company's life by voting at meetings (with each transaction on the blockchain) and receive dividends based on the size of your stake. Unlike PoW, where the reward goes to the one who solves the task the fastest, in PoS, the reward is distributed randomly.

This algorithm is used in Polygon, ToN, Mina.

Delegated Proof-of-Stake (DPoS)

This is a variation of the previous algorithm. Here, blockchain users select representatives by voting for them with their crypto. These delegates will decide which transactions to confirm. Similar to PoS, they receive rewards for securing the network, which they share among their delegates. Not forgetting to take their commission.

This type of consensus is designed to mitigate the main drawback of PoS — the risk of centralization. When a few wealthy individuals buy enough stake to control the blockchain.

However, DPoS is in its infancy and is not yet considered secure enough to become the foundation of blockchains for financial operations.

Used in EOS, BitShares, Tezos concurrently with PoS.

Leased Proof-of-Stake (LPoS)

Another offshoot of PoS. With LPoS, you can lease your coins to other participants so that they can work with the blockchain. This significantly reduces the entry barrier for becoming a network validator (those who confirm transactions). By the way, to become a validator in the Ethereum network, you need to stake over 32 $ETH.

Importantly, the leased coins are not transferred to the tenant's wallet; they are only frozen with the lessor for a specific period.

LPoS is used in Waves.

Proof-of-Burn (PoB)

Sending coins to nowhere, meaning to a wallet that no one has access to, is called burning. Hence the name "proof of burn" for the algorithm.

Burning is a demonstration of commitment to the technology and serious intent.

A transaction of burned coins serves as a signature on your contract with the blockchain. The blockchain recognizes this bold move and allows you to become a validator in an algorithm that doesn't require significant computational power.

As a consensus mechanism, this approach is very rarely used, for instance, in the XCP blockchain. But the burning technology itself, as a deflationary mechanism, is used in popular blockchains. For instance, Ethereum и BNB Chain.

Proof-of-Authority and Proof-of-Importance

While traditional PoS consensus mechanisms rely solely on capital size, PoA and PoI consensuses take into account additional factors: authority and importance, respectively.

Importance is assessed by several criteria: the number of transactions, interactions with other blockchain participants, and so on. By the way, this evaluation is dynamic, which incentivizes validators to work more efficiently. Proof of Importance was first introduced by the NEM project.

Authority is determined through voting. The main difference from PoS and DPoS, where participants also "vote" with their coins, is that validators here do not receive rewards. Naturally, this is economically disadvantageous, so blockchains with the PoA mechanism are used in private blockchains.

If you don't know what a private blockchain is, I recommend reading an article about blockchain types and levels.

Proof-of-Space (PoSpace)

Imagine participating in a lottery, but instead of tickets, you have free space on your computer. That's how the Proof of Space consensus algorithm works.

You must prove that you have sufficient free space to download specific parts of the blockchain to become a validator.

Let's say a new transaction wants to enter the blockchain. In this example, it's like a prize in a lottery, and the winner stores it on their computer.

This algorithm has two significant drawbacks:

  • low internet bandwidth in many countries. Fast transmission of large amounts of data is possible in, say, Japan, but residents of Nigeria might lack the capability to become validators.
  • relatively low cost of computer disk space. Acquiring enough terabytes of memory and taking control of the blockchain wouldn't be too expensive.

Considering these drawbacks, the PoSpace algorithm isn't widely used.

Consensus algorithms are the cornerstones of the future blockchain. They democratize processes, improve transparency, and enable new ideas to thrive.

The next time you send a transaction on the blockchain, think about the mechanisms it's using.