Blockchain

Consensus Protocols That Meet Different Business Demands. Part I

Author
Tim Kozak
Tim Kozak
publish date March 26, 2018 Tags share article

1. Proof-of-Work protocol

1.1. Proof-of-Work (PoW)

2. Proof-of-Stake protocols

2.1. Proof-of-Stake (PoS)

2.2. Delegated Proof-of-Stake (DPoS)

3. Byzantine Fault Tolerance (BFT) protocols

3.1. Delegated Byzantine Fault Tolerance (DBFT)

3.2. Practical Byzantine Fault Tolerance (PBFT)

3.3. Federated Byzantine Agreement (FBA)

Quick Review

4. Directed Acyclic Graph protocol

4.1. Directed Acyclic Graph (DAG)

4.2. HashGraph

5. Other Consensus Protocols for Specific Tasks

5.1. Proof-of-Activity (PoA)

5.2. Proof-of-Location (PoL)

5.3. Proof-of-Importance (PoI)

5.4. Proof-of-Elapsed-Time (PoET)

6. Beyond the Mainstream Protocols

In our our previous post we described different types of blockchain. However, they only characterize the environment in which blockchain can operate. The heart of distributed ledger technology (DLT) is the consensus protocol.

Interestingly, mathematicians and engineers have been developing distributed networks and consensensus protocols for decades but only with the emergence of Bitcoin has this technology  made a leap forward. It doesn’t give any sign of stopping either, and it’s this leap forward that has allowed the variants of new rules for machine consensus to evolve. We invite you to take a glance at the most important of them.

Why Consensus Algorithm?

What is consensus anyway? To give a broad definition, consensus is an agreement that satisfies each of the parties involved. It’s a key to democracy and decentralization in general and DLTs in particular. Look at Bitcoin: despite having a mysterious founder in Satoshi Nakamoto, he has no power over the community whatsoever. Bitcoin as a blockchain is fully transparent and open-source, and every node is equal on the network.

In the narrow meaning that we apply to cryptography, consensus is a voting procedure. Its goal is to ensure that all members of the network agree on its current state even after the addition of a new block or a package of transactions. In other words, a consensus protocol guarantees that the chain is true and that there are incentives to keep participants fair. It’s a major framework for preventing a single entity from controlling the entire system and makes sure everybody follows the rules.

Quick Review

Protocol = a set of rules

Protocols help to:

  • ensure the viability of transactions in the network
  • eliminate double spending
  • validate that participants are honest

A protocol is the sum of:

  • the deterministic logical conditions of the framework
  • cryptographic encryption as a basis of security
  • social encouragement to maintain the given protocol

So what are some of these protocols?

 

1. Proof-of-Work protocol

 

1.1. Proof-of-Work (PoW)

 

Proof-of-Work (PoW)

Principle:

A difficult solution to find but easy to verify.

Speed:

Low

DLT setup:

Public/private blockchain

Finality:

Probabilistic

Example of use:

Bitcoin, Ethereum, Litecoin

The Bitcoin blockchain is perhaps the most replicated blockchain. The multiple nodes running it, order the transactions according to the PoW consensus algorithm. To add new blocks, each node has to prove that it has performed a certain amount of work. To be precise, they solve a hard hashing puzzle using a high computational input.

As a result, participation in PoW carries a cost but can be implemented in an environment without trust. Since it suits permissionless blockchains, anybody can join the network. Although the scalability of peer networks is high, the transaction speed remains low. Another concern is the decrease of the reward over time and low fees in future; generally, miners join to get rich, not to voluntarily support the network.

 

2. Proof-of-Stake protocols

 

2.1. Proof-of-Stake (PoS)

 

Proof-of-Stake (PoS)

Principle:

The network trusts the validator who stakes their own coins; the bigger the stake the higher the chances of validating transactions.

Speed:

High

DLT setup:

Public/private blockchain

Finality:

Probabilistic

Example of use:

NXT, Tezos, soon Ethereum

Turing-complete, Ethereum’s main network, is running on PoW. However, the project plans to

switch to a more efficient protocol known as Proof-of-Stake in 2018. The unique feature of PoS is the absence of difficult and unnecessary computation. Instead of competing with others, network members deposit their crypto-assets, like ether in Ethereum, and wait to be randomly picked to process a validation of the network.

If they’ve followed the rules, the staker creates or “mints” additional coins for validating a block of transactions. An algorithm selects one of the minters based on the stake they own. So if a node has a 5% stake, it will validate 5% of the transactions. The idea is that the higher the stake of the validator in the underlying cryptocurrency, the less interest they have in corrupting the validation process.

Just like with PoW algorithm, transaction finality in PoS is probabilistic. Though transactions are relatively fast compared to those of Bitcoin, it still requires tokens to work. Furthermore, skeptics indicate that validators with high stakes will be selected more often and thus obtain even more tokens: the rich get richer.

However, the PoS algorithm doesn’t incentivize those who don’t expend any cryptocurrency. Consequently, they are likely to vote on multiple blocks to support “forks” — copies of the blockchain with a new set of rules — while seeking to maximize the reward. This is called  “nothing at stake” problem. On the other hand, the primary incentive to support the algorithm while running own node is securing funds rather than assuming that exchanges will do this for you.

 

2.2. Delegated Proof-of-Stake (DPoS)

 

Delegated Proof-of-Stake (DPoS)

Principle:

The participants delegate production of new blocks to a small and fixed number of elected participants. Highly competitive but highly profitable.

Speed:

High

DLT setup:

Public/private blockchain

Finality:

Probabilistic

Example of use:

EOS, BitShares

In the meantime, developers offered an alternative economic incentive called the Delegated Proof-of-Stake or DPoS. It allows you to generate blocks at high speed and handle a large number of transactions per second compared to other consensus algorithms. The basic principle of DPoS is to divide the voting and validation procedure among a few delegated participants.

During voting, coin holders choose the validators of transactions that will form blocks. The weight of each vote is determined by the sum of the assets of the voter. Coin holders can re-vote candidates at any time. This determines the high resilience of the network: if most of the performers fail, the community will immediately vote for their replacement.

The generation of new blocks happens every 1 or 2 seconds. This protocol is not only faster, but more fair since the “delegated” validator shares newly minted coins with its voters later. However, confirmation is still needed from all validators. Therefore, a user may have to wait around twenty more blocks to ensure the validity of the transaction.

Daniel Larimer developed DPoS in 2014. He first used it in his BitShares project, and later in Steemit and EOS. Larimer hypothesized that validators in DPoS will have a strong incentive to remain fair and offer the fastest and best service possible. After all, it would be silly to hack a network that pays you well. And if you stop doing a good job, there are other members that are ready and willing to take the place of the validator.

 

3. Byzantine Fault Tolerance (BFT) protocols

So far we’ve been talking about public blockchains that operate in a trustless environment and aim at decentralization. What about private enterprise blockchains? What if participants can trust each other? It’s true that the fewer validators a blockchain has, the faster it is. In fact, the speed increases tenfold, from hundreds to thousands of transactions per second, which is a great fit for corporate blockchain solutions.

Byzantine Fault Tolerance (BFT) protocol is a different class of protocols that does not require tokens during the voting as in a PoS algorithm. Furthermore, it allows signing of a block even when 1/3 of the actors fail or act maliciously. BFT resolves the problem of numerous faults in the system and the waiting time of up to 30 seconds for confirming a block.

In fact, the algorithm refers to an old Byzantine Generals’ problem, based on a real historical event. Using the analogy, the protocol does not care if a “general” got sick or sabotaged the counterparts — the system will still function even when the node goes offline.

 

3.1. Delegated Byzantine Fault Tolerance (DBFT)

 

Delegated Byzantine Fault Tolerance (DBFT)

Principle:

Preselected nodes maintain consensus even if some of them fail or are malicious.

Speed:

Very high

DLT setup:

Public/private blockchain

Finality:

Immediate

Example of use:

NEO, TON

So the BFT consensus protocol seems like salvation from the imperfections of PoW and PoS, but given thousands of validators, it would still struggle to resolve the speed issue. This is why developers offered a delegated model of BFT — the DBFT.

Predefined validators in this consensus protocol allow it to far outstrip other protocols. Take Ethereum with 15-20 transactions per second and NEO with almost 10,000 t/s. It is indeed convenient to have a few known actors who validate transactions before releasing to other nodes. In case a validator betrays the network, participants can delegate a different node.

Note: since NEO runs on PoS DBFT protocol, the network members not only delegate validators but also receive a native token GAS as part of their validator stake.

 

3.2. Practical Byzantine Fault Tolerance (PBFT)

 

Practical Byzantine Fault Tolerance (PBFT)

Principle:

Standard blockchain for enterprise.

Speed:

High

DLT setup:

Private permissioned blockchain

Finality:

Immediate

Example of use:

Hyperledger, Chain

If one wants a scalable and fast blockchain, this is a way to go. PBFT protocol is very similar to DBFT, especially in regard to its more centralized nature. The only difference is that the former has a simpler implementation and is often a private blockchain with appointed signing nodes from the very beginning. Which is kind of practical, isn’t it?

When a validator receives a message, it performs a computation, and then asks all other nodes  in turn if the transaction is valid. After confirming validation, the first validator broadcasts the decision to the network of other validators. In this way, consensus is achieved based on the confirmation being submitted by all validators.  

PBFT is effective in low latency systems but sensitive to the number of validators and throughput. It fits well for private setups which don’t require a large amount of capacity, but demand many transactions. PBFT guarantees the accuracy of transaction records within the network.

You may also have encountered SIEVE protocol which is a type of PBFT. It handles non-deterministic chaincode execution. There is also Cross Fault Tolerance (XFT) protocol as well as Paxos and Raft protocols which are Crash Fault Tolerant (CFT). We might cover these deep technical characteristics in future articles but if it’s important to you, you could always ask us.

 

3.3. Federated Byzantine Agreement (FBA)

 

Federated Byzantine Agreement (FBA)

Principle:

Blocks are validated if signed by a specified quorum of signers.

Speed:

High

DLT setup:

Public or private permissionless blockchain

Finality:

Immediate

Example of use:

Stellar, Ripple

Here you have a permissionless BFT protocol as opposed to the permissioned PBFT and other variants of BFT. A Federated Byzantine Agreement (FBA) allows anybody to join the network but transactions are verified by a group instead of one node broadcasting the message to others.

Notably, FBA has Gateways and Market-Makers which ensure the fairness and liquidity of the network. The former act as traditional banks holding the fiat funds and creating an equivalent in virtual tokens. Market-makers keep accounts with multiple Gateways and in several currencies.

 

Quick Review

  • Proof-of-Work has been the first and most reliable consensus protocol for public blockchains like Bitcoin and Ethereum, yet it is energy-inefficient.
  • Proof-of-Stake does not require hard computation. Instead, it encourages users to stake their own funds to perform the equivalent quantity of transaction validations and assumes everyone will act rationally.
  • BFT is an addition to PoS concept that makes it much faster and more tolerant to faulty nodes. It’s only practical to run on small and private setups though.
  • PBFT is a proven solution for corporate blockchains. Fast and safe but relies on throughput.
  • DBFT improves BFT by allowing participants of the BFT network to delegate their validators. Very fast but more centralized.
  • While the abovementioned BFT variants are permissioned blockchains, FBA is federated and, thus, permissionless. But there are more protocols…

 

4. Directed Acyclic Graph protocol

Researcher Serguei Popov ran a thought experiment: what if we can avoid blocks completely?

 

4.1. Directed Acyclic Graph (DAG)

 

Directed Acyclic Graph (DAG)

Principle:

No fixed blocks that are confirmed in a random order on a linear scale.

Speed:

High

DLT setup:

Public permissioned non-blockchain

Finality:

Probabilistic

Example of use:

IOTA, ByteBall

The major issue with blockchain is its synchronous nature. Blockchains cannot be parallel. One can change the size or frequency of blocks as well as the parties that approve them, but there will always be a waiting queue. Alternately, Directed Acyclic Graph (DAG) technology is asynchronous which gives the competitive advantage of simultaneous events.

The protocol in such systems lets participants confirm a block of transactions a few blocks away, since there will eventually be another participant proving it is correct. While this implies ultra high speeds for the network, it’s slow on a smaller scale. Additionally, there’s a danger of parasite “chains” of non-valid transactions and centralization due to preselected validators.

 

4.2. HashGraph

 

HashGraph

Principle:

Nodes communicate randomly using the ‘gossip about gossip’ protocol and agree on consensus after a certain communication round.

Speed:

Very High

DLT setup:

Private permissioned non-blockchain

Finality:

Round based

Example of use:

HashGraph

The developers of this protocol claim that blockchain is an outdated system. As a substitute, they also advocate for the DAG concept. However, the key difference of HashGraph is a “gossip to gossip” protocol, where a node receives a time-stamped set of transactions that the other node “knows” about. As a result, there is an endless hash tree — or a graph — that grows over time with millions of time-stamps, the leaves. Once the majority of the network agrees on a particular event, there is no doubt it is valid.

There are certain limitations however. First of all, there is little evidence of practical implementation on a large scale, especially when compared to working blockchain projects. Secondly, HashGraph technology is patented and acquiring a license costs money. This also leads to the third issue: the lack of a strong community (like those associated with open-source projects). Such a community can test the robustness of a protocol, its vulnerability towards hackers and issues of compatibility. HashGraph is currently available for private setup only.

 

5. Other Consensus Protocols for Specific Tasks

As if that wasn’t enough, people have pushed technology and the imagination even further . More researchers and blockchain developers have experimented with new consensus models that would resolve different business challenges.

 

5.1. Proof-of-Activity (PoA)

  Proof-of-Activity (PoA)

Principle:

A hybrid of PoW and PoS

Speed:

Low

DLT setup:

Public permissionless blockchain

Finality:

Probabilistic

Example of use:

Decred

Proof-of-Activity (PoA) combines PoW and PoS protocols meaning that the participants can both mine and stake their coins to validate blocks. This way, the PoA protocol ensures a balance between miners and common participants of the network.

 

5.2. Proof-of-Location (PoL)

  Proof-of-Location (PoL)

Principle:

Use beacons to notice a node in a synchronized manner and then timestamp its presence.

Speed:

Medium

DLT setup:

Public permissionless blockchain

Finality:

Immediate

Example of use:

FOAM, Platin

Proof-of-Location (PoL) lets users privately record authenticated location data when they choose so, without GPS. Then, they can reveal this personal information at will.

Interestingly, the protocol relies on the BFT of the beacons that record geolocation and timestamp it in the blockchain which prevents the system from failures and frauds.

 

5.3. Proof-of-Importance (PoI)

  Proof-of-Importance (PoI)

Principle:

Like PoS but with additional properties that influence your ranking.

Speed:

High

DLT setup:

Public permissionless blockchain

Finality:

Probabilistic

Example of use:

NEM

The Proof-of-Importance (PoI) consensus algorithm acts almost like PoS but includes three components:

  • The number of tokens in the account
  • Account transaction activity
  • Time the has account spent in the network

While the first parameter plays a major role in the ranking for verifying transactions, the second and third parameters are rather weak but still help with establishing the “importance” of an account. The smaller the sum of tokens, the stronger influence of other parameters.

Thus, an account that “vested” hundreds of thousands of tokens can increase its significance factor up to 3 times due to its activity and consistent presence in the network. On the other hand, it doesn’t make any difference for those who possess hundreds of millions of tokens in their account.

 

5.4. Proof-of-Elapsed-Time (PoET)

  Proof-of-Elapsed-Time (PoET)

Principle:

Blocks are created in a trusted environment with equal periods

Speed:

Medium

DLT setup:

Private permissioned or permissionless blockchain

Finality:

Probabilistic

Example of use:

Intel

Chipmaker Intel didn’t lag behind and developed their own blockchain entitled IntelLedger. A consensus algorithm of IntelLedger is called Proof of Elapsed Time (PoET). Today, it is a HyperLedger consensus module.

This system is similar to Proof-of-Work, but consumes far less electricity. Instead of having participants solve a cryptographic puzzle, the algorithm operates in a Trusted Execution Environment (TEE), such as Intel’s Software Guard Extensions (SGX). The PoET protocol also assures blocks get created through a lottery but without any required work.  

Intel’s solution offers a guaranteed wait time due to the TEE. According to the company, the proof-of-elapsed-time algorithm can scale to thousands of nodes and will properly run on any Intel processor that supports SGX. Isn’t blockchain supposed to be helping us to get away from third parties rather than relying on them though?

 

6. Beyond the Mainstream Protocols

There are more exotic protocols like Proof-of-Stake-Time (PoST) and Proof-of-Brain (PoB) that we just couldn’t fit in this article. Find them in Part II. Moreover, our Blockchain glossary will help you keep on top of the ever growing collection of Blockchain related terminology.