
Analyst | Li Xueting
Editor | Hao Fangzhou
Editor's note: less than 10 hours away(countdown here),Ethereum will activate the Constantinople/St. Petersburg network upgrade at block height 7,080,000. This upgrade is undoubtedly the most concerned event in the blockchain world recently. It not only affects the huge interests behind the digital currency market, but also another milestone in the exploration of public chain technology. Ethereum, which has led the blockchain into the "2.0 era" and has "walked a long way", will further transition from the PoW consensus mechanism to the PoS consensus mechanism through this fork. Odaily Research Institute hopesFrom the perspective of the consensus mechanism, I will take you back to the history, summarize the evolution of the consensus layer, focus on comparing the mainstream PoW and POS variants (or PoS+), and explain why we think the "POS+" hybrid consensus mechanism will be A way out for the later development of the public chain。
Blockchain is a decentralized distributed ledger system. Due to the high network delay under the peer-to-peer network, the sequence of transactions observed by each node cannot be completely consistent. Therefore, the blockchain system needs to design a mechanism for consensus on the sequence of transactions that occur within a certain period of time. This algorithm for reaching a consensus on the sequence of transactions within a time window is called a "consensus mechanism". The consensus mechanism solves the problem of mutual trust between nodes on the idea of decentralization, so that the blockchain can complete the value transfer at the same time in the process of information transmission.
However, in a decentralized system, it is not easy to reach a consensus algorithm. Satoshi Nakamoto proposed a consensus mechanism based on PoW (Proof of Work), which can be said to be the most secure and reliable public chain consensus algorithm so far. Later, the PoS (Proof of Stake, Proof of Stake) mechanism appeared one after another, and some variants of the PoS mechanism, such as the DPoS (Delegated Proof of Stake, Delegated Proof of Stake) mechanism. These consensus mechanisms have their own advantages, but they have also been proven to have their shortcomings.
Because of this, in the blockchain field, people have never stopped exploring and innovating on better consensus mechanisms, as shown in the figure below.
PoW issues highlighted
PoW (Proof of Work) is a model of distribution according to work, that is, miners rely on the size of their workload to fight for the right to bookkeeping. The greater the workload, the greater the computing power of the miners, and the higher the probability that the miners will obtain the right to bookkeeping. big.
secondary title
1. Waste of resources
The PoW consensus process is highly dependent on the computing power contributed by the blockchain network nodes. These computing power are mainly used to solve SHA256 hash and random number search, and do not actually generate any effective social value. With the increasing popularity of encrypted digital currency and the emergence of professional mining equipment, the encrypted digital currency ecosystem has shown an obvious "arms race" situation in terms of capital and equipment, and has gradually become a capital-intensive industry with high energy consumption, which further highlights the Resource consumption issues. according toDigiconomistThe data shows that if Bitcoin and Ethereum are considered as a country, the total power consumption of its mining has surpassed Algeria, Israel, Greece and other countries, ranking 45th in the world.
secondary title
2. Concentration of computing power
according to
according tobtc.comsecondary title
3. Lack of "eventual consistency"
secondary title
4. Low business processing performance
first level title
The Proposal of PoS and the Practice of Peercoin
The gradual prominence of the PoW problem has caused people to question and think about this mechanism. PoS is here.
The proposal of the PoS consensus mechanism originated from the debate on the "tragedy of the commons" in mining. The "tragedy of the commons" was proposed by Professor Garrett Hardin in the article "The tragedy of the commons" in 1968. He pointed out that the commons, as a resource, has many users, and each user knows that the resource will be overused and exhausted, but has no right to prevent others from using it. The result is that everyone tends to overuse and exacerbates the situation. .
In November 2010, the mining commons tragedy (Disturbingly low future difficulty equilibrium) was pointed out by Vandroiy and was widely discussed. The focus of the discussion is that the Bitcoin system needs to consume a lot of computing power to maintain the security and stability of the system. However, as Bitcoins continue to be dug out, the block rewards will decrease, and more and more nodes will withdraw from the system. The cost will decrease accordingly, and the Bitcoin network system will experience a "tragedy of the commons".
In July 2011, digital currency enthusiasts Quantum Mechanic The concept of PoS equity proof consensus mechanism was first proposed in the Bitcoin forum (Proof of stake instead of proof of work). The concept of proof-of-stake consensus mechanism has been favored by many people since it appeared. People realized that Proof of Stake could be the solution to mining's "tragedy of the commons".
Different from PoW physical mining, PoS consensus is to virtualize the entire mining process and replace miners with verifiers.
Its operation process is as follows:
Validators must lock up some tokens they own as a security deposit.
After this, they will start validating blocks. At the same time, when they find a block that they think can be added to the chain, they will verify it by placing a stake.
If the block is successfully uploaded to the chain, validators will receive a reward proportional to their stake.
In August 2012, Sunny King released Peercoin (PPC), and PoS was first practiced. In PoS, the node with the highest equity rather than the highest computing power in the system obtains the bookkeeping right. The equity is reflected in the node's ownership of a specific amount of currency, which is called the coin age or coin days (Coin days). Dotcoin combines PoW and PoS consensus algorithms. In the early stage, PoW mining method is used to distribute Token to miners. Later, as the difficulty of mining increases, the system is mainly maintained by PoS consensus algorithm. However, in the later stage of PoS, investors can hoard and monopolize Peercoin through their capital, which reduces the circulation of Peercoin.
For example: Each coin generates 1 coin age per day. For example, if you hold 100 coins for a total of 30 days, then your coin age at this time is 3000. When a new block is generated, other nodes that want to obtain bookkeeping rights also need to calculate the hash value, and the difficulty of obtaining the hash value that satisfies the conditions is related to the difficulty value. The difficulty value is inversely proportional to the currency age, that is The greater your coin age, the greater the probability of obtaining a qualified hash value. At the same time, your coin age is emptied, and the system will give you the corresponding "interest" after accounting. Every time you are emptied of 365 coin age, you will get The interest is: 3000 * interest rate / 365, and the interest rate of Peercoin is 1%, which is 0.08 coins.
After that, PoS derived more variants, and each variant often involves changes in the economic model of blockchain tokens. For example, ReddCoin, Slimcoin, etc. have all promoted the development of PoS, and at the forefront of PoS research areEthereum (Casper), Cardano (Ouroboros), Fractalfirst level title
PoS is not a perfect alternative
Objectively speaking, the birth of the PoS mechanism does solve some of the disadvantages of PoW:
1. Developing new blocks with the PoS mechanism avoids waste of resources to a certain extent, and at the same time, the automatic output of system blocks alleviates the deflation caused by the limited digital resources.
2. Under the PoW mechanism, mining pools increase production through economies of scale and reduce long-term average costs. However, the PoS consensus mechanism has weakened the demand for economies of scale in the central mining pool, and the situation of centralized monopoly of computing power has also been alleviated, and the difference in individual competitiveness has been relatively reduced.
3. As far as the 51% attack is concerned, the cost of launching a one-hour attack by the PoS consensus mechanism is much higher than that of the PoW consensus mechanism.
Taking Bitcoin as an example, the current circulating supply of Bitcoin is 17,551,500 BTC. If the consensus algorithm is PoS, then a 51% attack on it requires holding 8,775,750 BTC, which is equivalent to a market value of 34,906,510,958 US dollars. Only about $242,051. The cost of 51% attack on PoS for other digital currencies and the cost of 51% attack on PoW for 1 hour are shown in Table 1 above.
So is the PoS consensus mechanism perfect? The answer is no.
First, PoS itself is more difficult to implement.
1) The issue of Token issuance. In the beginning, only tokens were found in the genesis block, and only by distributing token mining rights can the network grow. However, in the current environment where ICOs are banned in many countries, it has become a difficult problem to disperse Token in a compliant and balanced manner.
2) It is difficult to determine the number of bookkeeping nodes. Most PoS relies on the PBFT algorithm, but PBFT needs to determine the number of nodes in order to elect block producers. Under the PoS mechanism, nodes can participate in or withdraw from mining at any time, so the consequence of no threshold is that the total number of elections cannot be determined, and the pass rate of 1/2 or 2/3 cannot be measured. Not only that, but the uncertainty of accounting nodes will also increase the probability of network partition, which will lead to forks.
In addition, a PoS system requires a highly secure network to resist various types of hacker attacks. At present, no public chain has been proven to have such strength. Even Ethereum often has hacker attacks.
Second, passive evolution is the result of unexpected centralization. For a public chain using the PoW consensus mechanism (mining algorithm against ASIC mining machines), its block generation and security mainly depend on the dispersion of computing power. Anyone who has a graphics card and a network can become a miner, which lowers the threshold for users to use, promotes more people to participate in mining, and realizes the early dispersion of computing power. As long as more than 51% of the computing power comes from honest miners, blockchain transactions are relatively safe and irreversible.
However, for a public chain using the PoS consensus mechanism, at the beginning of the mainnet launch, most of the Tokens allocated in the genesis block belong to a limited number of project parties and private investors. The right to generate blocks in the blockchain can only be determined by these players. If these people conspire to attack the blockchain, a double spending attack (Double spending attack) can be successfully implemented. Although the interests of developers and investors are fully reflected in the value of Token, they will not participate in malicious actions out of interest, but the PoS public chain will inevitably be monopolized and dominated by these people after the mainnet goes live. To make matters worse, if the blocks can get a lot of rewards and transaction fees, these monopolies will firmly control a large amount of equity in their own hands, making the PoS public chain a network that is essentially controlled by giants.
Third, the Nothing at Stake problem. In the PoW mechanism, when a fork occurs in the blockchain, miners must choose a direction for mining. Under the PoS mechanism, PoS miners tend to dig in both directions in order to maximize their benefits. Because forking does not consume any resources. Miners can mine on the longest chain while creating a fork that only mines on their own blocks. In addition, other verifiers are also willing to accept the fork. He can "mine" on the two chains at the same time, because there is no loss in "mining" on it. On the contrary, if he does not "mine" on it, in case this If a chain is accepted, it will suffer losses, so even an honest verifier will tend to "mine" on all chains at the same time. Although they know that this attempt will reduce the value of the entire Token, they have very little money and they don't care. This is the so-called Tragedy of the Commons.
first level title
PoW+PoS hybrid mechanism is closer to ideal
Almost all consensus mechanisms have their unique advantages, but they also have their disadvantages. No consensus mechanism can perfectly solve the blockchain "impossible triangle" problem. Therefore, people began to think whether it is possible to mix the two consensuses, so as to combine the advantages of the two consensuses and avoid some disadvantages? So there is a "hybrid consensus". In the "hybrid consensus", the PoW+PoS hybrid mechanism is one of the most popular and successful consensus algorithms.
In April 2014, Larry Ren ( Larry Ren ) proposed a stake-proof of speed (Proof of Stake Velocity,PoSV) consensus mechanism. The PoSV algorithm uses PoW to realize token distribution in the early stage, and uses PoSV to maintain long-term network security in the later stage. PoSV modifies the linear function of currency age and time in PoS to an exponential decay function, that is, the growth rate of currency age decreases with time and finally tends to zero. Therefore, the coin age of new coins grows faster than that of old coins until it reaches the upper threshold, which alleviates the phenomenon of coin holders hoarding coins to a certain extent.
Slimcoin issued in May 2014 proposes a proof-of-burn based on PoW and PoS ( Proof of Burn,PoB) consensus mechanism. Among them, the PoW consensus is used to generate the initial supply of tokens. As time grows, when the blockchain network accumulates enough tokens, the system will rely on the PoB and PoS consensus to jointly maintain. The characteristic of the PoB consensus is that miners compete for the accounting rights of new blocks by sending their Slimcoin to a specific irretrievable address (burning). The more coins burned, the higher the probability of digging a new block.
Proof of Action presented in December 2014 ( Proof of Activity,PoA ) consensus is also based on PoW + PoS, in which some of the tokens mined by PoW are distributed to all active nodes in a lottery, and the rights and interests owned by the nodes are proportional to the number of lottery tickets, that is, the probability of winning.
Casper, proposed in 2015, is the consensus algorithm that Ethereum plans to adopt in the fourth phase of its roadmap called Serenity, which is still in the design, discussion and improvement stage. There are currently two versions of Casper, namely Casper Friendly Finality Gadget (CFFG) led by Vitalik Buterin and Casper the Friendly Ghost (CBC) led by Vlad Zamjir.
Casper FFG is a hybrid PoW+PoS consensus mechanism. It is designed to buffer the proof-of-stake transition process. The way it is designed, a proof-of-stake protocol is superimposed on the normal Ethereum version of the proof-of-work protocol. While blocks will still be mined via proof-of-work, every 50th block there will be a proof-of-stake checkpoint (PoS block), which is where validators in the network evaluate finality. There is an estimated safety oracle in the Casper CBC protocol. Under the exception of setting a reasonable estimate of the error, it lists all errors that may occur in the future. Within a given interval, its correctness is determined by its construction process to guarantee.
Casper FFG is a PoW + PoS consensus, while Casper CBC is a clear PoS consensus. At the same time, the two main principles of PoS consensus are chain-based PoS and Byzantine fault-tolerant PoS. CBC is a chain-based PoS design, while CFFG is a combination of the two.
The difference between Casper and other PoS consensus is: Casper implements a process that makes it punish all malicious factors.
Validators stake a percentage of the ether they own as a security deposit.
Then, they will start validating blocks. That is, when they find a block that they believe can be added to the chain, they will verify it by placing a bet.
If the block is added to the chain, then validators will get a reward proportional to their stake.
However, if a validator acts in a malicious manner and tries to do "nothing at stake", they will be punished immediately and all their stake will be cut off.
In fact, the reason why Ethereum changed from PoW to PoS is due to various considerations. There are performance pressures, real threats to computing power, and challenges from competition from other public chains. But all in all, the current path proposed by Ethereum to "transition to PoW+PoS first, and then completely abandon PoW" is also an innovation of the consensus mechanism.
But the reality is that this path is relatively slow to implement. This is because Ethereum is a huge community. Changing the consensus mechanism makes the interests of the miners who act as producers in the community inconsistent. However, in the Ethereum of the PoW mechanism, the miners are the decision makers of the blockchain, and the direct transition from PoW to PoS is bound to be tough.
In short, the upgrade of Ethereum is not a technical issue, but a difficulty in reaching a consensus in the community. If a direct upgrade is made for a hard fork, it may cause a split in the community, and most of the ecology on Ethereum will also split.
Why not convert directly to PoS? Vitalik Burterin's answer is succinct and direct:
"The change from the PoW mechanism to the PoW+PoS transaction hybrid mechanism is very small, it can be faster and safer, and it is more beneficial to users in comparison. Because we want to avoid the danger brought about by the mechanism change, wait until the entire Only after the system is more secure can we make greater investment.”
The Ouroboros consensus proposed by Cardano in August 2017 is a blockchain protocol based on PoS and has strict security guarantees. It is characterized by the use of a new reward mechanism to drive the PoS consensus process, so that the behavior of honest nodes constitutes an approximate Nash equilibrium , used to effectively defend against security attacks caused by strategic behavior of miners, such as block interception and selfish mining.
references:
references:
1. Yuan Yong, Ni Xiaochun, Zeng Shuai, Wang Feiyue. Development Status and Prospect of Blockchain Consensus Algorithms [J]. Acta Automatica Sinica, 2018,44(11):2011-2022.
2. What is the Ethereum Casper protocol? https://ethfans.org/posts/ethereum-casper
3. Why can PoS avoid 51% attacks better than PoW? https://www.odaily.com/post/5135670
Recommended reading:
5. 20 Proof of Stake [Online], available: https://en.bitcoin.it/wiki/Proof of Stake, April 11, 2018
6. Schwartz D, Youngs N, Britto A. The Ripple protocol consensus algorithm [Online], available: https://ripple.com/flles/ripple consensus whitepaper.pdf, April 10, 2018
7. Bitshares. Delegated Proof of Stake [Online], available: http://docs.bitshares.org/bitshares/dpos.html, April 10, 2018
8. Lamport L. Paxos made simple. ACM Sigact News, 2001, 32(4): 18¡25
9. Ren L. Proof of stake velocity: Building the social currency of the digital age [Online], available: https://assets.coss.io/documents/whitepapers/reddcoin.pdf, April 10, 2018
10. Proof of burn [Online], available: https://en.bitcoin.it/wiki/Proof of burn, April 10,2018
11. Bentov I, Lee C, Mizrahi A, Rosenfeld M. Proof of activity: Extending bitcoins proof of work via proof of stake [Online], available: http://eprint.iacr.org/2014/452, April 10, 2018
12. Duong T, Fan L, Zhou H S. 2-hop blockchain: Combining proof-of-work and proof-of-stake securely [Online], available: https://eprint. iacr. org/2016/716, April 10, 2018
13. Kwon J. Tendermint: Consensus without mining [Online], available: https://tendermint.com/static/docs/tendermint.pdf, April 10, 2018
14. Blog E. Introducing Casper “ the Friendly Ghost" [Online], available: https://blog.ethereum.org/2015/08/01/introducing-casper-friendlyghost/, April 10, 2018
15. David B, Ga ˇ zi P, Kiayias A, Russell A. Ouroboros praos: An adaptively-secure, semi-synchronous proof-of-stake protocol [Online], available: http://eprint.iacr.org/2017/573, April 10, 2018
16. Goodman L M. Tezos-a self-amending crypto-ledger [Online], available:
17. https://www.tezos.com/static/papers/position paper.pdf, April 10, 2018
18. Miller A, Xia Y, Croman K, Shi E,Song D. The honey badger of bft protocols. In: Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security. Xi’an, China: ACM, 2016. 31¡42
19. Zamflr V. Introducing Casper“the Friendly Ghost”[Online], available: https://blog.ethereum.org/2015/08/01/introducingcasper-friendly-ghost, April 10, 2018
Recommended reading:
Ethereum Constantinople fork, everything you want to know is here