Consensus: Or The Types Of Consensus You Should Know About

When the term “blockchain” is mentioned in some context, it usually comes hand in hand with the complex term “consensus algorithm”. Most readers do not even think to bother researching what a consensus algorithm is. In fact, most do not even know what an algorithm is used for in the blockchain context. Still, there are dozens of kinds of algorithms and most of them are used in the blockchain world.

The idea of a consensus is coming to a unified position on a problem. In computer science, a consensus is related to a consensus problem. The fundamental problem in distributed computing and multi-agent systems is to achieve overall system reliability in the presence of a number of faulty processes. This often requires processes to agree on some data that is needed during computation. The blockchain is marred by the same problem and scientists and programmers have been coming up with ways of solving it.

In essence, an algorithm is a series of analyzed, programmed and necessary steps needed to achieve a certain result. The consensus algorithm, ergo, means taking the necessary actions to achieve agreement on a single issue. In the blockchain world, that single issue means coming to an agreement on the calculation of a block by all network participants so it may be hashed.

In The Blockchain World

When it comes to blockchain, the consensus algorithm can have several results as the main aim of all network participants. The most common purposes of the algorithm are the following:

  • Agreement: The consensus mechanism gathers all the agreements from the network participants’ group.
  • Collaboration: Every member of the group aims to reach a better agreement that corresponds to the group’s interest as a whole.
  • Cooperation: Every individual works as part of a team and puts their own interests aside for the greater good.
  • Equal Rights: Every participant has the same value in the process of voting. Under such an approach, every vote counts, as without even a single vote, the consensus will not pass.
  • Participation: Everyone inside the network needs to participate in the voting process. No one will be left out or can stay out of the vote, as that will halt the algorithm’s functioning.
  • Activity: every member of the group is equally active. Responsibility in the group is shared equally among all participants.

Types

As a matter of fact, there are over 30 types of consensus algorithms currently available. The most common ones are the following:

  • Proof-of-work
  • Proof-of-Stake
  • Delegated Proof-of-Stake
  • Proof-of-Authority
  • Byzantine Fault Tolerance
  • Delegated Byzantine Fault Tolerance (dBFT)

And so on and so forth. The list can be continued ad Infinitum, but the fact remains that all of the algorithms mentioned here and all the others that will not fit in the given material serve equally important purposes, which revolve around reaching consensus. The only thing that changes is the method they use for achieving it.

The Hall of Fame

Naturally, the most popular types of consensus algorithms are Proof-of-Work and Proof-of-Stake, which have emerged together with the blockchain as the firstborn.

Proof-of-work is the oldest type of consensus on the blockchain and has been around since early 2003 with the birth of Bitcoin and has been in the testing phase since 2009. Though not new, the algorithm received new life with Satoshi Nakamoto. Under his proposed method, the participants of the blockchain (the miners) have to solve a complex and utterly useless computational problem so a block of transactions can be added to the blockchain. The problems with this approach are numerous. It is slow, power-intensive and environmentally unfriendly, and it is susceptible to economies of scale.

Next up is the Proof-of-Stake concept. This approach emerged as an alternative to the latter one and proposed that instead of using mining to extract blocks, the participants of the network need to have some stakes in the form of coins in the system to be able to participate in the process. Owning a 10% stake grants the probability of mining the next block at 10%. The more coins the stake owner holds, the higher the chance that they will extract the block. The approach is flawed too, since it is prone to the nothing-at-stake problem. Yet, it is less power-intensive, not susceptible to economies of scale and better protected against attacks.

No matter the approach used for reaching consensus, the problems are still largely the same and echo from one to the other. The biggest problems facing all consensus models are the following:

Power consumption is by far the biggest problem of blockchain operation. For instance, Bitcoin has 20 billion hashes per second. That requires immense amounts of power and there are no cheap energy alternatives at the moment to satisfy the energy lust of modern blockchains.

The centralization of miners is PoW networks is another problem since large manufacturers can start requiring more power to operate and will try to bend the rules in the mining system or even issue new ones to satisfy their demands. The centralization within a decentralized network is the result. If centralization takes hold, then the system is no longer a blockchain and there is no sense in consensus.

Attacks on the network are still popular and the hackers are not going anywhere. A 51% attack is viable and there is no guarantee that it may not happen. If stakes are taken hold of by attackers, it is only a matter of time and computing power until they control over half of all nodes and turn the network into a money-maker for themselves.

In With The New

The problems of previous consensus algorithms have been thoroughly examined and researched to allow programmers to reach new models of consensus.

One of the newest and most promising models for blockchains is Proof-of-Agreement that is another consensus algorithm that has been employed by the Credits platform. It is a rather simple concept that seems complicated at first but is effective at reaching consensus. The entire procedure for consensus consists of the formation of the transactions and their distribution between network nodes and cyclical rounds execution where Trusted Nodes (TN) are granted authority to conduct consensus, which results in a common resolution including transactions in a block and its generation. Transaction packages include an ordered number of transactions (up to 500) and are given a header that contains a hash calculated with the Blake2s algorithm. Once the nodes receive the list of transaction packages contained in the round table, they begin to check the availability of these packages in the local buffer. If some packages are missing, the synchronization process is initiated. A node requests the missing packages from its neighbour nodes and if the packages are missing on those nodes as well, those neighbours request the packages from their neighbours and the process is repeated until the missing packages are found. The availability of all transaction packages contained in the roundtable on all Trusted Nodes is the condition for a round to begin. After all network nodes have released the transactions packages and exchanged them with each other, the nodes responsible for consensus execution need to be selected and those nodes will have to validate the transactions and generate a block. Simple and effective block formation with full involvement of all nodes with the possibility of implementation in public networks is what such a consensus algorithm is all about.

The next promising algorithm is Facebook’s LibraBFT Consensus algorithm. LibraBFT improves on HotStuff and adapts it for broader use. Libra is a Byzantine Fault Tolerance type consensus algorithm, which is based on HotStuff and is a robust and efficient state machine replication system designed for the Libra Blockchain. LibraBFT is an enhancement of HotStuff with the implementation of the Pacemaker mechanism. It includes liveness analysis that consists of concrete bounds to transaction commitment. In LibraBFT, the processes are called Validators. Each of the latter works in rounds, with each having a designated validator called a leader. The leaders propose new blocks and receive signed votes from the validators concerning the proposals for block generation. A round is just a communication phase with a single designated leader, and the proposals of the leaders are organized into a chain using cryptographic hashes. When a round is launched, the leader proposes a block that extends the longest chain it has at its disposal. If the proposal is valid and timely, each honest node will sign it and send a vote to the leader. Once there are enough votes to reach a quorum, the leader aggregates the votes into a Quorum Certificate (QC) that extends the same chain again and the QC is broadcast to every node. If the leader fails to assemble a QC, then participants will move to the next round.

By now, the Libra Blockchain has been launched as a permissioned network. The founding Validators include such firms as Uber, Visa, MasterCard, PayPal, etc. All the founders adhere to strict guidelines to be early Validators. For example, crypto hedge funds were required to have an AUM above $1 billion while digital asset-focused custodians had to store at least $100 million. Non-crypto firms needed to have a market cap of more than $1 billion or customer balances of more than $500 million.

Another consensus algorithm is Proof of Elapsed Time, which was invented during early 2016 by Intel and successfully tested by Hyperledger Sawtooth 1.1. The principle of operation is rather simple as each node in the network waits for a randomly chosen period of time. The first node to elapse the waiting time wins the right to issue the next block. Each node in the network generates random waiting time intervals and is deactivated in a sleeping manner for a specified time. The node that wakes up, and the one with the shortest waiting time, add a new block to the blockchain and transmits the data throughout the entire network. The process is repeated until the next block is found. The advantages of such an algorithm are low costs of participation, simple legitimacy verification, and low costs of controlling verification and election. There are cons too, such as the need for specialized hardware and the fact that it is useless for public networks.

All In All

The variety of consensus algorithms make blockchains versatile and adaptable to various applications and structures. Though vulnerable to attack, oftentimes cumbersome and highly energy-inefficient, the blockchains are still here to stay and it is only a matter of time until one or another algorithm beats the others in the race for efficiency. Perhaps, one of the algorithms in the long list of obscure and lesser-known ones will be the one to oust PoW and PoS in the near future.