What is a Blockchain Consensus Algorithm?

  • Home
  • What is a Blockchain Consensus Algorithm?
Shape Image One
What is a Blockchain Consensus Algorithm?

Table of Contents

 Introduction

Blockchain technology has been around longer than cryptocurrencies like Bitcoin, however, the concept gained much more attraction after Bitcoin leveraged the technology as its foundation.

Notably, at the heart of blockchain technology lies the concept of consensus algorithms.

Blockchain works in a distributed manner and doesn’t rely on a centralized authority to run and maintain everything. As a result, the system needs a mechanism to ensure that all the members are in sync with each other which is known as a consensus algorithm.

Bitcoin was created on the Proof of Work (PoW) consensus algorithm which was then used by many other blockchains. The limitations of PoW convinced the industry to look for alternatives. Different projects started introducing different mechanisms, most of which are built on an existing concept.

Stick around to discover more if you are just hearing blockchain consensus algorithms for the first time or you never understood what they represent.

What is a blockchain consensus algorithm?

Distributed systems bring multiple benefits to the table but have their own limitations as well. Unlike centralized networks, we don’t have a top entity to check and dictate everything.

Therefore, the members of a decentralized and distributed system should find a way to make sure that everyone is on the same page. In other words, every member has the same set of data and information and the consistency and integrity of the system are intact.

Blockchain systems are distributed databases that record and maintain data with the help of hundreds or even millions of individual systems. And there’s nothing more important than the consistency of data when we talk about a database system. A consensus algorithm helps a blockchain with this.

Every member of a blockchain network holds a copy of the database. We call each member a blockchain node and the copy of data is usually called the blockchain ledger. The main challenge here is then to make sure that every member or at least the majority of the network is holding the same copy and that there is no inconsistency in the system.

And they achieve this through a consensus algorithm.
A consensus algorithm simply refers to the mechanisms by which all blockchain nodes agree on a single version of the blockchain ledger without the need for a central authority. They are employed to ensure that all nodes in a blockchain network agree on the current state of the ledger.

When it comes to cryptocurrencies, a blockchain ledger consists of all the transactions that happened between members. Nodes use this information to verify new transactions and ensure that the true owner is spending their own tokens.

The consistency of this ledger is then quite important as it prevents one of the biggest issues of digital currencies: double-spending. Double spending happens when a user can respend an already-spent coin by altering the records of the previous transaction.

A strong consensus algorithm will make such dishonest behavior, i.e. altering the records of previous transactions, quite expensive and almost impossible.

History of consensus algorithms

Paxos can be considered one of the first algorithms which aimed to address the consensus issue within a distributed setup.

Leslie Lamport introduced the Paxos group of protocols in an article that was published in 1988. The Island of Paxos and the way its part-time parliament was managed inspired Lamport to use the idea in a distributed system.
The Parliament consisted of part-time legislators as they had their own businesses and were not willing to dedicate their whole time to setting up the rules of the land. There was no secretary, therefore, the legislators came up with a way to keep the system running.

Each legislator would hold a copy of the ledger which had a sequence of the laws that were passed. As a new decree was in place, legislators would add it to the ledger in that specific order.

The ink used for writing these ledgers was not erasable, making them secure against tampering.

“Consistency of Ledgers” was a requirement in the parliament that ensured that no two ledgers consisted of contradictory rules. However, this requirement didn’t guarantee that a passed decree was included in all ledgers or the majority of them.

Another requirement then was added to the parliament rules. The majority of legislators had to be present at the time a decree was proposed and passed to ensure that it will be recorded sufficiently.

In 1993, the idea of Proof of Work (PoW) was laid down by Cynthia Dwork and Moni Naor. The proposed mechanism aimed to prevent spam emails by asking the sender to put some skin in the game.

In 1997, Adam Back announced Hashcash, a quite similar system to the one proposed by Dwork and Naor for preventing spam emails. In 2002, Back published its “Hashcash – A Denial of Service Counter-Measure” article.

However, it was in 1999 that Markus Jakobsson and Ari Juels formalized Proof of Work (PoW) by publishing their “Proofs of Work and Bread Pudding Protocols” article.

In 2004 and 4 years before the creation of Bitcoin, Hal Finney introduced the “Reusable Proofs of Work” which was based on the Back’s Hashcash. The RPOW was probably the first time that PoW was used in a digital currency.

Eventually, in 2008, the current Proof of Work consensus mechanism was introduced in the Bitcoin whitepaper by Satoshi Nakamoto, the anonymous creator(s) of Bitcoin.

It’s worth mentioning that Finney was the receiver of the first Bitcoin transaction. On January 12th, 2009, Satoshi sent 10 bitcoins to Finney.

Types of blockchain consensus algorithms

We can confidently say that it was Bitcoin that popularized Proof of Work and made it one of the most common consensus algorithms used in various blockchain systems.

However, the high energy consumption of this mechanism along with the scalability issues convinced the industry members to look for an alternative that would provide the same level of security with less energy.
But how does Proof-of-Work really work? Let’s find out!

Proof-of-Work (PoW)

Some skin in the game is required by all consensus algorithms to ensure that all members will stay honest and prevent them from misbehaving.

In a Proof of Work network, like Bitcoin, this is ensured by expensive computing systems.

Members have to invest in specialized hardware to be able to join the system. If they act by the rules, they will be eligible for rewards, and if they behave dishonestly, they will be kicked out of the system, making all their investment and efforts in vain.

By becoming a mining node, members will be able to assist in adding new transactions to the ledger and keeping the system secure. Mining nodes are essentially responsible for gathering verified transactions and hashing them into a block.

The process of hashing can be quite complex and requires excessive computational power and electricity. It comes with its own rewards as well. Successful nodes will be awarded new coins.

On the Bitcoin blockchain, the complexity of the hashing process is dependent on the number of active nodes and will be tweaked by the algorithm to ensure the security of the system will stay high and the production rate of the crypto asset will remain unchanged.

If the number of miners decreases, the complexity will decrease as well to ensure that miners are able to add new blocks in the period of 10 minutes set by the protocol. If the number of miners increases, the complexity will increase as well to prevent the creation of extra bitcoins in the given time.

The high energy consumption and scalability limitation are some of the main drawbacks of PoW.

Proof-of-Stake (PoS)

Proof-of-Stake (PoS) is an alternative consensus algorithm that addresses some of the issues of proof-of-work.

Instead of expensive hardware, Proof of Stake (PoS) asks its members to directly put some stake in the system to guarantee their honest behavior. This stake is usually in the form of the native cryptocurrency of the PoS system.

By staking the required tokens in the system, users will be eligible to participate in the validation of transactions on a blockchain network. This process is simple and does not require complex and exclusive hardware.

Miners are replaced by validators who are responsible for proposing the next block to be added to the chain. The picked validator will then be rewarded. The process of selecting a validator depends on different factors such as the number of tokens a validator was willing to invest.

The PoS algorithm is a more energy-efficient blockchain consensus algorithm than PoW. Additionally, PoS-based networks are way more scalable than PoW-based platforms. This is the main reason the Ethereum blockchain upgraded its network and became a PoS system.

However, there are some potential drawbacks to the proof-of-stake consensus algorithm. One criticism is that PoS can lead to centralization, as nodes with larger stakes in some of the networks may have greater influence in the decision-making process. This can lead to a small group of nodes having significant control over the network.

This issue is usually addressed by basing the validator selection process on other factors as well.