Optimistic Rollup and ZK Rollup are the two most popular Layer 2 scaling solutions for Ethereum today. Although they are both Rollup solutions, there are many differences between Optimistic Rollup and ZK Rollup, which lead to differences in technique, operation and user experience. In this article, everyone will learn with me the difference between Optimistic Rollup and ZK Rollup.
To better understand this article, people can refer to some of the documents below:
- What is Layer 2? Complete Guide to Layer 2 Solutions
- What is ZK Rollup? ZK Rollup Solution Overview
- What is Optimistic Rollup? Overview of Optimistic Rollup
Overview of Optimistic Rollup & ZK Rollup
Similarities between Optimistic Rollup & ZK Rollup
Rollup is a scaling solution that takes transactions off-chain for execution and then moves them to Ethereum for consensus and storage, thereby solving the scaling problem on Ethereum. Rollup is formed from two words Roll and Up which mean:
- Roll: Means to collect transactions (hundreds, thousands of transactions) into a single Block.
- Up: Means posting to Ethereum and that 1 Block represents 1 unique Transaction.
The structure of both Optimistic Rollup and ZK Rollup solutions includes:
- On-chain Contract: Is a smart contract on Ethereum that has the role of storing Blocks sent from ORU or ZKU, monitoring network status and monitoring money flow between Layer 2 – Ethereum.
- Off-chain Virtual Machine (VM): Is a virtual machine purpose-built to execute off-chain transactions. This VM will be independent of the EVM.
What is Optimistic Rollup?
Optimistic Rollup is a layer 2 solution built and solved to solve the scaling problem on Ethereum. Instead of being settled on the original chain, transactions will be taken out and processed off-chain, thereby significantly increasing speed and reducing transaction fees compared to on the original chain. Unlike Side Chain, Optimistic Rollup solutions send a summary of their transactions to the original chain, so they receive security from the original chain.
Optimistic Rollup uses Praud Proof of transactions. Simply understand Praud Proof.
You have a driver’s license and you are participating in traffic on the road when suddenly the traffic police stop you to check your documents to determine that you are over 18 years old and have a driver’s license. You answer the traffic police: “I will stay here and if within 7-10 days there is no information proving that I am under 18 years old and do not have a driver’s license, then I am the right person, so you You must let me continue.”
The operating mechanism of the Optimistic Rollup platform will take place in a number of basic steps as follows:
- Step 1: Sequencer will take transactions from Mempool to create a batch and then send it to Ethereum. Besides, Proposer will also update the network state (State Root) to Ethereum.
- Step 2: State Root after being updated to Ethereum will have a challenge period of about 7 days.
- Step 3: During this period anyone who sees that there are malicious transactions in State Root can submit a Fraud Proof proving it and here the dispute will be resolved by On-chain Smartcontract . If no evidence is provided, then that State Root is considered valid and added to the block on Ethereum.
- Step 4: Successful State Root will be updated on-chain and cannot be reversed.
During a period of 7 days, the transaction, although successful on Layer 2, can be completely reversed. Only when it is officially added to the block on Ethereum is it irreversible. That is also the reason why it takes up to 7 days to withdraw money from ORU to Ethereum.
What is Zero-Knowledge Rollup?
Zero-Knowledge Rollup, abbreviated as ZK Rollup, is also a Layer 2 solution aimed at solving scaling problems on Ethereum while still receiving security from the original chain. Unlike Validium, which only sends part of the information to the root chain, ZK Rollup sends full information to its root chain.
ZK Rollup uses a proof called Validity Proof. Simply understand Validity Proof.
You have a driver’s license and you are participating in traffic on the road when suddenly the traffic police stop you to check your documents to determine that you are over 18 years old and have a driver’s license. You answer the traffic police: “I will prove that I am over 18 years old and have a driver’s license, but I do not need to present related documents to ensure my privacy.”
The operating mechanism of the ZK Rollup platform will take place in a number of basic steps as follows:
- Step 1: Sequencer will bring transactions from Mempool to form 1 Block. Besides, Proposer will also update the network state (State Root) to Ethereum.
- Step 2: Prover will create transaction proof (Validity Proof) for that State Root and that State Root will be updated to Ethereum.
- Step 3: In Ethereum, On-chain Smartcontract will serve as transaction proof verification.
- Step 4: If the transaction proof is approved, the State Root will be officially updated on Ethereum and the transaction cannot be reversed
It can be seen that the transaction sent will be verified immediately, making it impossible to reverse the transaction and that also explains why the withdrawal time from ZKU platforms to Ethereum is not too long. time like ORU platforms.
Compare the Difference Between ZK Rollup and Optimistic Rollup
Difference between ORU & ZKU
From the relatively different operating mechanisms of ZK Rollup and Optimistic Rollup, we can see some of the following differences:
- ZK Rollup always has to create transaction proof for each State Root sent to Ethereum, whereas Optimistic does not need to do that. This also explains why Optimism does not use Fraud Proof or Arbitrum has not posted any Fraud Proof on Ethereum since mainnet until now. This point also affects the withdrawal time difference between the two Rollup platforms.
- ZK Rollup always posts its Validity Proof with each State Root, resulting in the amount of calldata from ZK Rollup platforms posted to Ethereum much less than Optimistic Rollup platforms. This makes the transaction fees of ZK Rollup cheaper than Optimistic Rollup.
- The EVM compatibility level of Optimistic Rollup and ZK Rollup is also much different when Optimistic Rollup has a VM that is more EVM friendly than ZK Rollup’s VM. Therefore, ZK Rollup platforms are still in the process of building zkEVM.
- ZK Rollup’s Zero-knowledge technology allows 1 proof (ZK Proof) to serve as proof for many State Roots, Optimistic Rollup cannot do this. It is this factor that creates the speed difference between the two scaling solutions. ZK technology itself also helps ZK Rollup platforms have more privacy options. But this technology also makes ZK Rollup more difficult to build compared to Optimistic Rollup.
- The risk of transaction reversal of Optimistic Rollup platforms is also much higher than that of ZK Rollup. While Optimistic Rollup takes about 7 days to officially “final” on Ethereum, ZK Rollup solutions only take a few minutes or a few hours.
- To solve the problem of decentralizing Sequencer, ZK Rollup solutions will be relatively easier than Optimistic Rollup solutions.
Advantages and disadvantages of 2 types of Rollup
Content |
Optimistic Rollup |
ZK Rollup |
---|---|---|
Ability of extension |
200 – 500 TPS |
2,000 TPS |
Time to withdraw money to L1 |
2 – 10 days |
2 – 20 minutes |
EVM compatible |
Have |
Are not. Needs time to improve |
Proof of transaction |
Fraud Proof |
Validity Proof |
Privacy |
Are not |
Have |
Construction difficulty |
Medium |
High |
Through the table above, everyone can see the advantages and disadvantages of Optimistic Rollup and Zk Rollup. The advantages of one solution will be the disadvantages of the other solution and vice versa.
The advantage of projects under the Optimistic Rollup solution is that earlier deployment is easier for projects in construction and development, so they will have a user base in advance with Zk Rollup. There have been many updates to help Optimistic Rollup improve its existing shortcomings
Summary
There is no such thing as a comprehensive solution. However, at the present time we can make a few conclusions and projections as follows:
- During a long period of research, the Rollup solution has surpassed many other solutions such as Plasma, Side Chain, State Channel to become the main and most important solution in the expansion process for Ethereum.
- For Rollup, Optimistic Rollup solutions will be suitable for the market in the short to medium term. In the long term, Zk Rollup solutions are considered more perfect than what Optimistic Rollup has.
- Optimistic Rollup projects themselves are continuously updated, changed, and developed to compete with Zk Rollup solutions.