Blockchain Consensus Algorithms

Proof Of Work (POW)
Proof Of Stake (POS)
Delegated Proof of Stake(DPOS)
Longest Chain Rule
Byzantine Fault Tolerance (BFT)
POW Attacks
Proof Of Importance (POI)
Proof Of Burn (POB)

Mat David
Coinmonks
Published in
9 min readOct 11, 2021

--

Proof Of Work, Proof Of Stake and Delegated proof of work are the ones used primarily in the Blockchain, besides a few others. A consensus algorithm is a protocol upon which the miners in the Blockchain agree before submitting the verified blocks to the Blockchain. In a decentralized setup like Blockchain, the consensus algorithm allows all the parties in the network to agree upon a specific block before submitting the valid block to the Blockchain. This article will explore the different consensus algorithm.

The consensus algorithm provides the standards for the nodes in the network to join the Blockchain in a trustless manner. Trustless means a node doesn’t have to validate its identity before joining a public blockchain.

Consensus algorithms check the integrity of new blocks and past blocks.

It is a set of rules written using computer code and follows specific governance standards. Let’s proceed to understand a few consensus algorithms.

Subscribe to Coinmonks Youtube Channel to get daily crypto news.

Proof of Work (POW)

Proof of work is the consensus algorithm used in major blockchains. Bitcoin blockchain uses the POW algorithm. In POW, the miners calculate a complex mathematical puzzle, called the NONCE. The calculated nonce should be less than the previous nonce value present in the blockchain. POW requires significant computational resources. The computational resource for POW in the Bitcoin blockchain network is equivalent to the power requirement by Switzerland.

When calculating the successful block, the miners agree on the longest chain rule. Any entity holding 51 % of hashing power in the POW consensus can maintain the longest chain and control or undermine the blockchain. They can introduce false transactions, eliminate or exploit the blockchain by double-spending and steal assets of other miners. GHash.io owned 54% of the BTC blockchain at one point.

The Longest Chain rule

“ The majority decision is represented by the longest chain, which has the greatest proof-of-work effort invested in it. — Satoshi Nakamoto

  • All the nodes trust the longest chain in a blockchain without trusting each other directly.
  • Building any block requires energy. The miners work on blocks that form the longest chain and have the most effort. The chain with the longest block needs the most power to create. The algorithm discards the shorter chains, and the longest chain is adopted.
  • Based on the difficulty, blocks will take more effort to reach the nonce value which is smaller than the target. Because difficulty changes, the greater the difficulty the more the effort/resources.
  • Chainwork is the metric to calculate the longest chain. It is the total number of hashes that are required to produce the current chain. To get the complete hash, you need to sum the hashes needed for each block.
  • When there are the same blocks, the nodes disagree on which nodes to reach a consensus. The nodes pick the newer block built on top of the last block, forming the longest chain.
  • It is difficult for a single miner to replace the chain with the longest chain principle because the resource required is way too high to replace. This rule protects the blocks already mined. It is a cooperative effort to mine a block.
  • The rewards motivate the miners to calculate and mine the longest block. The longest chain that is 100 blocks deep gets awarded in the Bitcoin blockchain.
  • Bitcoin and Ethereum are the different blockchains using the POW consensus algorithms.

Various POW attack

Double spending

In double-spending, a miner can use the same coins to make multiple transactions. Double spending leads to spending more than expected. It is vital to approve all the transactions in blockchain that could potentially stop such double-spending attacks.

Selfish mining

In selfish mining, the miner withholds mined blocks and selectively releases them into the blockchain. A miner with a 33 percent stake can earn 50 percent of mining power by progressively submitting the blocks.

Proof Of Stake (POS)

POS uses a different approach compared to POW. The miner commits the currency ( stake) he has to the blockchain network to get an opportunity to mine. A chosen random miner with a stake validates the block transaction. If a miner cannot commit to the stake, the miner can join a stake pool to participate in the mining. In POS, the miners are also called forgers. A Miner gets paid a transaction fee for successfully validating a block in the POS system.

POS system introduced the Ethereum 2.0 standards-based POS algorithm (Casper ) to solve the Byzantine General problem(BGP). In this, a two-thirds majority is required among the nodes to reach a consensus.

In POS, security is easier to achieve because a 51% stake is a vast amount for a single entity to lose if the malicious activity miner is caught in the blockchain. Double spending is still possible where one who has 51% of the stake can do malicious spending. The same technique of approving and validating transactions before committing to the blockchain will help mitigate this attack.

ADA/ Cardano currently uses Proof of Stake (POS). Ethereum plans to move to POS soon.

Delegated Proof of Stake (DPOS)

In the delegated DPOS, a witness is chosen to secure the network. The voters are people who hold tokens and the voters who hold the most tokens, decide the actor who can secure the network or mine a block.

The chosen person/witness miner should do a quality job and should not do any malicious activity. The voters have the right to withdraw the vote if the actor’s performance is not on par, or he is identified as a bad actor. The delegated proof of stake approach saves a lot of computational power and reaches a consensus in a democratic way.

Proof of Authority (POA)

POA is used in Ripple and Hyperledger blockchains. POA is based on a consensus algorithm that offers high tolerance for faults and performance. The node has to pass the authentication to prove itself worthy or has the authority to create a block.

It does not require high power computational hardware, it has predictable block time, paid high transaction fees, and has tolerance to malicious nodes.

POA verifies the identity of the node before accepting it. This consensus algorithm is used in the private blockchain setup. Since the identity of the block is verified, the nodes are allowed to submit a block and it is considered valid. In the POA consensus algorithm, the block creation is dynamic and the verification time is faster.

Byzantine Fault Tolerance (BFT)

In a situation where certain nodes fail to respond due to a technical or hardware failure or respond with a malformed message, BFT can be used to mitigate such situations. Using BFT, the healthy nodes or the nodes which provide the correct response can reach a consensus to overcome such node failures and make a decision to proceed or stop the node.

The parallel to the Byzantine General problem (BGP) is seen when the Generals separated by distance have to decide to either proceed to attack or retreat from an attack. In this situation, the generals have to agree on a majority. If one of the generals plays the double role of voting to attack and also voting to retreat and does not join the team of attacking generals, then the result could be catastrophic. The BGP also gets aggravated by the chances of the message getting lost by the messengers who have to travel distant places to deliver. The BFT consensus algorithm is designed to address BGP scenarios of the crypto currencies world.

Proof of Importance (POI)

The POI consensus similar to POS uses certain criteria to evaluate the validity of a node. In this case, the other metrics used to evaluate the nodes are the number of vested currencies, net transfers and activity of the cluster. Although it is similar to POS, the metrics used other than the amt of stake to validate a node help overcome the loophole in the POS consensus algorithm.

Proof Of Burn (POB)

In the proof of burn consensus, the tokens are sent to a non-usable address. This is the address that does not have a private key to decrypt and use the tokens. The miner can virtually mine equivalent to the burned coins. The goal is to reduce the circulation of currencies and sometimes to produce a counter-native currency like the XCP. Using POB, you can send transactions that will burn your own coins.

Periodic burning of the coins disallows the unfair advantage of over-investing initially, rather that promotes periodic burning of coins and keeps the system active. For instance, Slimcoin, a virtual currency network that uses POB, allows a miner to burn coins that gives them the right to compete for the next block and also gives them the chance to receive blocks during a longer one year time period.

Proof of Elapsed time (POET)

POET is an enhancement on POW, where it uses a randomized timer system for the network participants. With POET, they are broken into two phases, one is a verification and joining the network and the other is a randomized selection process, based on elapsed time.

POET was developed by Intel Corporation. This algorithm uses a lottery system where the miners are selected in a timed manner and all the miners get equal chances to mine. Each participating node of the POET system goes to a passive mode for an allocated random wait time.

The miner’s node with the shortest wait time awakes and starts the mining. This is similar to POW but not all nodes are the time competing to provide the proof of validity for a block. The nodes that are dormant because of their downtime can save resources and execute some other non-primary tasks.

This article covered a few predominantly used consensus algorithms in the Blockchain technology. Read more articles on IAM & Security @https://iamblockc.medium.com/

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also, Read

--

--

Mat David
Coinmonks

I am an Identity & Access Management Consultant. My tech. writing interests are IAM (Forgerock, Oracle,Auth0,OKTA ). https://iamsolution.ca; info@iamsolution.ca