ZK Rollups vs Optimistic Rollups: What are they and how do they work?
Table of Contents
Ethereum is undoubtedly the most popular blockchain platform, having the largest number of decentralized applications (dApps) in the blockchain world. However, due to its popularity, the network experiences congestion during times of high demand.
The increased network demand results in higher gas prices and slower transaction times, which has a significant influence on the network’s scalability. Layer 2 scalability protocols are one of several options proposed to address Ethereum's scalability issue.
Rollups can provide the best scaling options, but they come with critical security features and trust assumptions. The differences between these two layer 2 scaling methods may help you choose the best option for your scalability needs.
In this blog, we will explore what are zero-knowledge (ZK) rollups and optimistic rollups, and look at the differences between the two methods.
Rollups execute transactions off-chain, primarily on a rollup-specific chain, and then batches, compresses, and distributes the transaction data to the main Ethereum chain, reducing the pressure on the main Ethereum network.
Rollups are a scaling option for Ethereum that works by moving transactions away from the main blockchain where they are processed. The SNARKs are then returned to the main blockchain for verification.
What is a ZK Rollup?
ZK Rollups (Zero Knowledge Rollups) are Ethereum smart contracts that extend the network by performing many transactions outside of the main blockchain.
ZK Rollups work by "rolling up" hundreds of off-chain transfers into a single transaction. It then returns to the main chain with a SNARK (short non-interactive knowledge argument) as proof of validity.
This means that, rather than large amounts of transaction data, only the validity proof is retained on the main Ethereum network, making ZK Rollups a faster and less expensive way to confirm transactions.
Zero-knowledge techniques use mathematical methodologies to confirm things without disclosing or sharing the underlying information. For example, you can think of a payment app that checks if you have enough money in your bank account to complete a transaction without revealing any additional information about your account balance. Or, a program that validates the authenticity of a password without requiring it to be processed. Zero-knowledge proofs can help in the more private and secure brokering of a number of crucial agreements, transactions, and interactions in this approach.
What is an Optimistic Rollup?
Optimistic rollups, as the name suggests, assume that the transaction data transmitted to the Ethereum network is genuine and valid. However, if there is an invalid transaction, the network will cancel it and penalize the involved party. Optimistic rollups accomplish this by instituting a dispute resolution process that is capable of validating fraud proofs, detecting fraudulent transactions, and discouraging bad actors from submitting additional invalid transactions or incorrect fraud proofs.
In most optimistic rollup implementations, the party capable of sending batches of transactions to layer 1 is needed to submit a bond, which is typically in the form of ETH. Both parties, the one submitting the transaction data batch and the one presenting the fraud evidence, have put their ETH at risk in this transaction. This means that if any party acts in any misconduct, their ETH will be forfeited. Whenever fraud evidence is supplied, the suspicious transaction is performed again on the main Ethereum network.
In case if another network participant observes an incorrect transaction, they can file a fraud evidence. When a fraud-proof is produced, the system goes into dispute resolution mode.
In this situation, the suspicious transaction is re-executed on the main Ethereum network. During the execution, if it spots that the transaction is fraudulent, the person who filed the transaction will be punished, often by having the amount of bonded ETH lowered.
Parties wishing to submit fraud proofs are typically asked to post a bond, which may be reduced, in order to prevent dishonest actors from flooding the network with fraudulent fraud proofs.
To guarantee that the transaction is replayed with the same state it had when it was initially run on the rollup chain, a manager contract is created that replaces certain function calls with a state from the rollup chain.
One of the more challenging components of optimistic rollups is to implement this, which is often done by creating a separate manager contract that replaces certain function calls with the rollup's state.
It's important to emphasize that even with only one reliable party keeping tabs on the rollup's development and providing fraud proof as needed, the system can still operate correctly and detect fraud.
Entering the dispute resolution process should only be done once, not on a regular basis. There is no dispute resolution in relation to ZK rollups. ZK rollups are made feasible by a potent encryption method called Zero-Knowledge proofs. In this method, each batch sent to layer 1 has a ZK-SNARK cryptographic proof.
The layer 1 contract may examine the proof immediately after a transaction batch is sent, rejecting any batches that are incorrect.
ZK Rollups vs. Optimistic Rollups
Fundamentally, zero-knowledge rollups have an advantage over optimistic ones in terms of processing performance on-chain. Zero-knowledge rollups are added to the underlying blockchain ledger faster than optimistic rollup transactions since there is never a time when the transaction's validity might be questioned.
On the other hand, the cryptographic validity proofs that zero-knowledge rollups use are computationally intensive. As a result, projects with less on-chain activity may benefit more from optimistic rollup solutions.
Optimistic rollups are now more scalable because the validity proof computation is no longer necessary. While a zero-knowledge rollup solution may be badly hindered by a huge spike in transactions, an optimistic rollup software is unlikely to be impacted.
Another difference between ZK Rollups and optimistic rollups is how they relate to smart contracts on the Ethereum network. Rollups that are optimistic can immediately execute smart contracts on the main blockchain. However, ZK Rollups are unable to carry out smart contract execution on the main chain.
One of the best possibilities, layer 2 rollups occasionally even surpass the other choices in quality. Though none of these methods has been widely embraced by DeFi projects, they are both still in the development stage.
When it comes to DeFi initiatives, ZK Rollups will be more common than optimistic rollups. However, for ZK Rollups to be extensively used on DeFi, it would need some time and network congestion.
About Orochi Network
Orochi Network provides missing building blocks for Decentralized Gaming and Metaverse, the first infrastructure that provides Verifiable Computation.
We allow computation to be processed off-chain at zero cost without sacrificing decentralization. Using Zero-Knowledge Proof to prove and verify the computation, projects can inherit the solutions to be verified on-chain by using smart contracts efficiently.
About Orochi Network
Orochi Network is a cutting-edge zkOS (An operating system based on zero-knowledge proof) designed to tackle the challenges of computation limitation, data correctness, and data availability in the Web3 industry. With the well-rounded solutions for decentralized gaming and metaverse applications, Orochi Network omits the current performance-related barriers and makes ways for more comprehensive dApps hence, becoming the backbone of Web3's infrastructure landscape.
Verifiable Random Function
Introducing Orochi Network - The Operating System For High Performance dApp And Metaverse
10 January 2023
Orosign Wallet 101: How to get started?
03 February 2023
Validity Proofs vs. Fraud Proofs: An Explanation
06 January 2023
Introducing Orosign Multisignature Wallet - A Self-Managing Mobile App For Digital Assets
06 January 2023
Introducing Orand: Your Trustless Source of Randomness
20 February 2023
Verifiable Random Function