Today, we’re going to discuss optimistic rollups vs. ZK rollups. Both are promising innovations and solutions to Ethereum’s scalability challenge.
Although optimistic and ZK rollups have many similarities, the two solutions differ in several aspects. Read this article to learn more.
What Are Rollups?
They represent Layer-2 scaling solutions, processing transactions off-chain and then wrapping the transaction data into batches to transfer to the corresponding Layer-1 blockchain. This decreases computation load and congestion on the main blockchain, maximizing transaction throughput.
The fundamental advantage of rollups is that they can substantially lower gas fees and increase transaction speed while maintaining smart contract composability and compatibility. This allows users and developers to have an enhanced user experience and more innovation on Ethereum without compromising its basic values.
The two primary types of rollups are optimistic and ZK rollups. Before addressing the optimistic rollups vs ZK rollups differences, let’s first explain each one of them.
What Are Optimistic Rollups?
These rollups get their name because of their ‘optimistic’ manner of executing off-transactions. They assume all Layer-2 transactions are valid, except when an honest network validator challenges them and proves them wrong.
Optimistic rollups use a ‘fraud-proof’ mechanism to identify invalid transactions. During a specific “challenge” or “dispute period,” individuals can submit fraud proof to dispute a group of authorized transactions. If the fraud proof is valid, it revokes the faulty transaction and executes it again to update the state of the rollup.
Moreover, malicious validators face penalties for approving wrong transactions. Yet, if no one challenges the rollup batch during the dispute period, the transaction data will be successfully included in the Ethereum main chain.
Some drawbacks include the delay in resolving the fraud proofs on the mainnet, which leads to delays when users withdraw assets from the rollup chain, and waiting periods of days to weeks.
What are Zero-Knowledge Rollups?
Zero Knowledge rollups use zero-knowledge proofs, a cryptographic method that involves one party proving to another the accuracy and validity of a given statement without revealing certain information about that statement. Thus, ZK rollups prove a transaction’s validity without giving away any data about that transaction.
They ensure immediate finality, with no waiting periods, such as those in optimistic rollups. In fact, they aren’t subjected to further investigation, and funds can be withdrawn within three hours.
Due to the non-disclosure of the transaction specifics on the mainnet, users get an extra layer of privacy. Fabricating a false zero-knowledge proof to deceive the network is extremely challenging, making ZK-rollups highly resistant to hacking attempts. Now that we have ZK rollups explained, let’s discuss the differences between the two.
Optimistic Rollups vs ZK Rollups
Feature | Optimistic Rollups | ZK Rollups |
Data Availability | They minimize data publication on the Ethereum mainnet. Validators are responsible for verifying data correctness and availability, publishing state updates and transaction data on-chain. | ZK rollups send only state differences and validity proofs to the base layer, using less L1 data than individual transactions. The zk-SNARKs ensure cryptographic validity without revealing transaction details. However, they require additional mechanisms to ensure data availability. |
Gas Efficiency | They have higher gas costs than ZK rollups because they rely on on-chain computation and transaction validation. | ZK rollups are more gas-efficient since they compress transaction data into zk-SNARKs. |
Security and Validity Proofs | Fraud proofs enable honest validators to secure the blockchain network, ensuring transaction validity. Since all transactions are assumed to be valid, fraudsters can steal funds if no honest nodes challenge invalid transactions. | ZK rollups use cryptographic validity proofs to validate transactions. These offer security guarantees with math proofs rather than human actors. |
Adoption and Implementation | These types of rollups have gained much popularity on Ethereum, with projects like Arbitrum and Optimism using them. The simpler design and optimistic assumption make them easier to implement and more accessible for developers. | Many projects, including zkSync and Looping, have adopted ZK rollups. Yet, using them needs expertise in zk-SNARKs and zero-knowledge cryptography, which may restrict widespread adoption. |
Popularity | They have relatively simpler technology. The increasing simplicity of creating general-purpose optimistic rollup networks has led to their widespread adoption. | They are slightly less popular than optimistic rollups due to their complexity and the need for specialized hardware and expertise in zero-knowledge cryptography. |
Let’s examine the key factors that differentiate the two types of rollups:
Data Availability
- Optimistic rollups: They minimize data publication on the Ethereum mainnet by only publishing proofs along with transaction results when a transaction is challenged. Optimistic rollups assume most transactions are valid and allow for more efficient and faster transaction processing. Validators are responsible for verifying data correctness and availability, publishing state updates and transaction data on-chain.
- ZK rollups: They only send the state difference and validity proof to the base layer, meaning they use less L1 data than individual L1 transactions. All state updates and transaction data are compressed into zk-SNARKs — cryptographic proofs, which, along with a small amount of data, are transferred to the main chain. This offers cryptographic validity guarantees, with no revelation of underlying transaction data. Still, ZK rollups need extra mechanics to guarantee data availability since the main chain doesn’t store transaction information.
Gas Efficiency
- Optimistic rollups: When considering the optimistic vs ZK rollup gas efficiency, it should be united that optimistic rollups have higher gas costs because they rely on on-chain computation and transaction validation. Then again, the optimistic assumption results in faster transaction processing and lower initial capital requirements for validators.
- ZK rollups: ZK rollups are more gas-efficient since they compress transaction data into zk-SNARKs, reducing the amount of storage and on-chain computation required.
Security and Validity Proofs
- Optimistic rollups: Fraud proofs enable honest validators to secure the blockchain network, ensuring transaction validity. Fortunately, one honest node has the capacity to submit fraud-proof for challenging faulty transactions. Financial incentives stimulate honest validator nodes to dispute fraudulent transactions. At the same time, since all transactions are assumed to be valid, fraudsters can steal funds if no honest nodes challenge invalid transactions.
- ZK rollups: These Layer-2 rollups don’t rely on honest validators but use cryptographic validity proofs (zero-knowledge proofs) to validate transactions. These offer security guarantees with math proofs rather than human actors. Then again, they also require specialized and sophisticated hardware, which may result in centralized control with many operators determining transaction ordering.
Adoption and Implementation
- Optimistic rollups: These types of rollups have gained popularity on Ethereum, with projects like Arbitrum and Optimism using them. The simpler design and optimistic assumption make them easier to implement and more accessible for developers.
- ZK rollups: Many ZK rollup projects exist, including zkSync and Looping. Some popular ZK rollup coins include zkSync, Loopring (LRC), and StarkNet (STRK). Yet, using ZK rollups requires expertise in zk-SNARKs and zero-knowledge cryptography, which may restrict widespread adoption.
Popularity
- Optimistic rollups: They have relatively simpler technology. Optimistic rollup networks were some of the first general-purpose Layer-2 scaling solutions, leading to their greater popularity. The increasing simplicity of creating general-purpose optimistic rollup networks has led to their widespread adoption, particularly with the emergence of the OP Stack, which further streamlines the process for projects looking to implement their own Layer 2 solutions. Another thing that makes them more popular is the transaction cost. Some of the most popular ones are Base, Optimism, and Arbitrum.
- ZK rollups: They are slightly less popular than optimistic rollups due to their complexity, which makes them harder to implement. They require specialized hardware and expertise in zero-knowledge cryptography.
Conclusion
Rollups represent Layer-2 scaling solutions. They process transactions off-chain and then wrap the transaction data into batches to transfer to the corresponding Layer-1 blockchain. This decreases computation load and congestion on the main blockchain, maximizing transaction throughput.
When discussing optimistic rollups vs ZK rollups, we can see they differentiate in several aspects, like data availability, gas efficiency, security and validity proofs, adoption and implementation, and popularity.
FAQs
What are the key tradeoffs between optimistic rollups and ZK rollups?
What are the disadvantages of optimistic rollups?
What is optimistic rollup?
Which is better: ZK rollup or optimistic rollup?
What are the downsides of ZK rollups?