Skip to content

Optimistic Rollups vs ZK-Rollups: Comparing the best scalability strategy

As we have discussed in previous articles on optimistic rollups and ZK-rollups, these two scaling technologies have established themselves as fundamental solutions within the distributed ledger technology (DLT) ecosystem, specifically in the Blockchain. Both aim to improve transaction efficiency and reduce operational costs, without compromising the security of the L1 (main chain). In this article, we make a direct comparison between the two technologies, and highligh their key differences.

Validation mechanism

  • Optimistic Rollups: Assume that all transactions are valid until proven otherwise by evidence of fraud. This approach allows transactions to be processed quickly, but introduces a dispute period (typically one week) during which transactions can be challenged and reversed if fraud is detected.
  • ZK-Rollups: Use Zero-Knowledge Proofs (ZK-SNARKs or ZK-STARKs) to validate transactions without revealing specific details. These cryptographic proofs guarantee the validity of transactions before they are published to the L1, eliminating the need for a dispute period.

Key differences: Optimistic rollups rely on verifiers, who can be any network user, to dispute fraudulent transactions, while ZK-rollups cryptographically guarantee validity at the outset.

Time to withdraw funds

  • Optimistic Rollups: Due to the dispute period, users must wait up to a week to withdraw funds from L2 to L1, giving validators time to challenge suspicious or fraudulent transactions.
  • ZK-Rollups: Allow near-instantaneous withdrawals as validity proofs ensure transactions are secure by posting to the main chain (L1), eliminating the wait.

Key differences: ZK-Rollups allow for immediate withdrawals, while optimistic rollups require longer wait times due to their approach to validity proofs.

Smart contract support

  • Optimistic Rollups: Are fully compatible with the Ethereum Virtual Machine (EVM), allowing developers to run smart contracts without significant code changes.
  • ZK-Rollups: Have historically had more limited support for the EVM, although this is improving. Most still require developers to rewrite contracts in specific languages.

Key differences: Optimistic rollups offer good EVM compatibility, while ZK-rollups are improving this compatibility.

Costs and efficiency

  • Optimistic Rollups: Publish most transaction data on L1 as “calldata,” which increases gas costs during periods of high congestion. Dispute periods can also increase costs
  • ZK-Rollups: Publish only validity proofs on the L1, significantly reducing the amount of data transmitted. However, cryptographic proof generation is more computationally expensive and requires specialized hardware.

Key differences: ZK-rollups offer higher data compression efficiency and long-term gas costs, while optimistic rollups are simpler and cheaper initially, but have higher long-term costs.

Security and privacy

  • Optimistic Rollups: Security is based on “cryptoeconomic” incentives and active monitoring by verifiers to detect fraud. They depend on the honesty of the participants and can create uncertainty during the dispute period.
  • ZK-Rollups: They provide more robust security based on cryptographic proofs, eliminating the need for trust in verifiers. They also allow for greater privacy since transaction details are not disclosed.

Key differences: ZK-rollups provide greater cryptographic security and privacy, while optimistic rollups depend on the vigilance of the network and the validators responsible for processing the blocks.

Latency

  • Optimistic Rollups: Latency is higher due to the dispute period, which delays the completion of transactions.
  • ZK-Rollups: Offer significantly lower latency and validate transactions almost instantly with cryptographic proofs.

Key differences: ZK-rollups allow for faster confirmation times, while optimistic rollups can experience delays due to the dispute period.

Easy development

  • Optimistic Rollups: They are easier to implement because they support smart contracts without rewriting code. They do not require specialized hardware or wallets.
  • ZK-Rollups: They are more complex for developers, as they require rewriting smart contracts in specific languages, as well as specialized hardware.

Key differences: Optimistic rollups offer a simpler development experience, while ZK-rollups involve more technical complexity.

Data compression

  • Optimistic Rollups: Publish most transactional data in the L1, increasing storage and gas costs.
  • ZK-Rollups: Allow greater data compression by publishing only validity proofs, significantly reducing the amount of information in the main chain.

Key differences: ZK-rollups are more efficient in terms of data compression, reducing costs in the main chain.

Scalability

  • Optimistic Rollups: Optimistic rollups: They can handle a higher number of transactions per second (TPS), but dispute periods can create bottlenecks during high-activity times.
  • ZK-Rollups: They are more scalable due to their verification efficiency and lower data load, although they require specialized hardware.

Key differences: ZK-rollups are more efficient in terms of scalability, but more technically complex.

Conclusion

In previous articles, we have presented detailed analyses of optimistic rollups and ZK-rollups separately. With this article, we complete the direct comparison between the two technologies and highlight their main differences.

Optimistic rollups are characterized by their simplicity and full compatibility with smart contracts, although their long waiting times to withdraw funds and their reliance on disputes may be drawbacks for some applications.

ZK-rollups, on the other hand, offer fast confirmation, higher security, and lower costs, but at the cost of greater technical complexity and specific hardware requirements.

Both solutions are particularly popular on Ethereum because of the need to scale efficiently due to high transaction demand. However, each solution has advantages that suit different use cases, and in future articles we will explore other scalability solutions that are less popular but play an important role in different contexts.

Resources:
[1] BlockandCapital – Optimistic Rollups & Zk-Rollups

At Block&Capital, specialists in tech recruitment, we strive to create an environment where growth and success are within everyone’s reach. If you’re ready to take your career to the next level, we encourage you to join us.