BTC
ETH
HTX
SOL
BNB
View Market
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt

Opinion: Ethereum 2.0 technology sharing

BlockMania
特邀专栏作者
This article is about 6412 words, reading the full article takes about 10 minutes
Since the end of 2013, Vitalik Buterin, the founder of Ethereum, released the first version of the white paper of Ethereum and started the project. It has been 6 years without knowing it.
AI Summary
Expand
Since the end of 2013, Vitalik Buterin, the founder of Ethereum, released the first version of the white paper of Ethereum and started the project. It has been 6 years without knowing it.

At 20:00 on January 11, the 41st BlockMania AMA live broadcast and the 3rd BlockMania "201 Technology AMA" will continue. The theme of this issue is "Ethereum 2.0 Technology Sharing". This event is hosted by the famous technology community Comunion, BlockMania The co-organizer and the sharing guest are Wang Xin, the author of "In-depth Understanding of Ethereum" and technical director of Starlink Technology.

secondary title

01 The development path of Ethereum

This is a roadmap of Ethereum in 2019. We can see that since the end of 2013, the founder of Ethereum, Vitalik Buterin, released the white paper of the first version of Ethereum and started the project. It has been 6 years without knowing it.

From July 24, 2014, Ethereum conducted a 42-day pre-sale of ether. By September, Ethereum had raised a total of 31,531 bitcoins through the pre-sale. According to the price of bitcoin at that time, Ethereum had successfully raised more than $18 million. According to CoinTelegraph’s report, Ethereum “as one of the most successful crowdfunding projects One, it will go down in the history books."

On July 30, 2015, the Ethereum Frontier network was released. Developers began to develop decentralized applications on the Frontier network, and miners began to join the network to mine. The miners themselves get token rewards through mining, on the other hand, it also improves the computing power of the entire network and reduces the risk of being attacked by hackers.

Frontier is the first milestone in the development of Ethereum. Although it is positioned as a beta version in the minds of developers, its performance in terms of stability and performance has far exceeded anyone's expectations, thereby attracting more developers. Those who join the ranks of building the Ethereum ecosystem.

On March 14, 2016 (π day), the second major version of the Ethereum platform, Homestead, was released to the public, and it was also the first official version released by Ethereum.

On September 18, 2017, the Ethereum development team began testing the first phase of the "Metropolis" (Metropolis) version: the Byzantine fork. On October 16, 2017, the mainnet successfully completed the Byzantine fork at block 4,370,000.

This hard fork will provide flexible parameters for developers of smart contracts; at the same time, preparations will be made for the introduction of technologies such as zkSnarks zero-knowledge proof for the later Metropolis upgrade; delay detonation of the difficulty bomb, delaying the ice age by one year; mining difficulty Therefore, the transaction speed of the Ethereum platform will be significantly improved, and the corresponding miners' mining income will be reduced from 5 ETH per block to 3 ETH.

In June 2019, the "Constantinople" hard fork was completed at block 7,080,000, and the upgrade included five improvements:

1) Introduce a fairer pricing method for changes to data storage;

2) Benefit smart contract developers;

3) Better promotion of specific scalability solutions based on state channels and off-chain transactions;

4) as more things are transferred to the second layer;

5) Reducing block mining rewards from 3 ETH to 2 ETH, and delaying Ethereum's difficulty bomb for 12 months.

Just last month, Ethereum officially completed the "Istanbul" fork, including six Ethereum Improvement Proposals (EIPs), the main problems to be solved are: denial of service (DDoS) attack resilience, reducing Gas costs, increasing zcash-based Equihash Proof of Work.

We see that Ethereum, as a representative of blockchain 2.0 technology, continues to develop and innovate, and has become one of the best star projects in the industry.

secondary title

02 Ethereum core technology

Back to the technical level, we can see that the technical architecture of Ethereum is also a layered architecture. From top to bottom, it is the application layer, the contract layer, and the protocol layer. The protocol layer includes basic components such as EVM virtual machine, block management, KV database, consensus algorithm, and P2P network.

Among them, smart contracts are the core technology of Ethereum. Its implementation is based on the EVM virtual machine inside Ethereum. Smart contracts can complete any code logic to support diversified business processes. Solidity language is used to write smart contracts in Ethereum.

Smart contracts build the rich DApp ecology of Ethereum, making the blockchain more practical, more able to integrate with all walks of life, and more convenient to combine with technologies such as the Internet of Things, big data, artificial intelligence, and cloud computing.

secondary title

03 Enterprise Ethereum

Everyone knows that Ethereum is a public chain project, so what does it have to do with our daily life and our developers?

How can we make good use of the technical resources of Ethereum, use them in our own projects, or make some innovations in traditional industries? This has always been the biggest problem plaguing industry practitioners.

At present, the most successful applications may still be around the financial ecology of digital assets, such as exchanges. But outside of asset transactions, people's exploration has never stopped.

As early as 2017, the Enterprise Ethereum Alliance was established by more than 20 of the world's top financial institutions and technology companies, including JPMorgan Chase, Chicago Exchange Group, Bank of New York Mellon, Thomson Reuters, Microsoft, Intel, and Accenture.

secondary title

04 Direction of technical improvement

I also had some exchanges with the enterprise Ethereum EEA in 2017, and participated in the conference call they organized. However, since the alliance is a loose organization and lacks clear development goals and cooperation mechanisms, there has been no substantial progress until today.

In their own words, there are too many politics in the organization. In fact, this alliance is still based on the contribution of JPMorgan Chase. They launched the Quorum technical framework, which is a relatively good prototype of Ethereum in enterprise applications.

The BaaS platform of Ant Blockchain and Microsoft Cloud both support the Quorum framework.

Well, now the blockchain technology has also encountered a bottleneck, which is why the concept of Ethereum 2.0 was proposed.

secondary title

05 Ethereum 2.0

stage 0

stage 0

stage 1

stage 1

stage 2

stage 2

Supports the execution engine to implement the transaction and account model of the entire space. The execution engine minimizes the complexity of the system.

It is not known whether more follow-up stages will be launched. While researchers would like to see more development plans for Eth2.0 shard chains, this is still in the early stages of development.

This is the layered framework of Ethereum 2.0, the main change is the addition of Beacon Chain and Shard Chain. Shard is translated into shards, similar to a distributed operating system, transactions in different shards can be processed in parallel.

After a period of open discussion, Ethereum's 2.0 technology has gradually begun to converge: the number of shards has been reduced from 1024 to 64, and the block size of shards has increased from (target value 16, upper limit value 64) kB to (target value 128 , the upper limit value is 512) kB. The total fragmentation capacity is 1.3-2.7 MB/s, depending on the slot time.

The number of shards and block size can be increased over time if needed, say 10 years later to eventually reach 1024 shards, and 1 MB blocks.

A number of simplifications are implemented at the L1 and L2 layers:

1) Less shard chain logic is required;

2) Because "native" cross-shard communication can be completed within 1 time slot, there is no need to accelerate cross-shard communication through Layer-2;

3) There is no need to facilitate the payment of cross-shard transaction fees through decentralized exchanges;

4) The execution environment can be further simplified;

5) No need to mix serialization and hashing anymore.

Of course, this also introduces some problems:

1) The overhead of the beacon chain is greater;

2) The generation time of shard blocks is longer;

3) The demand for "burst" bandwidth is higher, but the demand for "average" bandwidth is lower.

TPS has always been an important bottleneck for blockchain attention. We know that both Bitcoin and Ethereum have adopted the PoW consensus algorithm, and the TPS is only about 10.

Recently, the zk-rollup technology was introduced in the research of Ethereum 2.0, which can theoretically increase the transaction to 3000TPS.

It is close to the performance of the centralized system. As we all know, the current average TPS of the Visa network is 2000.

This is a theoretical performance comparison of Ethereum using zk-rollup technology

Each batch (a batch is a zkRollup block) contains 2048 (simple Ethereum) transactions and a zk proof. However, due to the implementation of two proposals, EIP 1108 and EIP 2028, the gas cost for both transactions and proofs has now changed: 8.125 bytes per transaction.

Currently, each transaction only costs 16 gas/byte, so the gas cost per transaction is 8.125*16=130 gas. Since there are 2048 transactions per batch, the transaction cost per batch is 130 * 2048 = 266,240 gas.

If 15 batches are inserted into an Ethereum block, since each batch can hold 2048 transactions, this means we can have 15 * 2048 = 30,720 transactions per block.

30,720 transactions / 15 seconds = 2048 transactions per second.

Of course, there are still some practical problems that need to be solved in the theoretical derivation of the above knowledge: each zkRollup batch needs a short encryption proof (zk-SNARK) to prove the integrity of the transactions in the batch. It turns out that generating this proof is computationally expensive. This is the main bottleneck to reach the theoretical throughput limit.

Currently using one CPU and three GPUs, it takes several minutes to generate one such proof. Although performance can be significantly improved through parallel computing, reducing proof generation time from minutes to seconds, while maintaining a reasonable cost, remains an important challenge.

Finally, let’s talk about zero-knowledge proof, which is used to protect data privacy on the blockchain and is very suitable for electronic medical records (HDR) scenarios in the medical industry.

To understand zero-knowledge proof, you can review the story of Alibaba and the Forty Thieves:

When the robber tortured Ali Baba about the spell to open the stone door of the cave, he said to the robber: "You are an arrow away from me, point your bow and arrow at me, when you raise your right hand, I will recite the spell to open the stone door, and raise your left hand I will chant a spell to close the stone gate, and if I fail or escape, you will shoot me with bows and arrows."

Ali Baba proved that he knew the spell, and at the same time did not reveal the specific content of the spell.

zk-SNARKs,Zk-STARKs and BulletProofs (Bulletproof Proofs) are the 3 main technologies of Zero Knowledge Proof for blockchain privacy technology. For comparison:

1. Bulletproofs and Zk-STARKs do not require trusted settings, while zk-SNARKs require trusted settings; zk-STARKs: are executed through the interaction between the prover and the verifier, using an effective mathematical method to make the verifier By verifying each step, it is finally convinced that the prover really knows a certain information or has a certain interest.

Its characteristics are: fast proof and fast verification, but the proof is large in size. SNARK means that no interaction between the two parties is required, and the prover can issue it unilaterally, and there is no need to repeatedly transmit information between the two parties. Its characteristics are: slow proof, fast verification, and small proof volume.

2. Proof speed comparison: Zk-STARKs > zk-SNARKs > Bulletproofs

3. File size: zk-SNARKs< Bulletproofs

A simple sentence: Zk-STARKs are too large, bulletproofs are too slow, the advantage is that there is no need for pre-installation, and zk-SNARKs are the best.

At present, there are quite mature third-party libraries that can be used for the development and research of zero-knowledge proofs.

This area is also a hotspot of academic research, and many new breakthroughs related to zk-SNARK construction have been announced in recent months. The new discovery is that the notorious "trusted setup" is currently redundant, meaning general-purpose computing can be used. However, understandable information on these new constructs has been difficult to find.

The new zero-knowledge proof construction addresses the limitations of the setup process, meaning arbitrary code like smart contracts can be run as zk-SNARKs. There are usually two approaches:

Transparent setup: The setup process creates a reference string that is public, but does not generate toxic waste. This is similar to how zk-STARKs work. Fractal, Halo, and SuperSonic-CG all use transparency settings. The downside of this approach is that the proof size is usually large. Factal and zk-STARK proofs can be up to 250kB in size, which is impractical for blockchain applications.

The Fractal team told me that they are working on reducing the proof size. Halo and SuperSonic have proof sizes of 10kB or less. (Note: zk-STARK is the name of a specific zero-knowledge proof, similar to Groth16 or Fractal)

Generic setup: The setup process creates structured reference strings, which generate toxic waste, but creation is no longer limited to a single circuit. Instead, one reference string can be used with an unlimited number (with some upper limit) of arbitrary circuits. Examples include Marlin, SuperSonic-RSA, and Plonk.

After the ceremony, the reference strings of these three constructs can be updated to improve security: if the current toxic waste leaks, the establishment process only needs to be updated to secure the system again. (Some common zk-SNARKs such as AuroraLight and Libra use static non-upgradeable common settings. We won't discuss these in this blog post).

The table is a performance comparison of some zksnark algorithms. On the prover side, creating a proof for each zk-SNARK construction takes O(n log n) time. The differences are mainly the size of the proof, the verification time and the size of the reference string.

To sum up, we mainly inspected three technical points of Ethereum 2.0: sharding, zkrollup and zksnark.

It involves a lot of theoretical knowledge and algorithms, and it takes some time to understand. But the focus is still on what these algorithms are used for and how to use them.

Q&A

Q1: Ethereum has completed the fork, so will it have any major impact on the follow-up?

Answer: The fork of Ethereum is a kind of software upgrade. The upgrade direction of Ethereum is the direction that the Ethereum community hopes to develop, so with each upgrade, the network will be safer, more efficient, and more in line with the idea of ​​community governance.

This rapid iteration of our usual software development is a reason. The only difference is that Ethereum is a financial system that carries hundreds of billions of assets, and the security of assets and the continuity of services have not been affected in the slightest every time it is upgraded. That's why this project deserves attention.

Q2: Is it convenient to briefly introduce the solidity language?

Answer: solidity is a scripting language unique to Ethereum with a syntax very similar to javascript. It has most of the features of a high-level language, and the most commonly used operation is to operate on the Ethereum account and the balance in the account.

Solidity is very suitable for implementing digital assets, such as ERC20, ERC721, and ERC777 are very commonly used digital asset types.

The assets of the very lively currency circle projects were all around ERC20, and the blockchain games represented by Ethercat used the ERC721 standard.

Q3: The iteration of the blockchain platform is affected by the public, so it should not be too fast or too radical. For example, there will be a fork problem. Do you think this problem can be solved in the future? On software platforms, the Matthew effect usually occurs, that is, the winner takes all. Now that Ethereum ranks first on the platform, does it mean that other platforms have no chance? Decentralization, that is, the theory of DAO, seems to have penetrated from Ethereum, but in fact, the concentration of power will bring efficiency. How do you think about this problem?

A: First of all, to be clear, the success of a blockchain project does not only depend on technology. V God’s article also mentioned that the community is far more important than the code. Code is just a tool to implement community governance and rules.

In solving some basic problems, no very advanced technology will be used. On the contrary, the smart contract and token mechanism in the blockchain are the core content of organizational improvement.

The iteration of the blockchain platform can now be said to satisfy many application scenarios. But Ethereum serves global users, so the technical difficulty will be even greater.

When we study blockchain, we still focus more on how to implement blockchain technology, transform an industry, or solve some core social problems, such as: medical care, education, etc.

Ethereum's DAO is a very good idea, and decentralization is also relative, that is, multi-centralization. The idea of ​​PoS is that the greater the stakeholder relationship, the greater the voting weight. Not everyone can vote.

Q4: May I ask Mr. Wang, where is the biggest opportunity for ordinary individual developers in the Ethereum ecosystem?

Answer: The future we are facing is a programmable society. There are a large number of business rules and logic that need to be transformed into smart contracts. Artificial intelligence solves the problem of productivity. Blockchain can govern these productivity more effectively and fairly. If we developers understand these principles, we can help realize these logics and contribute social value in a specific scenario.

Of course, there are many technical challenges at the bottom of the blockchain, but this is more suitable for students with a certain academic research foundation.

The technical participation suggestion is still in the direction of blockchain application, and the bottom layer of blockchain is not suitable for most people.

For example, it is a good idea to make tools for the blockchain, such as imtoken and similar references. For example: etherscan and the like.

Q5: Do you have any good suggestions for the direction of DApp?

A: Broadly speaking, I think there are several directions, one is financial, and the other is personal information. Finance is the transaction, investment, value-added, etc. of digital assets, because this field is becoming more and more compliant, and supervision has come in. The privacy protection of personal information is increasingly valued, and personal credit, health records, and personal consumption portraits increasingly need to restore sovereignty.

Comunion's DAO, which is an organization that is not a company, but goes beyond a company. Thoughts from different backgrounds and different perspectives collide together, which will produce extraordinary effects.

The financial and personnel management of DAO needs the help of tools like DApp.

ETC
ETH
Welcome to Join Odaily Official Community