paint-brush
Optimistic Rollups vs. ZK Rollups: Which Is Better?by@cpatueyi
482 reads
482 reads

Optimistic Rollups vs. ZK Rollups: Which Is Better?

by Steph TriciaNovember 29th, 2023
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

ZK Rollups compared with Optimistic Rollups.
featured image - Optimistic Rollups vs. ZK Rollups: Which Is Better?
Steph Tricia HackerNoon profile picture

Today, we’ll differentiate between ZK Rollups and Optimistic Rollups, famous Ethereum Layer 2 protocols that help boost speed and lower costs.


But first, let’s define rollups.

What are Blockchain Rollups?

Blockchain rollups are scaling solutions designed to scale slow and expensive blockchains like Ethereum.


Rollups process transactions on another, faster blockchain called Layer 2, then bundle them up into groups or batches and submit them to the parent blockchain (Layer 1) instead of sending each one individually.

That way, the cost of that transaction is split across many users.


Also, their time is saved because they don’t have to wait and pay for each transaction to process independently on Ethereum.

Therefore, users can benefit from the speed and cheapness of the roll-up while also benefiting from the security of the main blockchain.


To make it more transparent,

Ethereum processes around 15-30 transactions per second (TPS). That's like handling 54,000 - 108,000 transactions in an hour.


Now, imagine this:

When loads of people try to transact, only the top 54,000 - 108,000 transactions get through due to congestion, causing high fees and slow verification.


But what if we had an "express lane" for Ethereum transactions?


This lane gathers up lots of transactions, say 10 thousand, and bundles them into a single package. Then, this package gets submitted onto the Ethereum network as one transaction.

So, one move represents a group of transactions, easing the congestion and boosting TPS.

With this, Ethereum could process over 10,000 transactions per second.

This is the ideology behind rollups.


Next, we’ll look at the two main types of rollups.

Types Of Rollups (Optimistic vs. Zero Knowledge)

The difference is how they verify transactions before posting them to the main blockchain.

Let’s start with Optimistic Rollup.

For Optimistic rollups, they assume that all the transactions contained within a rollup are valid unless proven otherwise using a fraud-proof.


Transactions are grouped off-chain into a batch and processed off-chain by a set of validators, after which they are submitted to the main chain in a compressed format.


But here is the exciting part:

Network users can dispute fraudulent transactions before they are submitted to the main chain to ensure that this batch of transactions is not manipulated.


This is termed the “challenge period,” during which anyone can submit evidence or fraud-proof to prove a transaction is invalid. This lasts for about a week.


If no evidence is submitted, the batch is considered valid and is added to the main blockchain.


On the other hand, if evidence is submitted, the dispute is resolved through a dispute resolution process, and the batch is either accepted or rejected based on the procedure's outcome.

Next is the Zero Knowledge (ZK) Rollup.

ZK rollups do not assume the validity of the submitted transactions.


Instead, they use a sophisticated cryptographic technique known as Zero-Knowledge proof to verify the legitimacy of transactions before submitting them to the main blockchain.


Zero-Knowledge Proofs are a type of cryptography that allows someone to prove that they know something without revealing what the thing is.

\In the case of ZK rollups, “the thing” that is being proven is that the transactions in a rollup block are valid without showing all the transaction details.

Like other rollup solutions, ZK Rollup begins by grouping multiple transactions into a batch or rollup block.


Next, it uses mathematical algorithms to generate validity proofs for each transaction within the batch.

Instead of submitting all transaction details to the main blockchain, it submits only these validity proofs.


These validity proofs indicate that the transactions have indeed occurred and are valid.

In addition, the validity proof allows anyone to confirm that the transactions within a rollup block are valid without revealing any information about those transactions.

But Which is Better of These Two?

Let’s look at their strength and weaknesses under these four categories.

  1. Transaction Validity time
  2. Security and Privacy
  3. Gas Fees and
  4. Implementation


1. Delay in Transaction Validity

Optimistic rollup transaction verification can take a week because of how fraud-proof works.

This means that users' funds take up to a week to be reversed during the challenge period if the transaction's validity is questioned.


On the other hand, ZK rollups eliminate the need for a challenge period.

This enables users to withdraw their funds promptly and without any waiting period.

2. Security and Privacy

Compared to Optimistic rollups, ZK rollups offer improved security and privacy by verifying transactions through validity proofs.

3. Gas Fees

ZK rollups typically have higher gas fees as they require more computational power than Optimistic rollups to generate validity proofs.

4. Implementation

ZK rollups are generally more complex to implement than Optimistic rollups.

This is primarily due to the cryptographic techniques and computations in generating and verifying Zero-Knowledge proofs.

In addition, ZK rollups are limited to supporting specific use cases, such as swapping NFTs or transferring coins.


However, there is a new type of ZK rollup called zkEVMs.

zkEVMs are a new type of ZK rollup that is EVM-compatible

This means that they can be used to run Ethereum applications.

Final Thoughts

Both Optimistic Rollups and ZK Rollups are promising scaling solutions for Ethereum.

However, they have different strengths and weaknesses.


Optimistic rollups lead the way regarding reduced complexity and lower gas fees.

Two of the leading layer 2 blockchains that use optimistic rollups are Arbitrum and Optimism.

On the other hand, when it comes to security, scalability, and privacy, Zk rollups take the lead.

Some of the most prominent layer 2 blockchains using ZK rollups are Polygon zkEVM and zkSync.