• futureproofed
  • blockchain&beyond
  • decrypting defi
  • articles
  • 10 Jan 25

What Are Rollups? Optimistic and ZK rollups in Blockchain

⚡ From DeFi to NFTs, rollups transform blockchain transactions. Their types, uses, and impact in this must-read guide. Scale your crypto today!

  • 100
  • 0
  • 0
pallavi0310
  • rating +12
  • subscribers 3

Table of Contents

  1. Introduction
  2. What are Blockchain Rollups?
  3. Definition
  4. Why are rollups essential?
  5. Types of Blockchain Rollups
  6. Optimistic Rollups
  7. Zero-Knowledge (ZK) Rollups
  8. How Rollups Work
  9. Off-Chain Processing
  10. Batching Transactions
  11. On-Chain Commitment
  12. Benefits of Using Rollups
  13. Challenges and Limitations
  14. Real-World Applications and Examples in DeFi
  15. Future of Rollups in Blockchain
  16. Conclusion

Become a part of the community

Subscribe to our newsletter to be in-loop with all news from the crypto world

Introduction

In a Reddit post, an Ethereum user shared how a $20 swap had him pay $15 as gas fees and asked if there was a way out!

That’s Ethereum during times of congestion and peak traffic. Despite being the most popular Layer-1 chain, Ethereum suffers from scalability issues.

Vitalik Buterin, in his grand roadmap, suggests blockchain rollups as a near-term and long-term solution to make Ethereum scalable to 100K TPS.

On an average day, Ethereum, the largest blockchain ecosystem, processes 13 transactions per second (TPS). For comparison, Visa processes 24,000 transactions per second, and Mastercard does 5,000.

(There are debates, though, that 24K TPS is a theoretical throughput. The actual TPS VIsa does is around 1,700)

The difference in performance is majorly due to Ethereum leaning towards decentralisation and security, owing to which Ethereum scalability suffers and gas fee increases. This dilemma that all blockchains is known as blockchain trilemma. (more on this later)

Ethereum is trying to solve its scalability and high gas fees issues via crypto rollups. Rollups in crypto are layer-2 scaling solutions for Layer-1 chains like Ethereum.

All About Blockchain Rollups: Optimistic and ZK Rollups
All About Blockchain Rollups: Optimistic and ZK Rollups

Today, over 105 rollups work to help scale Ethereum. As a result, Ethereum’s transaction throughput has reached 296 TPS. A 21x jump can be considered a good progress.

But what are rollups in blockchain, and how do they work? This article digs into blockchain rollups' meaning, mechanics, kinds, and pros & cons.

What are Blockchain Rollups?

A little background information first:

In his paper on rollups, Vitalik discusses two ways of scaling blockchains. First, to make the blockchain itself have a higher capacity via techniques such as sharding. That was the original plan to scale Ethereum, and the team is working on Eth 2.0 to implement it.

Also Read: Vitalik’s new roadmap for Ethereum in his paper titled The Three Transitions.

The second way is to change the way you use a blockchain. For instance, instead of burdening the blockchain with all transaction activity, perform the bulk of transactions off-chain on a layer 2. There are several ways to do that. The three most prominent scaling solutions are state channels, plasma, and rollups.

The beauty of a decentralised blockchain ecosystem like Ethereum is that when the team was involved in developing solutions like proto-danksharding, the community developers built their own scaling solutions like rollups, which were better than the actual plan.

Moral of the Story? Rollups have become a rage in the Ethereum community today.

Definition of Rollups

Blockchain rollups are layer-2 scaling solutions which help to increase the throughput of layer-1 blockchains like Ethereum.

Rollups move computation (and state storage) off-chain, but keep some data per transaction on-chain. To improve efficiency, they use a whole host of fancy compression tricks to replace data with computation wherever possible.

Ethereum Co-founder

Rollups take transactions off the Layer-1 blockchain by compiling or ‘rolling’ them into a bundle and moving them to a faster layer-2 blockchain for processing. The transaction bundle then gets processed into a single transaction data to be broadcast on the main blockchain at a fraction of the gas fees.

Read more about how gas fees work in this Investopedia article. You can also track gas fees on Ethereum using this tracker from Etherscan.io.

Rollups help reduce data bloat and processing load on the mainnet (Layer-1) and increase scalability without compromising security and decentralisation. Rollups are particularly beneficial for advancing decentralised finance capabilities and launching better decentralised applications (dApps) for gaming, NFTs, and other applications.

“You can think of rollups like opening a tab. Instead of paying for items you order individually, you can bundle your purchases and pay for them all at once when you close out your tab. A rollup is like a tab. It bundles multiple transactions at once. When it’s time to close out, you settle your bill with the restaurant’s payment processor, just like rollups settle their transactions on the Ethereum network.”

~What Scaling Ethereum Means For You by Uniswap

ZK rollups and Optimistic Rollups are the two most common kinds of rollups. We will discuss each of the two rollups in detail, followed by a comparative analysis. But first, why rollups are significant?

Why Rollups Are Essential

Blockchains often face trade-offs between security, decentralisation, and scalability, better known as blockchain trilemma. This means blockchains cannot be decentralised, scalable, and secure at the same time.

A medium article by Ray Buckton succinctly explains blockchain Trilemma:

“Secure and fast? You just reinvented Visa. Secure and decentralised? Takes forever — ain’t nobody got time for that. Fast and decentralised? That’s where all the exploits and hacks come from.”
RB

With increasing traction and a growing user base, blockchains such as Ethereum continually struggle with traffic, congestion, and high gas fees issues. Rollups help layer-1 blockchains to shed a considerable portion of transaction processing off the mainnet. They allow L1s to make more room for transactions without disturbing the original blockchain architecture.

Another interesting point to note here is that rollups rely on the security of the mainnet and are more centralised than the layer-1 blockchain. In the case of Ethereum, the network continues to provide its users with the most secure and decentralised transactions while benefitting from its rollups in terms of cost, throughput and transaction speed.

If you are interested in numbers. Here’s how Vitalik Buterin explains the impact roll-ups bring for Ethereum.

Rollups provide cost and space efficiency over Ethereum
Rollups provide cost and space efficiency over Ethereum

Mathematics of How Rollups Scale Ethereum Blockchain?

Let’s dig into the numbers. (the calculations present a simplified version of what Vitalik explains in his paper)

Gas Limit on Existing Ethereum Chain = 12.5 million

Cost Per Byte = 16 gas

Let’s assume a block contains nothing but a single batch of transactions.

Average Data Limit of each batch = 12 million / 16

= 750,000 bytes of data

A rollup requires only 12 bytes per transfer. This means,

Each batch can contain = 750,000/12

= 62,500 transactions

Let’s assume the average block time is 13 seconds on Ethereum. (You can also check no etherscan.io)

Average throughput with rollup = 4807 TPS

For comparison,

A regular ETH transfer costs 21,000 gas.

The average throughput without rollup, in this case, would be 12.5 million / 21000 / 13 ~= 45 TPS for direct ETH transfers on Ethereum.

Types of Blockchain Rollups

Optimistic Rollups

Definition: Optimistic rollups assume all transactions contained in the rollup or transaction bundle are valid until proven otherwise. The rollups grant the network users a specific time duration, mostly one week, to contest fraudulent transactions, if any. Optimistic rollups rely on fraud proofs.

Some examples of optimistic rollups include Arbitrum, Optimism, and Base, among others.

Source: Thirdweb blog | Optimistic Rollups
Source: Thirdweb blog | Optimistic Rollups

Rollup Mechanics: In optimistic rollups, there is a designated operator that moves the transactions off-chain.

The transactions are bundled into a batched block, and a cryptographic proof of the same is submitted to the L1; this cryptographic proof is called the fraud proof.

Fraud proofs confirm the validity of the transactions before the main chain.

The main chain confirms the validity proof and publishes the block to finalise the transaction. After the challenge period is over, the actual resolution of funds happens on-chain.

Advantages and Disadvantages: Optimistic rollups are quicker as the transaction confirmation is based on assumption. The layout for optimistic rollups is also simple. However, since the network gives a week's time for contesting invalid transactions, the actual withdrawal happens only after the designated period ends.

Zero-Knowledge (ZK) Rollups

Definition: ZK rollups or zero knowledge rollups use a zero-knowledge proof to determine the validity of a transaction. A zero-knowledge proof can be understood as a complex cryptography code that helps validate the batched block on the mainnet without revealing sensitive data.

Examples of ZK rollups include StarkNet, zkSync, and Polygon Zero, among others. You can check the complete list of ZK rollups and the projects they support in this article by Alchemy.

Source: PEXX | ZK Rollups
Source: PEXX | ZK Rollups

Rollup Mechanics: Unlike Optimistic rollups, the transaction data is aggregated off-chain, and only the ZK proof is submitted to the L1. This helps enhance the privacy and security of the transactions. ZK rollups help improve scalability and speed, as well as reduce bloat on the mainnet.

Advantages and Disadvantages: ZK rollups are complex in architecture, and transactions may take longer than Optmistic rollups. ZK proofs are also expensive and time-intensive to generate. ZK rollups also currently have limited use cases.

However, unlike Optimistic rollups, ZK rollups don’t require users to wait a week to withdraw their funds. They are also privacy-centric, revealing minimal information for transaction validation. They are also cost-efficient and fast.

Difference between Optimistic Rollups and ZK Rollups
Difference between Optimistic Rollups and ZK Rollups

How Rollups Work

Three stages combine off-chain computation and on-chain verification to make rollups work. Let’s discuss this in detail.

Batching Transactions

Rollups aggregate multiple transactions into one batch to consolidate the transaction data. The amount of data required by the mainnet to validate the transaction is drastically reduced.

Do you remember how, in your Mathematics paper, you would make a separate column for rough work and move all the comprehensive calculations there? In a rollup, the computations for several transactions are put together as a batch and moved off the main chain to be processed off-chain on a layer-2 scaling solution.

Off-Chain Processing

The rollups compute these transactions off-chain to execute smart contracts, validate transactions, and update the balances of the respective accounts. This reduces the computational burden on the mainnet.

The rollup participants must maintain copies of this transaction data to ensure integrity. Fraud proofs are another way to avoid risks and ensure blockchain ecosystem security.

Transactions can now be processed faster and at a much lower cost.

On-Chain Commitment

After the computation, the rollups generate cryptographic proofs representing the processed data. When submitted to the mainnet, it attests to the validity of transactions to the mainnet.

The layer-1 mainnet validates the proofs to ensure the authenticity of the transactional computation by confirming the validity, checking for double attempts, and ensuring adherence to protocol rules.

These cryptographic proofs are committed to the L1 chain as a transaction block to finalise the transitions and update the network state on the mainnet. The rollup transaction block has now become an immutable part of blockchain history.

Interested in a deep dive into the economics of rollups? This article by Delphi Digital is a goldmine.

Benefits of Using Rollups

Some of the prominent rollup benefits include:

Scalability

Rollup benefits can bring massive scalability for dApps decentralised finance( DeFi) platforms and non-fungible token (NFTs) marketplaces, helping to reduce transaction fees and ensuring speedy transactions.

Rollups also allow DeFi protocols like liquidity pools and exchanges to adopt Automated Market Maker (AMM), native bridges, and multi-rollups (layer-3 on top of layer-2) for infinite scalability.

Read more about Layer-3 blockchains in this article by NFT.EU.

Cost Efficiency

As computations are settled off-chain, layer 1 becomes leaner and faster. Since there is limited competition among the transactions to find space in the next block, fewer gas fees are required to get your transaction finalised.

Security

ZK rollups can help ensure sensitive information privacy, such as financial data, to avoid unwanted MEV attacks. Other use cases where rollups can help DeFi platforms include secure and private digital identity management,

Rollups share the security of the mainnet and never fully offload transactions from the mainnet.

Vitalik says, “The fact that data is on-chain is key. Putting data on-chain and having consensus on that fact allows anyone to locally process all the operations in the rollup if they wish to, allowing them to detect fraud, initiate withdrawals, or personally start producing transaction batches.”

Rollups ensure transactions are valid via cryptographic proofs and incentives and are a better scaling solution than the plasma and state channels.

Challenges and Limitations

Data Availability

Data availability is a big area of concern for rollups. Especially Optimistic rollups. In optimistic rollups, transactions are posted off-chain, and if the data is lost or unavailable, huge security risks such as transaction reversals or exit frauds may arise.

Read this article by Celestia to understand the concept of data availability in detail.

Complexity

Cryptographic proof generation can be a complex and time-intensive process for rollups. Also, currently, there are specific rollups for a particular use case. ZK rollups have advanced architecture and are yet to have general use cases to allow an easy transition of dApps and DeFi platforms from Ethereum to the L2.

There are trade-offs in both kinds of rollups we discussed earlier; optimistic rollups are simple but require a challenging period to fully execute transactions, whereas ZK rollups are highly complex, which can impact user experience and lead to potential confusion and associated risks.

Rollups don’t talk to each other. This is a huge concern. Interoperability is so much wanted in an ecosystem. While efforts are underway to achieve a middle ground via hybrid rollups like the one by EY and Polygon, we have a long way to go.

Security risks

Rollups process transactions off-chain. Despite borrowing security from the mainnet, security threads remain as rollups are centralised. Many rollups rely on sequencers to coordinate transactions on the L2 rollup. This sequencer may censor or arbitrarily reorder the transactions, inviting MEV attacks.

The rollups are still in their infancy, and at the backend, the teams behind the L2s maintain partial control. In theory, they hold the power to switch off or pause the network whenever they like. Rollups are also based on assumptions such as the honesty of operators, which, in adverse situations, can bring about security vulnerabilities.

Real-World Applications and Examples of Rollups in DeFi

Users can vastly benefit from the speed and cost efficiency of rollups. Rollups find varied use cases in DeFi. Blockchain rollups in DeFi are already being put to use in real-world applications, such as:

Worldcoin, a DeFi platform for digital identity, is using OP Stack by Optimism to launch World ID and World App on independent Superchains.

Popular DeFi lending platform Aave is deploying its v3 version on Metis Andromeda, an L2 powered by optimistic rollups. DeFi-focused blockchain Canto Public is building a modular L2 powered by Polygon CDK, a ZK rollup.

Popular DeFi insurance platforms Tidal Finance and Insured Finance use Polygon, and InsureDAO uses Optimism to add blockchain scalability.

Popular exchange OKX will be launching an EVM-compatible native network– X1 with Polygon CDK for added interoperability and scalability.

Binance and Coinbase are already using rollup infrastructure for scaling. Coinbase’s L2 Base is built using OP Stack. Binance has integrated two powerful rollups– zkBNB and opBNB to achieve its vision of stretching the block gas limit to 300M and increasing the TPS to 5,000.

NFT Marketplace OpenSea has extended support for the Arbitrum chain, an Ethereum rollup, for users to list NFTs built on the rollup. Check out the list of NFT marketplaces currently live on various rollups in this Reddit thread.

Gnosis Pay is a great real-world example of a payment network that uses rollups. Gnosis uses Polygon zkEVM rollup infrastructure to operate its Gnosis card, the world’s first self-custodial visa card.

Discover. Learn. Profit

Subscribe to our newsletter to be in-loop with all news from the crypto world

Future of Rollups in Blockchain

Rollups have immense potential in payments, exchanges, and application-specific use cases. However, we are yet to uncover their full might. The Ethereum Foundation and developer community have come up with various other kinds of rollups, including Based rollups and Preconfs.

In the short term, optimistic rollups are likely to win, given their general-purpose EVM computation, which allows existing applications to migrate. However, ZK rollups present a better opportunity to scale blockchain networks in the middle- and long-term. Nevertheless, both have their pros and cons, and Layer-2 protocols are already working on developing hybrid rollups. Polygon team is close to building the first zkEVms that will mimic Ethereum main net’s architecture and support any dApp or decentralised service built on Ethereum.

Bitcoin rollups are also becoming a topic of discussion. However, they would differ in architecture and scope from Ethereum rollups. Currently, developers talk of sovereign rollups as a scaling solution for Bitcoin. Citrea is another ZK rollup provider aiming to bring DeFi to Bitcoin.

Infrastructure-wise, developers have proposed EIP-5988, which would help improve ZK rollup’s compatibility with Ethereum.

There’s a lot happening backstage in terms of blockchain scalability, interoperability, and adoption. Rollups form a substantial measure of research and development today.

We will keep you updated with the latest developments. For more informative pieces, check out NFT.EU!

  • 100
  • 0
  • 0