Nov 1, 2018 at 06:30
Nov 2, 2018 at 05:25 UTC
Hyperledger Consensus Algorithm
Blockchain technology has been making waves in the tech scene for a while now and many corporate entities have begun to mould this distributed ledger technology to the needs of their specific use cases. What many might not know however is that most of these companies use a revolutionary form of the blockchain technology to make corporate cooperation possible in joint projects. The revolution that is Hyperledger has managed to change how many businesses around the world coordinate their project goals. Here we try to understand what consensus algorithm drives this incredible technology and how a number of different companies are able to reconcile their various perspectives into a single and consensually accepted viewpoint. To understand that, we must take a look at the Hyperledger consensus algorithm.
What is Consensus Algorithm?
Consensus algorithms in blockchain are the key way to make sure that the blockchain database, which is shared across a number of different unreliable “node” computers, can be updated with a single data value that is considered to be reliable and is consensually agreed upon by the nodes. Multi-stakeholder systems like the Hyperledger can especially benefit from a well-built consensus protocol as that would allow them to make quick decisions. Consensus algorithms do not require all nodes to agree on a data value but having a majority agreement is usually considered to be enough to have reached consensus. Different kinds of blockchain networks use different kinds of consensus protocols and Hyperledger too has a specific one to follow. Here, it is to be noted that even Hyperledger has different types, like Hyperledger Fabric, Hyperledger Swatooth, Hyperledger Burrow or Hyperledger Corda, among others. Here we’ll be discussing the general pattern of consensus followed in all Hyperledger technologies, with focus on that of the Hyperledger Fabric as that is the most widely used.
How does Consensus Work In Hyperledger?
In a hyperledger network, the consensus algorithm has some goals to meet and tasks to get done.
a) Make sure that all transactions recorded in a block are accurate, and in adherence to consortium policies.
b) Ensures that the transactions are recorded in the correct order and can lead to proper execution.
c) Coordinates with a layer of smart layer to make sure an ordered set of transactions is accurate.
There are two characteristics to be confirmed by the consensus algorithm and these are as follows:
a) Liveness: This characteristic ensures that every functioning node constantly keeps receiving the updated version of the database so that there’s no failure in communication.
b) Homogeneity: The consensus algorithm must work in the exact same manner with every single node. Whenever the nodes receive one piece of information, then it has to be processed in an identical manner for the nodes to yield an identical sequence of outputs.
Need for Voting-Based Consensus
Since Hyperledger technologies are used by consortiums, the environment is always of partial, rather than complete trust. Hence, even though speed and scalability do get compromised as a result, the Hyperledger consensus algorithms base it on votes.
Steps of Consensus (in Hyperledger Fabric)
In one of the best known Hyperledger technologies, the Hyperledger Fabric, follows certain steps in achieving consensus. They are as follows:
a) Endorsement of a transaction by a given number of endorsers.
b) Ordering of the transactions involves the nodes agreeing to what order the transactions are updated in, onto the ledger.
c) Validation process involves verifying the accuracy of a block of transactions.
Examples of Hyperledger Consensus Algorithms
Following are two majorly well-known examples of Hyperledger Consensus Algorithms:
Proof of Elapsed Time (PoET)
The PoET was developed in 2016 by reputed tech company Intel and is often used in Hyperledger Sawtooth. Here, of course the blockchain is a permissioned one. This means that every node in the network is an identifiable and accepted participant in the network. Each of these nodes is assigned a random time for which they need to wait. Whichever node has its timer ticking first, gets to validate a block. The process goes on like this and every node that has waited for the stipulated time can validate the immediate next block that comes its way once it’s done waiting. This algorithm is considered to be a highly energy efficient one.
Practical Byzantine Fault Tolerance (PBFT)
This offers a solution to the Byzantine Generals’ Problem. The allegorical problem basically refers to a situation where generals of the large Byzantine empire are struggling to attack a city because they cannot communicate with one another easily or formulate a joint plan of action. This lack of consensus can be dealt with by using consensus algorithms of various kinds. In PBFT, to put it simply, the generals all receive a certain information. Each of them combine that information with the information they have with their current state. The computation run on both these pieces of information generates a response and a combination of all node responses allows PBFT to make a consensus-based decision.
To understand how other kinds of blockchain network build consensus and reach decisions, there are many different consensus protocols used in blockchain that you should keep abreast of because consensus is what powers the blockchain architecture.