Difference between Optimistic Rollups and Zk Rollups

 196 total views


2022-09-17 22:23:47

The strong growth of Ethereum with many Dapps being built as well as Defi projects has made the network slower and too expensive for transactions. There were times when the cost per transaction was up to 1000 USD. This has slowed down the expansion and development of Dapps as well as Ethreum’s ecosystem.

In order to solve these problems, Layer 2 solutions gradually become the gateway for investors to find to solve the need for fast and low-cost transactions. Optimistic Rollups and Zk Rollups are the two Layer 2 solutions that are making the most of a difference to the Ethereum network to address these issues. In this article, let’s learn about Optimistic Rollups and Zk Rollups, as well as compare the differences between the two solutions.

content
hide

What is Zk Rollups?

Zk Rollups are layer 2 scaling solutions that increase throughput on Ethereum by moving computation and state storage off-chain. Zk Rollups can process thousands of transactions in one batch and then just prove the data with minimal summary to mainnet. This summary data identifies changes that need to be made on the Ethereum mainnet and some cryptographic evidence that those changes are correct. This way on the mainnet there is no need to re-execute those transactions and the state can still be executed, thereby reducing the gas fee per transaction. There will be no delay when transferring funds from ZK Rollups to Ethereum as the transactions are executed after the Zk Rollups contract verifies the valid proof. Conversely, withdrawals from Optimistic Rollups may be delayed because of the need to verify transactions with a Fraud proof.

Zk Rollups writes transactions to Ethereum as calldata. Calldata is where the data included in external calls to Smart Contract functions is stored. The information in the calldata is published on the blockchain, allowing anyone to independently reconstruct the Rollup state. Zk Rollups uses compression techniques to reduce transaction data — for example, accounts are represented by an index instead of an address, which saves 28 bytes of data. Updating data on-chain is a significant rollup cost, so data compression reduces costs for users.

What are Optimistic Rollups?

Similar to Zk Rollups, Optimistic Rollups is also a layer 2 protocol designed to scale the throughput of the Ethereum blockchain. This solution reduces computation on the Ethereum mainnet by processing transactions off-chain, resulting in significant improvements in processing speed. Unlike other scaling solutions, Optimistic Rollups derives security from the mainnet by publishing transaction results on-chain.

Optimistic Rollups are considered “Optimistic” because they consider off-chain transactions to be valid and do not publish proof of validity for batches of transactions posted on-chain. Instead, Optimistic Rollups relies on a proven fraud scheme to detect instances where transactions are not calculated correctly. After rollups are submitted to Ethereum, there is a period (known as the challenge period) during which anyone can challenge the outcome of a rollups transaction by calculating the proof of fraud.

If the result of this transaction is a fraud proof, the rollup protocol will re-execute the transactions and update the rollup state accordingly. Another effect of fraud proof is that the arranger responsible for incorrectly executed transactions within a block is penalized.

If the rollup remains unchallenged (i.e. all transactions are executed correctly) after the challenge period ends, the rollup is considered valid and accepted on Ethereum. Others can continue to build on an unconfirmed rollup block, but the transaction result will be reversed if it is based on an incorrectly executed transaction that was previously published.

Computation is part of the slow and expensive use of Ethereum, Optimistic Rollups can provide up to 10-100x improvements in scalability. Optimistic Rollups also writes transactions to Ethereum as calldata, reducing gas costs for users.

Difference between Zk Rollup and Optimistic Ro

Looking at the image below, we will see that both these technologies have a relative scalability solution for the Ethereum network. However, we also see that the biggest difference between these two technologies is in terms of security and execution time for withdrawing money from L2 back to L1.

To make this more clear, we can take the following example:

You travel and want to visit a casino to play during your trip to the US, but that casino requires you to be 18 years of age or older to be able to enter this place. Then:

  • Zk Rollups will answer: I can prove I’m over 18 and I don’t need to show my proof to the security guard.
  • Optimistic rollup will answer: If the security cannot prove that you are under 18 within 7 days, it means I am over 18 years old.

Through this example, we can understand that the time for a successful transaction to be verified will take up to 1 week for users to withdraw money from layer 2 back to their layer 1. To be able to provide a better user experience, it will be necessary to reduce the waiting time, but this will lead to less security because the cost of attack will be cheaper.

Contrary to Optimistic Rollups, Zk Rollups does not have this problem, although this technology still presents many difficulties for the development team when the requirement for understanding ZKP technology is quite large. However, over time when the full development of this technology along with the success of ETH 2.0 and especially when the birth of ZkEVM will bring the development of this technological solution in the future on the network. Ethereum grid.

Here is a summary of the difference between Optimistic Rollups and Zk Rollups.

Optimistic Rollups ZK Rollups
Fixed gas cost per block ~40,000 (a light transaction that mostly only changes the value of the original state) ~500,000 (ZK-SNARK verification is quite computationally intensive)
Withdrawal time ~1 week (withdrawal needs to be delayed to allow time for someone to publish proof of fraud and cancel withdrawal if it is fraudulent) Very fast (just wait for the next batch)
The complexity of technology Short High (ZK-SNARK is a very new and mathematically complex technology)
Generalization Easier (aggregate EVM is already close to mainnet) Harder (ZK-SNARK proving a general-purpose EVM implementation is much harder than proving simple calculations, although efforts (e.g. Cairo) are working to improve this. )
On-chain gas cost per transaction Higher Lower (if the data in a transaction is used only for verification and does not cause a state change, then this data can be discarded, while the Optimistic rollup will need to be public in case it needs to be audited). check for evidence of fraud)
Off-chain computational cost Lower (although more full nodes are needed to re-compute) Higher (proving ZK-SNARK specifically for general purpose computation can be expensive, potentially many times more expensive than running the computation directly)

Binance

WARNING: Investing in financial products carries a lot of risk that may not be suitable for some investors. Therefore, please consider carefully and control yourself before making any decisions that are made up of the references at this website. CryptoViet.com.

#Difference #Optimistic #Rollups #Rollups

Related Posts

Leave a Reply

Your email address will not be published.

Close Bitnami banner
Bitnami