m Blockchain Consensus

Key Points


References

Reference_description_with_linked_URLs_______________________Notes______________________________________________________________
m blockchain types & concepts
s Blockchain Opportunity Assessment - BOA
s Blockchains Compared: Fabric, Corda, Ethereum


https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/

Consensus Algorithms in Blockchain **










Key Concepts


Consensus Methods 

https://www.investopedia.com/terms/c/consensus-mechanism-cryptocurrency.asp

  • A consensus mechanism is any method used to achieve agreement, trust, and security across a decentralized computer network.
  • In the context of blockchains and cryptocurrencies, proof-of-work (PoW) and proof-of-stake (PoS) are two of the most prevalent consensus mechanisms.
  • Consensus mechanisms play an essential part of securing information by encrypting it and using automated group verification.

Proof of History (PoH)

was developed by the Solana Project. It is similar to Proof of Elapsed Time (PoET), which encodes the passage of time itself cryptographically to achieve consensus without expending many resources.

Consensus mechanisms verify data inputs and outputs, which translates to automatically auditing the digital transactions that are common today—without human oversight or intervention. They create an environment where you don't need to trust that the other party in a transaction is honest because they ensure the information is unalterable and secure.

Beginners Guide to Consensus Methods

https://crypto.com/university/consensus-mechanisms-in-blockchain

Each of these transactions is recorded as a ‘block’ of data, which needs to be independently verified by peer-to-peer computer networks before they can be added to the chain. This system helps to

  • secure the blockchain against fraudulent activity and
  • addresses the problem of ‘double-spending’. 

Different types of consensus mechanisms in blockchain

POS Consensus

POS Proof of Stake and Liquidity Pools

Delegated Proof Of Stake (DPoS): This is another type of Proof of Stake consensus algorithm. This type of consensus mechanism depends on the basis of the delegation of votes. The users delegate their votes to other users. Whichever user then mines the block will distribute the rewards to the users who delegated to that particular vote. Refer to the article Delegated Proof of Stake for more.


POA - Proof of Authority

Not to be confused with proof of activity (also ‘PoA’), proof of authority (PoA) works by selecting its validators based on reputation. A modified version of PoS, it was proposed by Ethereum co-founder and former CTO Gavin Wood in 2017. 

In PoA, validators don’t stake coins. Instead, they must put their reputations on the line for the right to validate blocks. This is very different from the majority of blockchain protocols which usually do not require you to reveal your identity to take part. 

As this mechanism requires almost no computing power, it is far less resource-intensive than some of its predecessors, in particular PoW. It is also one of the less costly options, making it a heavily favoured solution for private networks, such as JP Morgan (JPMCoin). Other PoA-based projects include VeChain (VET) and Ethereum Kovan testnet.

POA limitations

  • Though highly scalable, where it compromises is in the decentralisation area, as only a select few can participate in the network.
  • the requirement for the validators to be identifiable also increases the risk of corruption and third-party manipulation.

Proof of Elapsed Time (PoET)

Usually used on permissioned blockchain networks (those that require participants to identify themselves), proof of elapsed time (PoET) leverages trusted computing to enforce random waiting times for block construction. It was developed by Intel in early 2016 and is based on a special set of CPU instructions called Intel software guard extensions (SGX). 

A time-lottery-based consensus algorithm, PoET works by randomly assigning different wait times to every node in the network. During the waiting period, each of these nodes goes to ‘sleep’ for that specified duration. The first to wake up (that is, the one with the shortest waiting time) is awarded the mining rights. This randomisation guarantees that every participant is equally as likely to be the winner, ensuring fairness within the network.

Used in Sawtooth

Proof of History (PoH)

As the name suggests, proof of history (PoH) provides proof of historical events. Developed by Solana, PoH  allows for ‘timestamps’ to be built into the blockchain itself, verifying the passage of time between transactions without having to rely on other nodes.

This timestamping method is enabled by what’s known as a SHA-256, sequential-hashing verifiable delay function (VDF). It works by taking the output of a transaction and using it as input for the next hash, which enables everyone to clearly see which event took place in a particular sequence. As the VDFs can only be solved by a single CPU score, PoH severely reduces the processing weight of the blockchain, making it faster and more energy-efficient than many of his contemporaries.

Proof of Importance (PoI)

First introduced by NEM (XEM), proof of importance (PoI) selects its miners based on certain criteria in a process called ‘harvesting’. Common factors include the number and size of transactions in the last 30 days, amount of vested currency, and network activity. It’s based on these factors that an importance score is attributed to nodes. The higher the score, the higher the probability of being chosen to harvest a block and receive the accompanying transaction fee.

Though similar to PoS, PoI’s use of additional metrics does away with the former’s tendency to inherently reward the rich by taking into account participants’ overall support of the network. As such, simply staking high in POI does not necessarily guarantee a chance of winning the block.


Consensus Algorithms in Blockchain

https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/

Blockchain is a distributed decentralized network that provides immutability, privacy, security, and transparency

 A consensus algorithm is a procedure through which all the SELECTED peers of the Blockchain network reach a common agreement about the present state of the distributed ledger.

the consensus protocol makes sure that every new block that is added to the Blockchain is the one and only version of the truth that is agreed upon by all the nodes in the Blockchain

Practical Byzantine Fault Tolerance (PBFT)

https://www.geeksforgeeks.org/practical-byzantine-fault-tolerancepbft/

Byzantine Fault Tolerance(BFT) is the feature of a distributed network to reach consensus(agreement on the same value) even when some of the nodes in the network fail to respond or respond with incorrect information. The objective of a BFT mechanism is to safeguard against the system failures by employing collective decision making(both – correct and faulty nodes) which aims to reduce to influence of the faulty nodes. BFT is derived from Byzantine Generals’ Problem.

Byzantine fault tolerance can be achieved if the correctly working nodes in the network reach an agreement on their values. There can be a default vote value given to missing messages i.e., we can assume that the message from a particular node is ‘faulty’ if the message is not received within a certain time limit. Furthermore, we can also assign a default response if the majority of nodes respond with a correct value.

a consensus(agreement on same state) can be reached if atmost m processors are faulty which means that strictly more than two-thirds of the total number of processors should be honest.

Some of the arbitrary node failures are given below :

  • Failure to return a result
  • Respond with an incorrect result
  • Respond with a deliberately misleading result
  • Respond with a different result to different parts of the system

The goal is that all honest nodes help in reaching a consensus regarding the state of the system using the majority rule.
A practical Byzantine Fault Tolerant system can function on the condition that the maximum number of malicious nodes must not be greater than or equal to one-third of all the nodes in the system. As the number of nodes increase, the system becomes more secure.

pBFT consensus rounds are broken into 4 phases(refer with the image below):

  • The client sends a request to the primary(leader) node.
  • The primary(leader) node broadcasts the request to the all the secondary(backup) nodes.
  • The nodes(primary and secondaries) perform the service requested and then send back a reply to the client.
  • The request is served successfully when the client receives ‘m+1’ replies from different nodes in the network with the same result, where m is the maximum number of faulty nodes allowed.

pbft algorithm communication visual


If needed, a majority of the honest nodes can vote on the legitimacy of the current leading node and replace it with the next leading node in line.

pBFT limitations

  1. good for small node count
    pBFT consensus model works efficiently only when the number of nodes in the distributed network is small due to the high communication overhead that increases exponentially with every extra node in the network.
  2. susceptible to Sybil attacks, where one entity(party) controls many identities.
  3. scaling
    As the number of nodes in the network increase(increases as O(n^k), where n is the messages and k is the number of nodes), so does the time taken to respond to the request.






Potential Value Opportunities



Potential Challenges



Candidate Solutions



Fabric v2.5

https://hyperledger-fabric.readthedocs.io/en/release-2.5/peers/peers.html


Fabric v3x



Step-by-step guide for Example



sample code block

sample code block
 



Recommended Next Steps