Consensus Mechanism#1 What are POW, POS, DPOS and BFT-DPOS

in #eos6 years ago (edited)

The bottom layer of the blockchain is mainly composed of distributed database, cryptography, P2P network and consensus mechanism, among which the consensus mechanism as a key role in the blockchain system, determines who has the right to create new blocks. Different blockchain projects may adopt different consensus mechanisms, and the EcoBall adopts the Domain Sharding Consensus Mechanism. Before knowing more about the Domain Sharding Consensus Mechanism, let's first take a look at some common consensus mechanisms such as POW, POS, DPOS, and BFT-DPOS.

1. POW (Proof of Work)


POW determines who has the right to produce blocks and gain reward by the hash rates of their mining machines. With higher hash rates and longer working time, it is easier to produce blocks and get rewards. Simply speaking, the POW is like a prize-winning competition for everyone. The participant who is the first one to provide the correct answer (similar to the highest hash rate), will finally get the prize (similar to block producing rights and rewards). POW is adopted by some famous blockchain projects such as BTC and ETH.

No doubt that the POW is highly decentralized and easy to implement with simple algorithm. However it also has disadvantages including electricity waste and long consensus time. To make matters worse, with more and more mining pools, the hash rate distribution is much more centralized.

2. POS (Proof of Stake)


In contrast, POS determines who has the right to produce blocks and gain reward by the “coins age”, a number derived from the product of the number of coins multiplied by the number of days the coins have been held. The older the coins age becomes, the more rewards you get.

For example, A has 100 coins for 50 days while B has 80 coins for 60 days. Then:
Coins Age of A: 100x50=-5,000
Coins Age of B: 80x60=4,800
Therefore, A has more chances to produce blocks than B for the coins age of A is older than that of B.

Since POS gives the block producing rights to those with more tokens of longer time, it can save a large amount of electricity and reduce the time for consensus formation. However, it will be a monopoly game for whales having a large amount of coins, which is not only the opposite of the ideal option for a distributed consensus protocol, but also reduces the currency's liquidity.

3. DPOS (Delegated Proof of Stake)


DPOS uses a limited number of nodes, instead of several thousand nodes, to propose and validate blocks to the blockchain also to keep transaction processing fast. It is similar to the US parliamentary system, in which a number of representatives voted by ordinary people, dealing with the things of the whole country and getting paid in return. If you have more tokens, you can have higher voting weight. If you get more votes, you can get a better ranking.

(Date Sources from votetracker.io)

For example, EOS uses 21 nodes voted by token holders and allows back-up nodes to replace former nodes. The specific process of producing and validating blocks is as follows:

  1. Each node produces 1 block and broadcasts to the rest 20 nodes.
  2. Two-thirds of nodes (21*2/3) validate the block by producing a new block, and send validating messages back to the first one.
  3. After the validation is completed, the transaction is irreversible.
    Therefore, the block can be produced within 3 seconds and the transaction can be irreversible within 45 seconds.

But in order to support large-scale DApps, producing and validating blocks need to be faster!

4. BFT-DPOS (Byzantine Fault Tolerance-Delegated Proof of Stake)


First, we need to understand what is the Byzantine Fault Tolerance (BFT). According to Wikipedia,BFT refers to the famous Byzantine Generals' Problem, an agreement problem described by Leslie Lamport, Robert Shostak and Marshall Pease in their 1982 paper. In the Byzantine Generals' Problem, a group of generals, each commanding a portion of the Byzantine army that is far away from each other, need to decide whether to attack or retreat to formulate a plan for attacking a city. Some generals may prefer to attack, while others prefer to retreat. However, the problem is complicated by the presence of treacherous generals who not only cast a vote for a worse option, but also send attack to some generals while send retreat to the rest generals, in which way all generals cannot formulate a unified plan and fail at war.

Therefore, the essence of the Byzantine general problem is to find a way for the generals to build a consensus on the battle plan in a non-trustful environment with traitors.


(Image from the network)

Similarly, it is necessary for blockchain to find a way to ensure that even if there are faulty nodes or even destructive nodes, the blockchain network can operate normally. BFT-DPOS are innovative based on the BFT.

Compared to DPOS, what are the main features of BFT-DPoS? First, in order to reduce network latency and blocks leakage, BFT-DPoS changes the random block producing order to the order determined by validators. That is to say, the adjacent block can preferentially produce and validate the block. Second, each node still produces blocks for 3 seconds, but need to produces 6 blocks continuously, instead of 1 block, to ensure that new blocks are produced and the old blocks can be confirmed simultaneously. So block can be produced within 0.5 second and transaction can be irreversible within 1 second.

However, BFT-DPOS still restricts the network to the processing power of a single node, which limits the speed of network and wastes a lot of resources. As more nodes join the network, the entire network node shows Brownian motion characteristics, resulting in increased system entropy.

How to take full advantages of each node to make the entire network a powerful distributed computer? The Domain Sharding Consensus Mechanism will be the perfect answer. But what is the Domain Sharding Consensus Mechanism? Let’s find more details in the next article.

Official website: http://www.ecoball.org/#/home
Medium: https://medium.com/@ecoballblockchain
Facebook Group: https://www.facebook.com/ecoballofficial/
Twitter: https://twitter.com/Ecoball3
Telegram: http://t.me/ecoballofficial
QQ Group: 728567298

Sort:  

Congratulations @ecoballofficial! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

The Steem community has lost an epic member! Farewell @woflhart!
SteemitBoard - Witness Update
Do not miss the coming Rocky Mountain Steem Meetup and get a new community badge!
Vote for @Steemitboard as a witness to get one more award and increased upvotes!