Consensus agreement is one of the most important parts of the current blockchain network, and many consensus protocols such as PoS and DPoS have been derived from the earliest PoW. However, the problem facing the current industry is that the continuous improvement of technology and the improvement of user demand will require certain improvements in the blockchain consensus agreement, but this is often quite difficult. Ethereum is the most typical case. In this case, how to design a self-adjusting consensus agreement is becoming an inherent requirement of the industry.
Recently, Nervos community manager Ryan Chen talked about the topic to the chain catcher, elaborated on the characteristics of the consensus agreement and industry progress, and proposed a possible solution for self-adjustment of the consensus agreement, hoping to inspire everyone.
The new infrastructure has emerged with new technologies, and the desires brought about by new technologies have spawned the self-denial of technology. The original infrastructure was abandoned because it could no longer satisfy the desires, and the change was achieved with the joint promotion of new technologies and desires.
Human beings themselves evolve in an environment of constant iteration, constantly adapting to new technologies and mastering new skills. If they cannot learn and grow, they will naturally be eliminated. The technology itself is also, if the technology can not keep up with the pace of development of the times, the technology itself will be surpassed and eliminated.
- Hong Kong's first trial virtual bank, Zhongan Bank, struck, using core technologies such as blockchain
- Interview | Kevin Kelly: Blockchain is a great tool, but it doesn't necessarily change the world
- I regret to miss Google’s Buffett and intend to get involved in the blockchain.
- Babbitt exclusive A-share blockchain concept stocks, the fastest growth rate of these 10
- Viewpoint | Bringing into play the role of blockchain technology will promote the modernization of social governance
- The new generation is about to open, and why is the blockchain a blockchain?
The public chain and the ecology formed around the public chain are like a social system. In many cases, the whole society does not want to move forward quickly. Instead, it needs a conservative approach. Stability and safety are the first priority. Try to minimize the change. Adaptation of new situations.
We must acknowledge that the blockchain is hardware-like software. Looking back at the long history of this technology, we have clearly felt its weakness: every fork is an impact on the entire community. For example, Ethereum has experienced three forks since 2015:
• Homestead forked and passed 3 EIPs;
• Byzantium forks, passing 8 EIPs;
• Constantinople splits and passes 5 EIPs.
There are thousands of EIPs in discussion on GitHub.
Every fork is a difficult choice in thousands of needs, find the most necessary needs to make improvements, and conduct large-scale discussions in the community. The core developers of Ethereum should understand the current situation of the smart contract platform, investigate the needs of developers, and evaluate the impact of each protocol improvement on Ethereum itself; and in an open source system, there will be many improvements for each improvement. safe question.
As the latest Constantinople forks, the improvement of the SSTORE directive was discovered by the ChainSecurity team at the last minute. It was a reentrant vulnerability that would not have occurred but was related to other code. For such a large open source ecosystem, after constantly weighing the pros and cons of the upgrade, you have to repeatedly test the test network before the upgrade to ensure security, to ensure that any instructions will not have other consequences due to this modification of the code.
However, the reality is that technology is constantly improving. There will be new hardware facilities and software technologies, and there will be new demands, which will require certain improvements in the blockchain agreement. The most ideal way is that the blockchain can be sufficiently low-level, flexible enough, and simple enough to avoid excessive changes when possible.
Is the agreement self-adjusting?
If the protocol can automatically adapt to changes in the environment and have some kind of self-evolutionary ability, can it be greatly improved? Among them, the design of consensus is related to network and computing power, which is a key part.
Bitcoin is the longest-running blockchain that has been in operation for ten years, and the bandwidth levels have changed dramatically a decade ago and ten years later.
As indicated by the study in the figure above, the bitcoin IPv4 node linked to the network had a median bandwidth of 33 Mbit/s in 2016 and in February 2017 this figure reached 56 Mbit/s. The maximum throughput of Bitcoin has not changed much so far.
Is there a ability to allow consensus algorithms to adjust their throughput based on the environment without having to upgrade by forking? There are two rules here that we need to understand, although the law is a summary of history, but to some extent we can use these laws to predict the future.
1) Moore's Law Moore's Law: That is, the performance of integrated circuits doubles 18-24 months. Similarly, the memory follows the same rules. There is also a statement that the annual growth rate is 60%.
2) Nielsen's Law: This is a law related to the level of bandwidth, which roughly means that the user's bandwidth increases by 50% per year. The rate of increase in bandwidth is about 10% slower than the 50% annual rate of increase in Moore's Law.
Image from: Nielsen Norman Group
The above figure is the curve of the bandwidth from 1983 to 2018. Note that the vertical axis is Log10, so we can also see that the increase in bandwidth is also exponential.
In the analysis of the Nervos Consensus Researcher, Dr. Tough, we know that one criterion for measuring blockchain consensus protocols is bandwidth utilization. Bandwidth improvement is an increase in the level of communication between nodes, which means that the consensus will be more efficient.
The consensus agreement is written from the beginning, and if it needs to be modified, it must be forked. If Bitcoin and Ethereum need to improve their throughput according to the network conditions, developers need to estimate the network situation, weigh the efficiency and security, and then upgrade the protocol with a conservative solution.
Upgrading is another painful thing. The best case is to design a consensus mechanism that can adapt to the changes brought about by bandwidth growth based on the increase in bandwidth level.
How to design a consensus agreement that can be self-adjusting?
Then we need to think about whether there is a metric that the blockchain can perceive, and this indicator can reflect the current network situation. According to this indicator protocol, can I dynamically adjust my throughput?
In the study of the PoW consensus protocol, a very important concept is the lone block.
Baidu Encyclopedia is defined as: In the Bitcoin protocol, the longest chain is considered to be absolutely correct. If a block is not part of the longest chain, it is called a "lone block." An isolated block is a block, it is also legal, but found later, or the network transmission is slightly slower, and does not become part of the longest chain. In Bitcoin, the lone block has no meaning and will be abandoned. It is found that the lone miner also does not receive mining-related rewards.
In the case of Bitcoin, a miner in China was fortunate enough to dig up the block 9 minutes after the block was released, and he was happy to start broadcasting the block. But this block took a few tens of seconds or did not broadcast to the US miners. Ten minutes later, the miners in the United States discovered the same height block and began broadcasting.
As the two blocks are broadcasted through the P2P protocol of Bitcoin, you will find two blocks of the same height in the network. At this time, the competition is supported by the whole network computing power, and some of the computing powers recognize North America. The miners' blocks are mined according to the chain in which the block is located, and the other is mined on the chain of Chinese miners, which is the result of a fork.
In the subsequent competition of several blocks, the miners of both camps must have a block right to become the longest chain, and then according to the longest chain principle, only one longest chain can be accepted by all miners. cross. The block above the other abandoned chain is a lone block.
The lone block is the delay caused by the bandwidth limitation. The miners do not receive the new block and they compete in the block, and this competition will inevitably bring losses to one miner. And the short fork is actually damaging the security of the network, which is what we should avoid. If we can assume that the bandwidth is infinitely good and the blocks can be broadcasted seamlessly in an instant, then there will be no such competition, no one will lose, and there will be no security problems.
The lone block is perceived by the blockchain. We can use the lone block rate of the whole network as an indicator to evaluate the current network bandwidth. When the lone block rate is low, the network condition is good, there is not too much competition for the block. When the time is high, the network condition is too bad. It is necessary to increase the block difficulty and increase the block interval to avoid intensive block-out competition. Therefore, a reasonable lone block rate is set as an indicator. According to the current lone block rate, it is a good choice to dynamically adjust the block difficulty based on the evaluation of the network condition.
Bandwidth utilization is an important indicator for assessing the efficiency of consensus. When the lone block rate is low, this means that the network is in good condition and can carry more throughput. Therefore, at this time, it is possible to reduce the difficulty of the block, reduce the block interval, improve the throughput, and make better use of the network bandwidth.
When the lone block rate is high, it means that the network situation is relatively poor. At this time, the difficulty of the block can be improved, the block interval is increased, and the throughput is reduced.
In this way, by setting the block rate to adjust the throughput, as the bandwidth level increases in the future, the protocol can also improve the throughput according to the optimization of the network condition to adapt to future development and changes, and fully utilize the network while ensuring certain security. bandwidth.
In the design of Dr. Zhang Ren, this design idea was adopted.
In his design, the block interval is adjusted according to the lone block rate in the network (the information of the lone block will be packed into the block for statistics and calculation) in each difficulty cycle. The design of this consensus agreement was modified on the basis of Bitcoin Nakamoto Consensus (the Nakamoto consensus) to improve the throughput of the network without losing security – we call this consensus algorithm NC-Max, we hope It is able to break through the throughput limit of the Nakamoto Consensus.
Of course, careful readers may think of two questions:
1) How is the block reward calculated?
The block interval is changing, and the block reward is actually changing. However, in a difficulty adjustment cycle, the total block reward remains unchanged.
2) Is there a storage problem after the throughput is increased? The transaction speed is increased and the storage requirements generated by the transaction will increase.
Coincidentally, according to Moore's Law and Nielsen's Law mentioned earlier, the bandwidth growth rate is slightly slower than the storage level. Therefore, while the bandwidth is increased and the throughput is improved, the computing power and storage capacity will continue to keep up with and even surpass. There is no need for a stronger supercomputer due to the high computing power of the TPS, and the loss of decentralization.
In addition, in the NC-Max design, in addition to dynamically adjusting the block spacing and block rewards to improve bandwidth utilization, there are two design highlights:
1) Use two-step transaction confirmation to reduce the lone block rate: the transaction will first submit the transaction number (number is the hash value of the complete transaction, and the transaction one-to-one correspondence) to reach a consensus in the transaction proposal area of the block, and then only after the proposal The transaction can be sent completely, which can reduce the lone block rate to a certain extent;
2) Consider all the blocks in the cycle, including the lone blocks, during the difficulty adjustment to defend against "selfish mining" attacks.
In general, the self-adjustment of the consensus agreement will be more and more concerned by the industry, and its solutions will be more and more, I will continue to pay attention and share with you.
Author: Ryan Chen
Source: Chain Catcher
Unauthorized, declined to reprint