Delin Capital Research Institute: Discussion on the Layer-2 Rollup Expansion Solution of Ethereum Expansion
Editor's Note: This article comes fromDealean Capital Research, reprinted by Odaily with authorization.
Editor's Note: This article comes from
, reprinted by Odaily with authorization.
In May 2020, there was a so-called "Black Thursday" on the Ethereum network: Ethereum became so overcrowded that MakerDAO could not work as expected. In this case, different participants could bid on "under-collateralized assets," which means that one participant is allowed to bid for $4.5 million worth of ETH at $0. The MakerDAO debacle showed us the consequences of insufficient scalability.
As "Black Thursday" proved, this kind of security threat caused by Ethereum congestion has become a very serious problem today. ) to solve the scalability problem, these solutions essentially use the blockchain as an anchor of trust.Layer 2 expansion technology migrates transactions off-chain (as opposed to Layer 1 expansion technology, which increases the transaction throughput of the underlying chain). If built, a Layer2 scaling solution can take advantage of many of the benefits of blockchain (security, immutability, decentralization, etc.) , and requires fewer trade-offs and assumptions.Ethereum Layer 2 Expansion Solution
, the theme of this issue is to talk about the popular Rollup expansion solution in the Ethereum community on the basis of understanding Layer2.
secondary title
First of all, what is Rollup?
Rollup is a Layer 2 expansion solution similar to Plasma, which borrows many concepts from Plasma. Rollup is similar to Plasma in a sense, expanding Ethereum by migrating transactions from off-chain to Layer 2 side chains protected by the main network (that is, Layer 1). Both scaling scenarios deploy smart contracts to the mainnet that contain all funds deposited in the sidechain and proof of the current state of the sidechain. Sidechain users and operators maintain sidechains and ensure that valid state transitions are submitted to the mainnet contract.
Rollup builds on the "Shadow Chain" idea to achieve data availability by enforcing state off-chain and using only the Ethereum blockchain. Rollup's block release or status update only publishes some data to the main chain of each transaction through tx CALLDATA, which improves throughput and overcomes the data withholding attack problem of the side chain.
There are two types of Rollup: Optimistic Rollup and ZK Rollup. They differ in the approach they take to ensure the validity of sidechain blocks. For Optimistic Rollup, validity is ensured by fraud proofs and synchrony assumptions, while for ZK Rollup, validity is ensured by zero-knowledge proofs.
secondary title
What is Optimistic Rollup?
The idea of OptimisticRollup was first proposed by John Adler at the Ethereum Foundation Research Forum in July 2019, and Optimistic Rollup is closer to the original idea outline of the shadow chain. Teams working on Optimistic Rollup include Optimism (formerly Plasma Group), Fuel Labs, Arbitrum, etc.
Optimistic Rollup refers to its use of the Ethereum Optimistic Virtual Machine (OVM), technically speaking, it is an integration of the Ethereum Virtual Machine (EVM), which performs an "optimistic" state of Layer 1 based on Layer 2 data state prediction. We can understand it this way: on the Optimistic Rollup Layer2 chain, users have a machine (OVM) for processing transactions and smart contracts, and all daily operations are performed in the Layer2 machine; on the Ethereum Layer1 chain, users have an OVM Same OVM machine, but won't use it unless an emergency happens. If someone thinks that a Layer2 OVM operation is fraudulent, he can re-run the operation on the Layer1 OVM computer to prove the authenticity of the operation. To become an Optimistic Rollup Layer 2 node, a user (A) must lock some funds in the Layer 1 smart contract (becoming a "Bond Aggregator"), if the user (A) performs poorly, and other users (B) eventually prove that the user (A)'s operation is fraudulent, the user (A)'s deposit will be cut, and the user (B) will receive a deposit equal to the reduced amount as a reward.
Optimistic Rollup can support simple payments and complex smart contracts, and most of the existing code base can be easily ported to Optimistic Rollup, so Optimistic Rollup is considered a direct solution. On the other hand, it is relatively more difficult to seamlessly migrate smart contracts from the main chain of Ethereum to ZK Rollup.
secondary title
What is ZKRollup?
In short, ZK Rollup is a Layer2 scaling solution, in which all funds are held by smart contracts on the main chain, while it performs off-chain calculations and storage, and the validity of its side chains is verified by zero-knowledge proofs. make sure.
ZK Rollup was originally proposed by Barry Whitehat in 2018. Its security guarantee is the same as that of the underlying Layer1 (that is, Ethereum), which can produce blocks within one minute and increase the throughput to 2,000 tps. Projects implemented by ZK Rollup include Matter Labs and Starkware.
Instead of waiting two weeks to finalize a block in the shadow chain, ZK Rollup replaces the fraud challenge with a zero-knowledge proof. Accounts and balances are represented by separate Merkle trees. These Merkle roots ensure that no one can falsify data. The root of each Merkle tree (one for accounts and the other for balances) is stored in a smart contract on Ethereum that only provides a "simple representation" of the state of the sidechain, all other data is off-chain stored.
ZK Rollup is like you are talking to someone (called a relayer) who builds blocks and state updates. The state change is hashed, which is the input process of SNARK (a zero-knowledge proof), which includes the validity proof of each transaction in the Rollup block. Transactions are aggregated and only the header is signed and committed to the main chain. Therefore, the amount of data stored on the Ethereum chain is reduced. All signatures are replaced with zero-knowledge proofs known as ZK-SNARKs, which allow for the compression of aggregated transaction records.
Computation is also improved since the verification of each signature is replaced by a single SNARK. Only a small portion of information (the two Merkle roots of the address book and the balance/nonce, both 32 bytes) are added to the main chain, and they represent only a small portion of transaction data published on-chain via CALLDATA. After submitting a block or state update, users can verify the validity of the zero-knowledge proof. If the challenging transaction tells the smart contract that some data is incorrect, the block will eventually be invalid.
These challenges are replaced by ZK-SNARKs in ZK Rollups, where invalid or incorrect states are impossible to submit. The SNARK proves that this series of transactions was correctly signed by the owner, and that the update of the account balance was correct from the old Merkle root to the new Merkle root. Therefore, it is impossible for relayers to commit invalid or manipulated state.
ZK Rollup submits the ZK SNARK proof to the mainnet Rollup contract. The mainnet smart contract will then verify and accept any valid proofs. This process happens almost instantly and on a massive scale. In comparison, Optimistic Rollup will always sacrifice some scalability to adapt to smart contracts on Layer 2, and its process will also be slightly delayed so that users have time to challenge the invalid blocks of Bond Aggregator.


