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

Rollup Study Guide, the Most Popular Main Solution for Ethereum Expansion

Winkrypto
特邀专栏作者
This article is about 8527 words, reading the full article takes about 13 minutes
Rollup solves the "data availability" problem found in the development process of Plasma and other predecessors. ZK Rollup and Optimistic Rollup solutions have become the main force for the current expansion and improvement of Ethereum. To unde
AI Summary
Expand
Rollup solves the "data availability" problem found in the development process of Plasma and other predecessors. ZK Rollup and Optimistic Rollup solutions have become the main force for the current expansion and improvement of Ethereum. To unde

Editor's Note: This article comes fromChain News ChainNews (ID: chainnewscom), Author: Pan Zhixiong, Lianwen Research Director, published with authorization.

Editor's Note: This article comes from

Chain News ChainNews (ID: chainnewscom)

Chain News ChainNews (ID: chainnewscom)

, Author: Pan Zhixiong, Lianwen Research Director, published with authorization.

After the birth of Ethereum, the most doubts encountered were performance issues. After the two-layer network solution Plasma was almost completely defeated, the frontier research field focused on Rollup technology.

The current transaction throughput (TPS) on the Ethereum chain can execute less than 30 transactions per second. Although it is close to several times that of Bitcoin, it is still far from large-scale applications. In contrast, the peak transaction processing capacity of Visa or Alipay is at least tens of thousands of transactions per second.

In order to improve transaction performance, Ethereum has set up multiple research directions, and the second-layer network (Layer 2) solution Plasma was once the most important one. However, in the past two years of development, researchers have gradually discovered that there are many problems in Plasma and the improved version of Plasma Cash, such as requiring users to go online regularly and data availability issues, which restrict the development of Plasma.

What are rollups?

A year after Plasma was born, a technology called Rollup surfaced. Based on this concept, several branches were born, the most mainstream of which are ZK Rollup and Optimistic Rollup.

Rollup technology solves the problems exposed by Plasma before, provides the same data availability and security as Ethereum Layer 1 (that is, Ethereum itself), and can greatly improve the throughput of the network while reducing the cost of a single transaction . Because of this, although many people call Rollup a Layer 2 technology in a broad sense, it is actually between Layer 1 and Layer 2.

secondary title

  1. What are rollups?

  2. Of course, Rollup's various solutions have different trade-offs. For example, the disadvantage of ZK Rollup is that it is more difficult to support general-purpose smart contracts, and the process of "condensing" data (creating ZK proofs) takes a long time; while the overall security of Optimistic Rollup is slightly worse. However, the specific implementation plans of each development team have targeted and optimized the above-mentioned trade-offs, and some problems have been significantly improved.

  3. decentralized exchange

  4. Ordinary transfer or payment

  5. decentralized social media

Transfer or payment with enhanced anonymity

Decentralized Identity System

decentralized social media

It has been less than two years since the Rollup concept appeared, and various Rollup implementation solutions have been launched on the test network one after another, such as the solutions of Matter Labs and Fuel Labs, and the products of the application layer are also under development. The first one to be launched on the main network is Loopring The decentralized exchange developed by Loopring, and other projects that have announced that they will adopt Rollup include Synthetix, Dharma, AZTEC, etc.

Next, let's learn more about it.

secondary title

Has plasma failed?

  • Discussions on blockchain expansion originated from the Bitcoin network. Aiming at the vision of Bitcoin becoming a "global payment tool", the community, developers and miners finally discussed a plan to migrate high-frequency transactions outside of Bitcoin. It is carried out in a virtual layer, or it can be called "Layer 2", instead of relying on Bitcoin itself (Layer 1), however, the final settlement still needs to rely on Layer 1.

  • This is the origin of Bitcoin's "Lightning Network". Plasma was once the most eye-catching layer 2 solution in Ethereum, not only because it was a white paper jointly released by Joseph Poon and Ethereum founder Vitalik Buterin, but also because many projects have announced that they will be based on Plasma technology. research and development.

Plasma migrates high-frequency transactions to side chains outside the Ethereum network, regularly publishes the hash value of batch transactions to the Ethereum main network, and then sets up some anti-malicious attack mechanisms to ensure the security of funds. The ultimate goal is to expand the capacity of Ethereum, increase transaction throughput, and reduce transaction costs. Teams such as Plasma Group, Matic, LeapDAO, and OmiseGo were once the most important R&D teams of Plasma technology, and some projects have also received funding from institutions such as the Ethereum Foundation and Consensys.

But after all, this is an experimental project. During the development of the project, many practical problems were exposed. The two most important challenges are:

Poor user experience: In order to avoid malicious attacks, when Plasma designs the mechanism of the challenge period, users need to go online regularly, otherwise they may miss it and suffer unnecessary losses.

Although Plasma has also launched an updated version of the standard Plasma Cash, these problems still exist, which eventually led to the two R&D teams of Plasma Group and LeapDAO deciding to abandon Plasma technology at the beginning of this year and turn to the development of another new technology: Rollup.

Matic still insists on the development of Plasma technology. They plan to launch the mainnet launch process from May 15th to the end of May, and gradually decentralize and expand to more than 100 nodes. Whether Matic has dealt with the above-mentioned problems well deserves more time to observe.

In any case, the development community researching Ethereum expansion technology has switched more energy to researching Rollup.

secondary titleWhy Rollup has a chance?

One year after the birth of Plasma, an anonymous person, Barry Whitehat, proposed the concept of "Rollup" in Github, trying to expand the capacity of Ethereum with "SNARK".

SNARK is a type of cryptography technology for zero-knowledge proof, and its full name is "simplified non-interactive zero-knowledge proof" (zero-knowledge succinct non-interactive argument of knowledge).

For more information on zero-knowledge proofs, see:

An article explaining the history, working principle, zero-knowledge proof and potential impact of cryptography

The word Rollup itself means "curled" or "rolled up", or it can be extended to "summarize" or "aggregate". In the standard computer language SQL of the database, "Rollup" in the grammar can help the Group by statement to display a series of searched results as aggregated data. Perhaps this is the origin of the technology he named after Rollup.

When Barry Whitehat proposed the Rollup concept, it was defined like this:

The way of packaging transactions and verifying transactions is realized through zk-SNARK technology, which can greatly reduce transaction costs, ensure security, and solve the problems encountered by Plasma before.

Some people will classify Rollup as a Layer 2 technology, but Vitalik Buterin doesn't think so.

After the Rollup concept was proposed, Vitalik Buterin published an article in the Ethereum Research Forum to introduce the technology in the same month. He explained: "We can further increase the scale of asset transfer transactions on Ethereum without using The "liveness assumption" (liveness assumption) introduced in Layer 2 technology, such as state channel and Plasma, only needs to use ZK-SNARKs to verify a large number of transactions."

Interestingly, the name "Rollup" was not taken seriously at first. In January 2019, Matter Labs launched a technology called "Plasma Ignis". Because before that, the mainstream technology of Layer 2 was Plasma, they took "Zero-knowledge proof version of Plasma" as their research direction. But from a technical point of view, this is not actually a type of Plasma, but more like Rollup. Later, the team completely abandoned the name Plasma Ignis and adopted ZK Rollup as the technical direction. Later, they also launched their own technical implementation solution based on ZK Rollup, ZK Sync, and carried out more in-depth customization and optimization.

image description

Tweeted by Matter Labs co-founder Alex Gluchowski in January 2019.

Since the main disadvantage of the early concept of ZK Rollup is that it takes a long time to generate SNAKR proofs, and it also fails to support general-purpose smart contracts, so John Adler, co-founder of Fuel Labs and long-term researcher of the second-layer expansion scheme of Ethereum, Another option, called Optimistic Rollup, was proposed in June 2019. This scheme absorbs the advantages of ZK Rollup for data availability and the penalty mechanism of Plasma. Since the zero-knowledge proof is removed, it can more conveniently support general-purpose smart contracts.

Optimistic means "optimistic", so in this scheme, the data is not aggregated to the chain after SNARK processing, but the default "optimistic" believes that the node will publish the latest and accurate data to the chain, otherwise others After verification, if a problem is found, a challenge can be initiated, and the node will be punished after success.

So on the whole, compared with Plasma, Rollup's technology solves the problem of data availability most importantly. All transaction data is on the Ethereum chain, and the security can be at the same level as the Ethereum main chain.

Since transactions are also published on the chain, why does Rollup have a higher throughput and lower cost than ordinary transfers?

Because when building a Rollup transaction, a large number of ordinary transfer behaviors can be compressed by some techniques. Finally, after processing the SNARK through zero-knowledge proof, although the SNARK generation process is long and the resource consumption (Gas) is large, it is allocated to Insignificant in every transaction. There are specific data for reference in Vitalik Buterin's initial proposal, although there are various implementations and differences in the follow-up.

In his scheme, a single transaction is structured like this:

Compared with the 21,000 gas fee required for ordinary on-chain transactions, the above single transaction is reduced in size (for example, the Ethereum address is 20 bytes, and the above one only needs 3 bytes), so a total of only 892 Gas.

However, since SNARK proof consumes more computing resources, about 600k Gas, and about 50k Gas is required to run the contract, this means that many transactions must be processed in batches in order to share the indirect cost of hundreds of k.

If the upper limit of Gas in a single block of Ethereum is calculated at 8M, if it is pure ETH transactions, the throughput is about:

8M / 21k / 15 seconds ≈ 25 tps

And the throughput in this scenario is about:

(8M - 600k - 50k) / 892 / 15 seconds ≈ 550 tps

This is the main reason why Rollup can not only guarantee the availability of Layer 1 data, but also greatly reduce data requirements and reduce the cost of a single transaction.

In addition to the Rollup solution R&D team mentioned above, many application layer projects have also seen the advantages of Rollup and announced that they will research or integrate Rollup technology. Judging from the currently public projects, there are more projects that choose Optimistic Rollup, including decentralized exchanges, DeFi protocols, anonymous services, etc., probably because the project side considers the advantages of Optimistic Rollup to support general smart contracts, and It will not take a lot of time to generate SNARK proofs like ZK Rollup. After all, before there is no optimization solution, it may affect the application experience.

How much can transaction costs on the chain be reduced? Loopring gave important actual combat data. In the scheme they adopted, when processing 4096 transactions in batches, a single transaction only needs 375 Gas. That is to say, under the normal Gas fee, the cost of each transaction is 0.09 cents (note the unit), in other words, the cost of 1 million transactions is about 900 yuan.

But LeapDAO, the team that once developed Plasma technology, believes that Rollup technology is not a panacea. After they conducted specific data analysis, they provided you with a lot of data worthy of reference. According to their estimates, Rollup can increase the throughput of the Ethereum network by a little more than 10 times overall, because it still sacrifices a lot of cost compared to Plasma.

In addition to the two most popular derivative versions of Rollup, there are also some Layer 2 expansion solutions of Ethereum that also use the name Rollup. The two more common ones are BLS-Rollup proposed by SKALE Labs and Arbitrum Rollup by Offchain Labs.

However, the author of Optimistic Rollup, John Adler, believes that BLS-Rollup is not a Rollup in the usual sense, but more like a batch processing technology. However, Arbitrum Rollup did not mention Rollup when it published a paper in 2018 and a white paper in 2019. They only called it Arbitrum Rollup when they launched the testnet earlier this year.

secondary title

ZK Rollup Progress

The most important companies in the development of ZK Rollup technology are Matter Labs and iden3, both of which have launched testnets. But the positioning of their products is slightly different, Matter Labs is more like a general-purpose solution, while iden3 is a special-purpose solution.

In order to meet the needs of general smart contracts, Matter Labs also launched a zero-knowledge proof smart programming language and framework Zinc, and launched the first version v0.1 Alpha in February this year. Matter Labs stated that Zinc is an intelligent programming language and execution environment for creating secure zero-knowledge proof circuits and running programs based on them. Zinc follows the Rust principle and is based on simplified Rust syntax. It is proficient in the development of Rust, C++, Solidity and other languages Readers can quickly get started in one day.

The original intention of iden3 to study ZK Rollup is for their original project. The name iden3 can be imagined as identity 3.0. Feel it, is it similar to "Web3"? Therefore, the iden3 team focuses on providing an open source identity management system for the digital world, using zero-knowledge proof zk-SNARK to improve privacy features, and Rollup can increase the transaction throughput of the identity authentication system and application layer in the chain interaction.

From the perspective of the application layer, Loopring and AZTEC respectively solve the user's on-chain transaction and privacy needs. Loopring's decentralized exchange is the one with the fastest development progress among the current Rollup projects. As early as the end of February, it had launched the Ethereum mainnet and started public testing.

AZTEC is a privacy technology solution. It launched the Ethereum mainnet in February this year, but they are still considering the use of Rollup technology to significantly reduce the cost of private transactions in the Ethereum network. They originally adopted zero-knowledge proof ZK in privacy technology, and chose ZK Rollup for the expansion solution, so they named the new solution ZK ZK Rollup, or ZK² Rollup. The first ZK is to use the "succinctness" in SNARK technology to improve the scalability of the network, and to combine multiple transactions into one to reduce transaction costs. The second ZK is to use SNARK as a privacy technology to merge Every normal transaction before is upgraded to a private transaction.

secondary title

Optimistic Rollup progress

The most important companies in Optimistic Rollup technology are Fuel Labs, Optimism (formerly Plasma Group) and NutBerry, which develop general Optimistic Rollup solutions. Compared with ZK Rollup, it is easier to support general-purpose smart contracts due to the removal of complex cryptographic techniques such as complex zero-knowledge proofs.

Although Optimistic Rollup has the advantage of increasing data availability compared to Plasma, it also directly absorbs the previous achievements of Plasma. In addition to using the same set of game and punishment mechanisms, the Optimism team said that the two solutions can share a lot of infrastructure and code. In addition, they believe that for a mature Layer 2 ecosystem, Rollup, Plasma, and state channels should be able to work together in the same client (smart wallet).

In fact, at the end of 2019, before the Plasma Group publicly abandoned Plasma technology, a new company, Optimism, was formed to focus on implementing Optimistic Rollup. $10,000 in seed round financing. The newly raised funds will be used primarily to implement the Optimistic Rollup solution and build applications based on it. Although it is a commercial company, the research group said it hopes to continue contributing to open source projects and sharing their research with the public.

To support smart contracts on Ethereum, Optimism has released an Alpha version of its Optimistic Virtual Machine (OVM). OVM is a copy embedded in the Ethereum Virtual Machine (EVM), allowing developers to use the same developer toolset and smart contract language as EVM when using Optimistic Rollup.

At first, Optimistic Rollup was called "Minimal Viable Merged Consensus" (Minimal Viable Merged Consensus). After John Adler proposed this concept in June last year, Fuel Labs was established to implement their expansion plan.

In January of this year, Fuel Labs launched the public testnet of Fuel, an Ethereum sidechain based on Optimistic Rollup, and the code has also been open-sourced. It is worth noting that the contracts of their test network already support all ERC-20 tokens, after all, ERC-20 is a kind of smart contract. Later in March, they announced the launch of a new Ethereum underlying language, Yul+, as an experimental upgrade to Yul, adding various QoL features to Yul (a low-level intermediate language for the Ethereum Virtual Machine). Yul is a low-level intermediate language written by Solidity developers to further optimize the compilation target. It is simple and has a practical low-level syntax, allowing developers to be closer to the original Ethereum Virtual Machine (EVM) than Solidity, while optimizing gas fees Use the potential for efficiency.

NutBerry has less influence than the above two, but their goal is to develop a Layer 2 solution based on Optimistic Rollup and support stateful smart contracts. The project was first published on the Ethereum Research Forum, which described that the project will be divided into four milestones: support for the ERC-20 standard, support for the ERC-721 standard, support for stateless smart contracts, and support for stateful smart contracts (that is, A smart contract that can store data). NutBerry has released the second test network in February this year, which already supports ERC-712 (Ethereum typed structured data hashing and signing).

Optimistic Rollup has relatively more application layer products, probably because it is easier to support smart contracts, so it is more convenient for these DeFi, DEX, or privacy services that require smart contract processing logic.

future

Arbitrum Rollup, you can refer to the introduction of Offchain Labs:

There is also an account-based anonymous Rollup project:

secondary title

future

开发者
ETH
Welcome to Join Odaily Official Community