EOSUnion| Blockchain Consensus Mechanism 101

in #eos6 years ago (edited)

微信图片_20180808102145.jpg
In the first class, we learned about the composition and three characteristics of the blockchain, and left two questions for the theme of this class, namely, 1. how to solve the two basic problems derived from the blockchain decentralized agent: Who has the right to record data (accounting); 2. how do other people synchronize data?

Both of these issues were finally resolved in the consensus mechanism.

The consensus mechanism, in simple terms, is a methodology that allows participants to reach consensus, which determines who gets the bookkeeping rights and rewards for the blockchain. At present, there are mainly three mainstream consensus mechanisms, namely PoW, PoS, and DpoS, but none of them is perfect, each of them has its own advantages and disadvantages. We will focus on their working principles and advantages and disadvantages below.

微信图片_20180808102154.jpg

PoW(Proof of Work)


PoW, the proof of work, determines your chances of getting bookkeeping rights by evaluating your work. The more you work, the more likely you are to get this bookkeeping opportunity.

PoW is actually like a prize-winning contest. Let’s assumed that there are four players in the blockchain world, A, B, C, and D. They must challenge the same topic. Whoever complete these challenges first will get the final trophy (bookkeeping rights) and the corresponding bonus (the system will reward Bitcoin after the bookkeeping is completed).

Some people may ask, how to judge if both A and C are succeeded at the same time (that is, there are now two blocks that satisfy the conditions at the same time)? We call this scenario a fork:

In a blockchain system where PoW to be a consensus mechanism, this problem is solved in this way: overtime contest. Although A and C had a close call, their ability to solve problems are different. After a period of time, there will always be one person who has answered more questions than the other (i.e., the blockchain with a longer chain will appear in the whole network), then he is the person who finally gets the bookkeeping rights and rewards.

The person who lost will not continue to answer the question, because there will be no reward for continuing to answer the question. Therefore, the chain in which the winner is located becomes the main chain, and the forked chain disappears, thus ensuring the uniqueness of the blockchain data. This is the longest chain principle followed in the proof of work mechanism.

Of course, this situation occurs on the premise that everyone follows the same mechanism. If it does not comply, the fork will continue. This issue is for further discussion in the next class.

Although the PoW consensus plugin is simple and easy to implement, we also see its shortcomings:

  1. Waste a lot of computing energy, because at the same time the participation challenge (mining) can only have one winner, then the computing energy consumed by other participants in the process is wasted;
  2. The cycle of reaching consensus is too long and the processing efficiency is low (such as Bitcoin can only do 7 transactions per second), which is not suitable for commercial applications;
  3. It is proved easy to create forks and needs to wait for multiple confirmations;
  4. The increasing concentration of computing power has brought about a growing centralization. At present, the BTC.COM, ant pool and micro-bits of the mine have controlled more than 51% of the computing power. If they are united or controlled by hackers, then a terrible 51% attack may occur.

微信图片_20180808102219.jpg

PoS(Proof of Stake)


Because PoW has a lot of resources wasted, and the consensus cycle is too long, the PoS consensus mechanism came into being.

PoS, the proof of Stake, changes the power in PoW to system equity, and determines the chance of getting the bookkeeping right by evaluating the amount and duration of the token you hold. In this way, there is a noun called token age (token age = token number * holding token duration), for example, if you hold 100 coins for a total of 30 days, then your coin age is 3000. The longer you hold the token, the greater the chances of getting bookkeeping right (and the bookkeeping is profitable).

It is similar to the stock or bank deposits in our real life. Users can continuously maximize their profits and ensure the security of the entire blockchain network based on the amount and time of holding tokens.

The benefits of PoS are obvious, saving a lot of computing power and electricity bills that are wasted by competing for bookkeeping right, while greatly reducing the time for consensus, but the shortcomings are also obvious:

  1. A person (or node) with a large amount of money has a higher chance of obtaining bookkeeping right, which will make the consensus become a monopoly game for a few rich people, thus losing the impartiality;
  2. All confirmations are only probabilistic expressions, and there are other possibilities for attack. For example, the ETA attack in Ethereum caused Ethereum to be hard forked.

微信图片_20180808102224.jpg

DPoS(Delegated Proof of Stake)


DPoS, the delegated proof of Stake, is a new consensus algorithm born on the basis of PoW and PoS. It can not only solve the problem of a large amount of energy consumption caused by PoW in the mining process, but also avoid the problem of the “trust balance” bias that may arise under the distribution of PoS rights, thus it stands out for becoming the representative consensus mechanism for the consensus mechanism 3.0. Typical examples include Bitshares, Steem, and EOS.

To understand the DPoS principle, we can compare it to the board of a company or the US parliamentary system. Under the DPoS consensus mechanism, a certain number of representatives will be selected to be responsible for the block producer (for example, EOS selects 21 BPs as nodes of the production block).

So how were these representatives selected? It is the choice of each holder of the currency according to the amount of money held in the hand, of course, these elected representatives will receive a certain token reward. But if these representatives can't fulfill their duties (such as when they turn to them, they can't generate blocks), they will be delisted, and the network will choose new supernodes to replace them. After all, there are many people waiting in line.

As a representative of the consensus mechanism 3.0, what are the advantages of DPoS?

  1. In terms of consensus cycle, the DPoS consensus mechanism significantly reduces the number of participating verification and accounting nodes, which can achieve second-level consensus verification, and the system processing efficiency is greatly improved, and it is more likely to replace modern commercial applications;
  2. In terms of governance capabilities, in the DPoS system, the structure of governance is clear and all shareholders have a say. The cost of this governance is consistent with the consensus process, so when making decisions, it is clear that there is no “unexpected fork” basically.

However, it also has certain shortcomings, such as a fixed number of representatives as bookkeepers, which is violating to the concept of decentralization, the number of representatives is too small, and the participation is too low. In addition, the DPoS consensus mechanism still relies on tokens, but many Commercial applications do not require token participation.

Through the comparison of the three consensus mechanisms, we will find that DPoS may be a consensus mechanism that meets the development needs of the blockchain technology era best, and will achieve more rapid development in the future. We also hope that, as a new underlying architecture, the DPoS consensus mechanism can carry the demand for more commercial projects in the future, and promote the vigorous development of the digital economy industry and the blockchain industry. We will wait and see in the future.

Follow us


WeChat: eosunion
Steemit: https://steemit.com/@eosunion
Telegram Channel: https://t.me/EOSUnionChannel
Telegram Chat: https://t.me/EOS_Union
Email: [email protected]
Twitter: eos_UNION

Coin Marketplace

STEEM 0.16
TRX 0.13
JST 0.026
BTC 60616.50
ETH 2911.03
USDT 1.00
SBD 2.46