Ethereum 1.0 to 2.0 upgrade process


For Ethereum, 2019 will be an important year, because according to the plan, Ethereum 2.0 will set sail this year from the old world of pow to the new world of POS.

At the same time, Ethereum 1.0 will continue to exist and evolve. Ethereum 1.0 runs on the original main chain and Ethereum 2.0 runs on the beacon chain.

The planned voyage is estimated to take two years. Until 2021, after the fragment chain can achieve complete functions, 1.0 will hand over the actual operation right of Ethereum to 2.0, and it will withdraw from the main stage of history and exist as a fragment or a main storage contract of 2.0.

How does the beacon chain of Ethereum 2.0 work? How do eth (ether) holders “cross” from POW chain to beacon chain? And, cross or not? We will try to explore it in this article.

Let’s make a simple popular science: beacon chain is a brand-new POS blockchain. It is the core component of Ethereum 2.0, but not all of Ethereum 2.0. The following points may be the key to understanding beacon chain:

1. Beacon chain is a POS chain running Ethereum’s POS protocol Casper.

2. Ethereum 1.0 refers to the main chain of pow, but Ethereum 2.0 includes beacon chain, fragment chain and virtual machine layer. Its structure is shown in the following figure:

3. Beacon chain is the hub of Ethereum 2.0 and the first and most important component of Ethereum 2.0. As shown in the figure below, all partitions will connect and communicate with it, beacon

The chain provides security and final confirmation for the fragment chain.

Beacon chain mainly performs two functions: one is to implement the POS consensus, including maintaining the set of verifiers, selecting verifiers to form a committee, assigning verifiers to propose or prove blocks, and rewarding and punishing verifiers. It is the channel for the verifier to participate in the pledge system and obtain income according to the pledged rights and interests, and it is also the guarantee of the security of the whole system.

The second function is to realize slice communication. Each fragment will store the hash of its latest state on the beacon chain block. When the beacon chain block is completed, the corresponding fragment block is considered to be finally determined, and other fragments can confirm them and trade with them across fragments. The fragment chain and beacon chain realize cross fragment communication through “cross-linking”, so as to connect the whole system together.

4. Beacon chain has no virtual machine, no smart contract, and cannot process transactions; Beacon chain does not store the information stored on the current Ethereum blockchain. It only stores the verifier list and attendance. The so-called “attention” refers to the hash value confirmed and signed by the verifier. They record the state of a specific partition in real time.

5. Beacon chain and Poe chain of Ethereum 1.0 will run independently of each other for about two years. Before Ethereum 2.0 can achieve complete functions (currently expected in 2021), Ethereum is running on 1.0, and the blocks on the beacon chain have no practical significance.

The above is the basic situation of beacon chain. Why does beacon chain not officially run Ethereum until 2021? According to the development roadmap of Ethereum, Ethereum 2.0 can only support smart contracts and asset transfer to achieve availability this year.

After understanding the beacon chain, let’s briefly introduce the three stages of Ethereum 2.0 from now to 2021: stage 0, stage 2 and stage 2.

Phase 0 focuses on getting the validators on the beacon chain running. Users can deposit 32 Beths (beacon ETH) on the chain to become verifiers. However, at this stage, the verifier only manages the beacon chain, and there is no fragment chain at this time.

The beacon chain will keep the iterative design as simple as possible in the early stage, which does not support accounts, asset transfer and smart contracts. Beth can only be used by the verifier and cannot be transferred on the chain or transferred to the exchange.

In phase 1, the fragment chain component will be added to realize beacon chain + fragment chain. However, this stage is only the trial operation of the fragment structure, not the real expansion with fragment. Beacon chain regards the fragment chain block as a simple bit set without structure or meaning. The fragment chain still has no accounts, assets and smart contracts at this time.

Beacon chain will support 1024 fragment chains, and each chain will be verified by a committee composed of 128 verifiers. Beacon chain randomly selects the fragment verifier for each fragment in each cycle, and the fragment verifier proves the content and state of the fragment through “cross-linking”.

It should be noted that in phase 0 and phase 1, there is no data flow between Ethereum 1.0 and Ethereum 2.0, and Ethereum still operates in the pow chain.

Phase 2 will add the virtual machine layer, which is the last important component of Ethereum 2.0. Ethereum, which implements beacon chain + fragment chain + virtual machine layer, is a complete public chain system we are familiar with. The availability of Ethereum 2.0 will be officially realized at this stage.

At this time, smart contracts are introduced into the system, and assets can be transferred freely on the chain; The fragment chain has changed from a simple data marker to a fully functional blockchain, and the cross-linking operation supports cross fragment communication; Some of the most commonly used development tools may also be ported to Ethereum 2.0 to support evm2. Evm2 is a new virtual machine ewasm of Ethereum. It is based on web assembly and supports multiple programming languages to realize smart contracts.

Although Ethereum’s slicing technology roadmap includes a total of seven stages, after entering stage 2, Ethereum will migrate from POW chain to POS chain, and truly enter the era of 2.0 from the era of 1.0.

The new asset in Ethereum 2.0 is called Beth. There are two ways to generate it. One is from eth in Ethereum 1.0, and 1eth generates 1 Beth; The second is in Ethereum 2.0

In the pledge, Beth participates in stacking as a verification reward.

In phase 0, the user can deposit 32 Beths in the beacon chain to become the verifier. It can be understood as spending 32eth to buy a ticket and follow Ethereum to Ethereum 2.0

The new world. The question is, would you like to get on board?

Since Beth cannot be transferred and traded between accounts before phase 2, and Ethereum and its various applications are still running on the pow chain, the only reason why users will convert eth into Beth after beacon chain goes online is to use Beth to participate in stacking to obtain more Beth.

According to the previous data, the conversion between Eth and Beth is one-way, that is, Beth can only be generated with eth through contract, and Beth cannot be replaced with eth again.

One problem brought by this is that the price ceiling of a Beth is 1 eth. Beth will never be more valuable than eth, because 1eth also includes a conversion from eth to eth

Beth’s rights; At the same time, switching to Beth also means a two-year lock up period.

However, Ethereum founder vitalik buterin recently mentioned the possibility of two-way exchange between Eth and Beth in a discussion. Ethereum co-founder Joe Lubin also said in an interview recently that there may be a two-way mechanism. However, the two-way mechanism may bring a new problem: Beth issues additional shares through stacking, but eth cannot participate in such additional shares. Two way exchange is unfavorable to the assets on Ethereum 1.0 chain.

The above two different schemes will affect the motivation of users to transfer assets from eth to Beth, and may further affect the stability of Ethereum’s transition from 1.0 to 2.0. The problem of whether users are willing to transfer assets to beacon chain will become serious after the arrival of phase 2. The solutions adopted by Ethereum may be constantly adjusted and changed according to the situation in the past two years.

Since the conversion plan has not been determined, we might as well take a look at another decisive driving force for users to migrate assets: mortgage the benefits of Beth’s participation in stacking.

At least at the current stage, users cannot participate in the stacking of Ethereum 2.0 with any number of Beth by joining the equity pool. Users can obtain the verifier qualification only by pledging 32 Beth (2 ^ 5) on the beacon chain: users send 32eth to a registration contract on the current Ethereum POW main chain, and the contract will generate a “business card of verifier committee members”, Let users become the verifier of Ethereum 2.0.

The pledge return rate of Beth is shown in the table below. This is a proposal released by vitalik buterin on GitHub in April this year and has been added to Ethereum 2.0

In the specification:

If a total of 1 million Beths (2 ^ 20) are pledged, the system can issue up to 180000 Beths every year, and the maximum annual return rate of pledge is 18.1%; If 10 million Beths are pledged, a maximum of 570000 Beths can be issued each year, with a maximum annual return of 5.72%; The pledge ceiling is 134 million Beths (2 ^ 27). At this time, about 2.09 million Beths can be issued every year, the inflation rate remains below 2% and the rate of return is 1.56%.

Justin Drake, a researcher of Ethereum foundation, believes that the pledge of 30 million Beth (2 ^ 25) is the most conducive to the health of the system. At this time, the inflation rate is maintained at 1% and the return rate is

3.3%. Assuming that each segment consumes an average of 1000 Beth of gas per year, the inflation rate will drop to 0.5%, and the return of the pledgor will reach about 5% (Note: Drake)

It is estimated that Ethereum will be the best bet rate when it is officially running on 2.0).

Here are two indicators that can be used for comparison: one is the rate of return on Ethereum through financial products, and the other is the rate of return on tezos, cosmos and other stacking projects.

Another cost that the verifier needs to invest is the operating cost, but it seems to be within the acceptable range.

After digging into the relevant specifications of Ethereum 2.0 and talking with relevant researchers, ethhub founder Eric Conner estimated the annual operating cost of the verifier as: each beacon

The node needs us $120. For each additional verifier, that is, US $60 needs to be added for each additional 32 Beth pledge.

Therefore, from the perspective of rate of return, the motivation for users to convert eth to Beth before phase 2 may mainly depend on three factors: the number of Beth participating in stacking, the conversion mode between Eth and Beth, and the threshold of 32eth. (Note: This paper does not cover the influencing factor of currency price fluctuation)

However, no matter whether the “ticket” of 32eth is expensive or not, there are two types of users who may participate in Ethereum 2.0 at the first time. They provide support for the operation of Ethereum 2.0, even if Ethereum 2.0 has not been officially operated:

One kind of users are participants in blockchain ecology, especially those in Ethereum ecology. It is valuable to invest 32eth; One kind of users is the long-standing supporter of Ethereum. The “cost price” of 32eth in their hands may not be so high. At the same time, as users who will hold money for a long time in the future, they can get more Beth by participating in stacking with Beth.

Beacon chain is a POS consensus. If users lack the motivation to turn eth into Beth to participate in stacking, will it affect the security of Ethereum 2.0?

In fact, Ethereum 2.0 ensures its high security threshold through mechanism design.

The first is the punishment mechanism. If the verifier has malicious behavior, such as voting for two blocks at the same time, the pledged tokens will be confiscated.

If the Ethereum 2.0 consensus fails, it will mean that 1 / 3 of the active verifiers have violated the reduction conditions, that is, a successful attack is accompanied by the destruction of 1 / 3 of the total pledged tokens, which is the cost paid by the attacker – unlike pow, the “crime” under POS is to confiscate the “crime tools”.

The other is the block verification method of “verifier set Committee certifier” of beacon chain: active verifiers form the verifier set, a random sample set of the set forms the committee, and the certifier in the Committee verifies the block signature.

Even if more than one-third of the verifiers are dishonest, the probability of the Committee being controlled by dishonest verifiers (i.e. more than two-thirds of dishonest verifiers) is very low, and the probability of the Committee being controlled decreases rapidly with the increase of the number of committee verifiers.

Suppose we have 1000 verifiers, of which 333 are dishonest. When a committee is composed of one member, the probability that the committee is controlled by dishonest verifiers is 33.3%; When the committee consists of 13 members, the probability of being controlled is only 10%.

In the initial stage of Ethereum 2.0, the lower limit of the number of committee verifiers is 128. Even if dishonest people control 1 / 3 of the verifier concentration, the probability of successful attack is less than one trillion.

Under the effective mechanism design, the most important factor affecting the safe operation of Ethereum 2.0 is randomness. The implementation of many protocols in beacon chain is based on “random number”. Therefore, let’s briefly introduce the source of randomness in Ethereum 2.0.

Ethereum 2.0 solves the randomness problem through randao + VDF (verifiable delay function).

Randao is a way to generate random numbers. It will be built into the logic of beacon chain. Participants (here is the verifier) independently provide a random number. Randao adds these random numbers to get a new number and outputs the number as a random number.

But randao has one drawback: the last person to disclose random numbers can predict / manipulate the results of random numbers. Because he knows all the previous values, he can influence the final output by whether he produces random numbers or not. Therefore, we need to add VDF to randao.

VDF simply means that after entering a value, it takes a long time to get the result, but the result can be easily verified. VDF randao

The generated random number is used as a seed to generate a new random number, and the system uses the new random number provided by VDF.

Because the calculation time of VDF random number is long enough (in Ethereum 2.0, VDF is 102 minutes), the last person who discloses the random number cannot calculate the result within the time he provides the random number, It is impossible to influence the final random number through its own behavior (in Ethereum 2.0, randao completes the output of a random number every 6.4 minutes, which is also called an epoch).

Randao’s cycle is 6.4 minutes and VDF’s cycle is 102.4 minutes. Therefore, 16 vdfs in Ethereum 2.0 will run at the same time and generate a random number for the system every 6.4 minutes. Beacon chain will complete its work on this basis.

It should be noted that the random number problem on the blockchain is a difficult problem, and randao + VDF also needs to be further verified.

The test network of nimbus, an Ethereum 2.0 client, has been launched. It is called testnet0. It runs a beacon chain that can synchronize information between nodes, and nodes can be distributed on remote devices.

This version sets up 400 verifier nodes to maintain the operation of the network, of which 50 verification nodes are reserved for “brave explorers”, and anyone can join. Here is a tip: if you encounter problems, you can ask on the #status nimbus channel of status.

Prysm, the Ethereum 2.0 client developed by go, and lighthouse developed by rust are about to release the test network. If everything goes well, beacon chain, Ethereum 2.0 in phase 0, will be launched by the end of this year, just as planned in the roadmap.

Almost everyone respects and loves Ethereum, but people also talk about its “historical burden”. If Ethereum is a ship, it seems to be a heavy ship, difficult to coordinate and slow to move.

However, bulky ships also have their own advantages. They have more complete and safer infrastructure and more persistent and thorough distributed routes. If we take a long-term view, this kind of ship may be the one that can carry more ecology, undertake longer journey and finally reach the unknown continent.

Now the ship is about to set sail and the recruitment of seafarers is about to start. Would you like to come?

Special tips:

The specific implementation scheme of Ethereum 2.0 may be adjusted at any time. This article is for reference only. Please keep paying attention to the latest news.

Most of the following English articles are from medium, and most of the translations are from “Ethereum lovers”.

Reference article:

1. Ethereum 2.0: beacon chain, Bruno? kvorc

2. Eth2.0 engineering guide, James Prestwich

3. Detailed explanation of beacon chain of Ethereum 2.0 protocol, Ben Edgington

4. Is the Ethereum POS pledge proposal proposed by V God reasonable, Qin Xiaofeng

5. How to understand the economic incentive of Ethereum 2.0, Eric Conner

6. Design objectives of Ethereum 2.0, Ben Edgington

7. Analysis on upgrading of Ethereum, xinbit bitpoa

8. Ethereum 2.0: randomness, Bruno skvorc