Academy Author ◦ 12 Dec 2023 ◦ 9 min read

Consensus Algorithms in the Blockchain

Consensus Algorithms in the Blockchain

Cryptocurrency networks differ from each other in the organization of work. Since there is decentralization, it is necessary to implement a distributed registry. This is necessary to reconcile transactions while avoiding additional costs.

In this article, we will focus on popular blockchain algorithms to find out their functions and factors affecting performance and security.

What Is a Blockchain Consensus Algorithm?

A consensus mechanism is a procedure by which all peers of a network reach a general agreement on the current state of the distributed registry. Thus, consensus algorithms ensure reliability in the blockchain network and establish trustworthy relationships between unknown partners in a distributed computing environment. A negotiated protocol ensures that each new block that is added to a chain of blocks is the only version of the truth agreed upon by all nodes in that chain. Consensus models of blockchain consist of some specific goals, such as reaching an agreement, cooperation, node equality, and the mandatory participation of each node in the negotiation process. Thus, the consensus algorithm aims to find a common agreement that is a gain for the entire network. Moreover, this algorithm implements:

  • frequency of generation of blocks;
  • avoiding the risk of additional funds being written off;
  • checking the data in the block.

Simply put, the consensus algorithm avoids errors in decentralized networks. Moreover, the task of the mechanism is to implement mutually beneficial conditions for all participants.

Consensus Algorithms: Views

Digital coins are developed on various blockchains. Consensus algorithms also vary on those blockchains.

More than 90% of the cryptocurrency market is based on three main harmonized algorithms:

Proof of Work (PoW)

Proof of Stake (PoS)

Delegated Proof of Stake (DPoS)

However, we will consider not only the underlying mechanisms but also some others that, although not adopted by many projects, are very interesting to explore and may play a major role in our future.

1. Proof of Work (PoW)

This consensus algorithm is used to select the miner that will generate the next block in the chain. Bitcoin, Litecoin, and many other mastodons of the blockchain industry use PoW in their work. The main idea of ​ this algorithm is to solve a complex random mathematical problem generated by a blockchain and broadcast a solution. A feature of this algorithm is the complexity of solving the problem, but it can be easily rechecked. This mathematical puzzle requires a lot of computational power and thus the node that solves the puzzle before the rest gets to produce the next block. PoW strives to ensure that an attack on the network is excessively expensive and requires high energy costs, as miners consume energy to provide metering and network security services. The disadvantages of this mechanism are considered to be limited scalability and low throughput.

2. Proof of Stake (PoS)

Perhaps this is the most common alternative to PoW: even Ethereum had recently moved from PoW to PoS consensus. In this type of consensus algorithm, instead of investing in expensive equipment to solve a complex puzzle, so-called validators invest in network coins, blocking part of their coins as a bet (staking). After that, all validators begin to check the blocks, betting on the block that they believe can be added to the chain. Based on the actual blocks added to the blockchain, all validators receive a reward proportional to their rates, and their rate is increased accordingly. In the end, to generate a new block, the validator is selected based on its economic share in the network. Thus, the algorithm PoS encourages validators through an incentive mechanism to reach a consensus. The advantages of this mechanism are considered to be increased scalability at the base level and potential energy savings compared to PoW. The disadvantages include the risk of centralization, which in turn leads to a decrease in security. Ethereum, Peercoin, Lisk, PIVX, and other blockchains operate on the PoS.

3. Delegated Proof Of Stake (DPoS)

The mechanism DPoS is a development of PoS, but it is a different type of consensus algorithm that is based on voting systems. Instead of selecting individual nodes randomly to perform a check, the token holder community uses its share (bet) to vote on the selected number of trusted nodes, often called delegates. They are responsible for checking transactions, and maintaining the network, and are rewarded in exchange with a share of transaction fees. DPoS can be compared to representative democracy - participants vote for a trusted representative to protect the network on their behalf. Voters may replace delegates if they act against the interests of the majority of interested parties. The DPoS algorithm was invented by Dan Larimer and is used in projects whose origins it stood, such as BitShares, Steem, and EOS, but is also in demand in other networks, such as Tezos, and Ark. The advantages of DPoS are high scalability and a wider spread of inflation (more even distribution of freshly printed tokens between validators), and the disadvantages are insufficient security and a steady trend of centralization in the network.

4. Proof of Elapsed Time (PoET)

PoET is one of the fairest consensus algorithms that select the next block using only honest means. It is widely used in many private and corporate blockchains, in particular Hyperledger. In this algorithm, each validator in the network gets a real chance to create its block. All nodes do this by waiting for a random amount of time and adding an acknowledgment of their wait into the block. The created blocks are transferred to the network for consideration by the rest of the participants. The winner is the validator that has the smallest timer value in the proof part. The winning validator node block is added to the blockchain. There are additional checks in the algorithm to prevent any particular node from always winning the election, generating the lowest timer value. Speaking about the pros: you can distinguish high efficiency and low resource capacity; the cons — a low level of security and dependence on a third party developing a set of instructions for the processor.

5. Proof of Authority (PoA)

PoA is a reputation-based consensus algorithm that uses the value of the identity and reputation of block validators. In March 2017, the Ethereum development team led by Gavin Wood proposed PoA as a solution for spam attacks on the Ropstein test network of Ethereum. PoA looks like PoS, except that validators instead of coins put their reputation. Trusted nodes/validators are chosen by network leaders, making PoA useful only for private blockchains. Used in the VeChain Thor, Microsoft Azure, and others. Pros: high transaction speed, scalability, and low cost of network maintenance. Disadvantages: a rejection of decentralization, and possible malicious behavior of network participants, which is almost impossible to prevent.

6. Proof of Capacity (PoC)

In the Proof of Capacity consensus, validators invest their hard disk space instead of investing in expensive equipment or burning coins. The more means of checking the space on the hard drive, the more chances they have of getting to the mining of the next block and receiving a reward for the block. Using storage instead of computing with ASICS, blockchains on PoC are much more energy efficient. The PoC has projects like Filecoin, Storj, and Burstcoin. The obvious advantage of this approach is in energy efficiency, the disadvantages lie in insufficient security due to exposure to attacks.

There are also other consensus algorithms, such as:

  • Proof of Activity;
  • Proof of Space and Time;
  • Proof of Weight;
  • Proof of Storage;
  • Proof of Importance;
  • Proof of Participation;
  • Proof of History;
  • Leased Proof of Stake;
  • Proof of Burn;
  • Practical Byzantine Fault Tolerance.

But their use at the moment can be attributed more to private cases and innovations, which can serve as a topic for a separate article.

Summary

Each of the presented algorithms has its strengths and weaknesses, as well as possible uses. When considered in this light, it is reasonable to assume that they do not compete with each other. It is important to choose one reasonably according to the business network requirement. 

The implementation of the PoW is safe and decentralized. PoW is an excellent consensus mechanism for cryptocurrencies. However, it is completely inappropriate for social networks and blockchain games. 

In the nascent blockchain industry, it is important to continue research to discover new blockchain architectures. New consensus mechanisms will open up new options for using blockchain and cryptocurrency technology in particular.