ZK rollups vs. Optimistic rollups: How do they compare? (2024)

If blockchain technology is so good then why isn’t everyone using it?

Like the early days of the Internet, blockchain has some challenges it needs to overcome. For the Internet of the 1990s it was slow modem speeds, for blockchain in the 2020s it’s network congestion, high fees, and complicated UX. That’s where Layer 2 networks, and specifically rollups, come into play.

In this post, we’ll take a look at what a Layer 2 network is, why they’re needed, and the two main types in operation today: Optimistic and ZK rollups. Each claims to revolutionize the blockchain landscape, but what are the key differences between them, and which is better when it comes to building or using a dApp?

Let’s dive in.

What are Layer 2s and why do we need them?

Due to the steady rise in demand for blockchains such as Ethereum and Bitcoin, these networks can quickly reach their capacity at times of high demand, leading to congestion and as a result, high user fees. This makes these networks slow, expensive, and inefficient for mass usage. Currently, networks like Ethereum can handle around 15 transactions per second (TPS) with fees reaching up to $40 per transaction. To put this into perspective, VISA can handle up to 65,000 TPS but usually manages around 1,700 TPS.

Layer 2 networks are protocols built on top of a Layer 1 blockchain (also known as the base layer), such as Ethereum, to address the scalability challenges Layer 1 chains face without compromising on the base layer’s core values of security and decentralization. Some Layer 2s, such as Starknet, with its native account abstraction, also tackle blockchain’s UX problem, but in this post we’ll focus on scaling.

When we talk about Layer 2s enhancing blockchain scalability, we’re primarily honing in on two key improvements: improving throughput and reducing costs.

  • Improving throughput: As transactions are bundled into a single batch with the bulk of computation done off the main blockchain, only the final state or a summary is recorded on the main chain. This reduces the workload on the Layer 1 blockchain and increases overall transaction throughput.

Furthermore, by handling transactions off-chain, Layer 2 solutions reduce the latency associated with reaching consensus on the main chain. This allows for quicker transaction confirmations and higher throughput.

  • Reducing costs: By executing transactions offchain and relieving the burden from Layer 1, Layer 2s are able to reduce the costs associated with onchain transactions as the fixed cost of a Layer 1 transaction is spread across many smaller transactions. This means that the average cost per transaction is significantly reduced.

In addition, as mentioned above, by offloading transactions from the main chain, Layer 2 solutions increase the overall throughput of the blockchain network. This can lead to less congestion and lower transaction fees on the main chain itself.

Types of Layer 2s

While there are various types of Layer 2 technologies available on Ethereum, such as state channels, plasma, and validium, the most popular types of Layer 2 are rollups. Rollups fall into two categories: optimistic rollups, and validity rollups-also known as ZK rollups.

Generally speaking, rollups execute transactions offchain, batch them together, and process them as a single transaction on Layer 1. This removes the heavy lifting off Layer 1, reducing congestion, improving the network’s capacity, and removing much of the cost associated with this heavy computation.

The main difference between optimistic and ZK rollups lies in the type of proof they use to validate transactions before they are settled on L1.

  1. Optimistic rollups: Optimistic rollups operate under the assumption that all transactions are executed, batched together, and sent to the base layer are valid, unless proven otherwise. As a security guardrail, optimistic rollups offer a dispute period of up to 7 days for anyone on the network to challenge a newly submitted transaction by submitting something known as a “fraud proof,” which proves the transaction is invalid. If the transaction is proven to be invalid, transactions are re-executed and the rollup is updated accordingly.
  2. ZK-rollups: Unlike optimistic rollups, ZK rollups do not assume the validity of transactions and instead utilize “validity proofs”-also known as “ZK proofs”-to attest to the validity of every single transaction that has been executed and batched together. This validity proof, along with a summary of the state update, is then sent to the base layer for final settlement.

How do optimistic rollups work?

Because optimistic rollups assume transactions are valid unless they are challenged with a fraud proof, the process for finalizing a transaction on the base layer differs from that of a ZK rollup. Here’s a more detailed breakdown of how optimistic rollups work:

  1. Offchain execution: Transactions are executed offchain, on the Layer 2 optimistic rollup.
  2. Transaction bundling: Executed transactions are batched together to be sent to Layer 1 for settlement.
  3. Batch submission: Verifiers of the optimistic rollup on Ethereum receive transactions optimistically, but transactions aren’t settled until after a dispute period, or a “challenge window,” that can take up to 7 days.
  4. Dispute period: During the dispute period, if a transaction is found invalid, it is challenged on Ethereum mainnet. Verifiers are incentivized to ensure the accuracy of transaction processing, as they risk losing their staked funds if they verify invalid transactions.
  5. Finality and settlement: Once the dispute period elapses without any disputes or if disputes are resolved, the transaction batch is considered finalized. At this point, the final state of the transactions is settled on Ethereum mainnet, updating the global state of the blockchain.
  6. Data availability: Optimistic rollups publish minimal data on Ethereum mainnet because they don’t publish proofs along with transaction results unless a transaction is challenged.
  7. State updates: After successful verification, the main chain updates the state according to the transactions’ outcomes. This includes updating account balances, token transfers, and other relevant changes reflecting the effects of the executed transactions.

So, how do ZK rollups work?

While both optimistic and zk rollups are designed to increase throughput and reduce transaction costs on blockchains like Ethereum, they achieve these goals through different mechanisms. As seen above, optimistic rollups achieve this by assuming transactions are valid unless they are challenged with a “fraud proof”.

ZK rollups on the other hand, use “validity proofs”, or ZK proofs, to validate the correctness of each batch of transactions sent through to the base layer. Here’s a detailed breakdown of how ZK rollups work:

  1. Offchain execution: Transactions are executed offchain, on the Layer 2 ZK rollup.
  2. Transaction bundling: Executed transactions are batched together into a single proof that attests to the validity of every transaction in the batch.
  3. Batch submission: This proof, along with a state difference (the difference between the state of the previous batch and the next one), is submitted to the L1 as a single block for verification.
  4. Verification: Upon receiving the proof, a verifier on L1 confirms the validity of the transactions using cryptographic techniques, without the L1 having to execute them itself. This saves time and computational costs.
  5. Finality and settlement: Once approved by the verifier, transactions are settled within just a few hours-unlike on optimistic rollups-and the L1’s global state is updated. This means users are able to access their funds within just a few hours via ZK rollups, instead of having to wait up to seven days via optimistic rollups.
  6. Data availability: Because ZK rollups only send the validity proof and state difference to the base layer, they don’t use as much L1 data as individual L1 transactions.
  7. State updates: After successful verification, the L1 updates the state according to the transactions’ outcomes. This includes updating account balances, token transfers, and other relevant changes reflecting the effects of the executed transactions.

The difference between optimistic and ZK rollups

Optimistic rollups and ZK rollups employ different approaches to achieve scalability, security, privacy, and other essential factors. The following table highlights the key differences across various metrics, providing insights into their strengths and limitations. ZK rollups vs. Optimistic rollups: How do they compare? (1)

Pros and cons

Now that we have a clearer understanding of the differences between optimistic and zk rollups, let’s explore the upsides and downsides of each approach.

Optimistic rollups

Pros:

  1. High throughput: Optimistic rollups significantly raise blockchain throughput by processing transactions offchain, alleviating congestion on the base layer.
  2. Cost-efficient: Optimistic rollups reduce transaction fees by minimizing computation on Layer 1, making decentralized applications more accessible.

Cons:

  1. Slower finality: Transactions on optimistic rollups are subject to a dispute period before settlement on Layer 1, meaning transaction settlement is significantly delayed and the time required to withdraw funds, for example, can be as much as a week.
  2. Less secure: Because the security of optimistic rollups depends on incentivizing honest verifiers to spot fraudulent transactions and actively submit a fraud proof during the dispute period, they require a level of trust in network participants. As such, they are less secure than ZK rollups, which provide cryptographic certainty for the validity of every single transaction from the get-go.

ZK rollups

Pros:

  1. High throughput: ZK rollups significantly raise blockchain throughput by processing transactions offchain, alleviating congestion on L1.
  • Cost-effective: ZK rollups slash transaction fees by reducing computation on L1 by spreading the cost across many smaller transactions.
  1. Faster finality: Because ZK rollups don’t have a challenge period, they enable finality on L1 in just a few hours.
  2. More secure: In addition to inheriting the security and decentralization of the L1 blockchain, ZK rollups provide cryptographic certainty for transaction validity, minimizing the reliance on trust and ensuring data integrity.

Cons:

  1. Complexity: Due to their specialized nature, many ZK rollups require education and infrastructure development to integrate them into existing blockchain ecosystems.

Which rollup is better?

The choice between optimistic rollups and ZK rollups ultimately depends on the specific needs and priorities of a given application. ZK rollups offer superior security and instant transaction finality through their cryptographic proofs, making them an excellent choice for applications requiring high security and immediate confirmation. However, they come with the trade-off of higher complexity and computational demands.

On the other hand, optimistic rollups are easier to implement and more flexible, making them well-suited for a broader range of applications, particularly those that can tolerate a slight delay in finality due to the challenge period.

As the technology and ecosystem around both solutions continue to evolve, developers and users will benefit from both options, leveraging the unique advantages of each to enhance scalability and efficiency in the blockchain space.

To learn more about how Starknet, the world’s fastest-growing validity rollup, scales Ethereum, watch the video below:

ZK rollups vs. Optimistic rollups: How do they compare? (2024)
Top Articles
How Does Bulletproof Glass Work | Window Film Depot
CoinStats Review 2024: The Crypto Portfolio Tracker You NEED!
Frases para un bendecido domingo: llena tu día con palabras de gratitud y esperanza - Blogfrases
Will Byers X Male Reader
123Movies Encanto
Uhauldealer.com Login Page
RuneScape guide: Capsarius soul farming made easy
Best Transmission Service Margate
Wfin Local News
Words From Cactusi
Over70Dating Login
Things To Do In Atlanta Tomorrow Night
Dumb Money
2015 Honda Fit EX-L for sale - Seattle, WA - craigslist
London Ups Store
Mikayla Campinos Laek: The Rising Star Of Social Media
Tyrone Unblocked Games Bitlife
Phoebus uses last-second touchdown to stun Salem for Class 4 football title
Stoney's Pizza & Gaming Parlor Danville Menu
SuperPay.Me Review 2023 | Legitimate and user-friendly
Sunset Time November 5 2022
Www.craigslist.com Austin Tx
Bn9 Weather Radar
Sorrento Gourmet Pizza Goshen Photos
Free T33N Leaks
Farm Equipment Innovations
Phoenixdabarbie
Toonkor211
Co10 Unr
What Is The Lineup For Nascar Race Today
Wisconsin Volleyball Team Leaked Uncovered
Donald Trump Assassination Gold Coin JD Vance USA Flag President FIGHT CIA FBI • $11.73
Mg Char Grill
Craigslist Com Humboldt
Ark Unlock All Skins Command
Afspraak inzien
2008 Chevrolet Corvette for sale - Houston, TX - craigslist
Merge Dragons Totem Grid
Natashas Bedroom - Slave Commands
Regis Sectional Havertys
Anderson Tribute Center Hood River
COVID-19/Coronavirus Assistance Programs | FindHelp.org
Windshield Repair & Auto Glass Replacement in Texas| Safelite
Differential Diagnosis
Toomics - Die unendliche Welt der Comics online
22 Golden Rules for Fitness Beginners – Barnes Corner Fitness
Rise Meadville Reviews
Backpage New York | massage in New York, New York
Haunted Mansion Showtimes Near Millstone 14
Home | General Store and Gas Station | Cressman's General Store | California
Latest Posts
Article information

Author: Trent Wehner

Last Updated:

Views: 5328

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Trent Wehner

Birthday: 1993-03-14

Address: 872 Kevin Squares, New Codyville, AK 01785-0416

Phone: +18698800304764

Job: Senior Farming Developer

Hobby: Paintball, Calligraphy, Hunting, Flying disc, Lapidary, Rafting, Inline skating

Introduction: My name is Trent Wehner, I am a talented, brainy, zealous, light, funny, gleaming, attractive person who loves writing and wants to share my knowledge and understanding with you.