first, the birth of DPoS
Imagine a company that employs 1000 people, each holding a stake in a company of varying amounts. Every once in a while, employees can put their votes in the hands of their most recognized 10 people to lead the company, each of whom has the right to vote in proportion to the number of shares held in his hand. After all the votes were cast, the 10 people with the highest rate of votes became the leader of the company. If a leader can depletes or do something detrimental to the company, the employee can withdraw from the management by withdrawing the vote for the change leader, so that his ticket rate does not reach the top 10. This is an image description of the Dpos (delegated Proof of Stake) consensus mechanism.
DPoS is a blockchain-based consensus algorithm that was proposed and applied by Bitshares's chief developer, Dan Larimer (now the EOS CTO), in April 2014. At that time, Dan observed some of the problems with the Bitcoin system consensus algorithm POW: for example, the ore pool leads to more and more concentration of calculation, power consumption is too large. So he proposed a faster, safer and less energy-consuming algorithm, which was later dpos. Ii. The electoral mechanism of Dpos
In the Dpos consensus algorithm, the normal operation of the blockchain depends on the trustee (Delegates), these trustees are completely equivalent. The principal duties of the trustee are:
1. Provide a server node to ensure the normal operation of the node;
2. Node server collects transactions in the network;
3. The node validates the transaction and packs the transaction into chunks;
4. Node broadcast block, the other node after the validation of the block added to their own database;
5. Lead and promote the development of blockchain projects;
The trustee's node server is equivalent to the mining machine in the Bitcoin network, and can receive the block rewards and transaction fees while the work is done.
The number of trustees for a blockchain project is determined by the project initiator, typically 101 trustees. Any holder of a coin can participate in both voting and election trustees. Users can vote, withdraw votes at any time, the weight of each user vote and their own currency proportional to the amount. Voting and withdrawing tickets can be carried out at any time, at the end of each round (round) election, the highest rate of 101 (generally 101, or other figures, specifically determined by the blockchain project) users become trustees of the project, responsible for packaging blocks, maintaining the system's operation and receive corresponding rewards.
The fundamental purpose of the election is to elect 101 users in the community who are most favourable to the development and operation of the project through the voting of each person. The server nodes of these 101 users can efficiently maintain the operation of the system, and they will contribute their ability to facilitate the development of blockchain projects, which is somewhat similar to our "People's representative" system (but shorter and more efficient). In this way, we have achieved the centralized election consensus and ensured the efficiency of the whole system and the reduction of energy waste. Pseudo-code implementation of Dpos
Let's take a look at the pseudo-code implementation of Dpos:
For round I//split into many round,round infinitely continuous
dlist_i = Get n Delegates sort by votes//N trustee with highest vote rate according to poll
dlist_i = Shuffle (dlist_i)//random change sequence
loop//round finished, exit loop
slot = Global_time_offset/block_interval
pos = slot% N
if dlist _i[pos] exists in this node//delegate
generateblock (KeyPair of Dlist_i[pos])//Generate block
else
Skip
Pseudo code reference to understand Dpos with pseudo code
You can see that in each round of the cycle, the system will be re-ranked votes. In selecting the highest of the N trustees, the system is first scrambled, and then the trustee makes the block. Once the block is finished, it enters the next cycle. four, well-known DPoS project
1. Bitshares
The first project to apply the DPOS mechanism, its dpos mechanism contains witnesses (witnesses) and trustees (Delegates), the witness is responsible for the packaging of the block, the trustee is responsible for the modification of the system parameters.
2. EOS
Consensus algorithm I dpos + BFT, there are 21 trustees.
3. Asch
The consensus algorithm for Dpos + PBFT, with 101 trustees, is currently open for election.
Reference:
Explain delegated Proof of Stake like I ' m 5–hacker Noon
Delegated Proof of Stake (DPOS) vs Proof of work (POW)
DPOS Consensus algorithm-the Missing White Paper-steemit
Delegated Proof-of-stake Consensus-bitshares
Delegated Proof of Stake (DPOS) white Paper by Daniel Larimer
Explanation of DPOS+BFT
https://zhuanlan.zhihu.com/p/34107097