changehero Blog

Rollups Explained: How Do They Make Ethereum Fast and Cheap?
Author: Catherine

Contents

Even though it’s used by thousands of protocols, tokens, and apps every day, Ethereum can only process around 15 transactions per second, and it’s deliberate. To help it, additional solutions such as rollups are being designed and implemented. Even Vitalik Buterin highlighted rollup-using L2s as a viable solution to Ethereum’s woes. We prepared an explainer to rollups and why are they changing the narrative in crypto right now.

Key Takeaways

How Rollups Came To Be

The titular technology is a mechanism that helps a network scale (i.e. adapt to growing usage). Rollups achieve this by outsourcing computational work from layer one. They batch transactions performed on L2 off-chain and use the L1 only for arbitration and settlement.

Compare it to “vanilla” Ethereum: in its current form, the consensus and transactions take place on the same layer. It means that every transaction has to be checked by every node that stores a copy of the blockchain. Only if the majority of the nodes agree, a transaction occurs, and Ethereum processes over a million transactions daily. It sounds like a hassle but this design was intentional to prevent blockchain bloat (i.e. letting a copy take too much storage space).

At the same time, the minds of the Ethereum Foundation were coming up with ways of improving this situation at the cost of certain tradeoffs. State channels, for example, require liquidity upfront and total availability. Plasma and sharding are taking some data off-chain to child chains, secured by their own nodes. And rollups too, turn transaction data that would otherwise be recorded in a block into Merkle trees. These tradeoffs are not bad per se because some use cases would rather have better throughput than Turing completeness or perfect data availability.

merkle tree example
Current Trends and Future Implementation Possibilities of the Merkel Tree — Scientific Figure on ResearchGate. Available from: https://www.researchgate.net/figure/An-example-of-Merkle-Tree_fig1_327601654 [accessed 3 Feb, 2023]

By making these concessions, rollup protocols achieve low latency and fees a fraction of the full deal. In Ethereum in particular, congestion and skyrocketing fees used to be a problem, and even now, for a frequent user gas fees can add up to a significant sum. Most L2s are currently working on Ethereum since this blockchain is in the most need of scaling. Eventually, though, it could be possible for L2s to arrive on other smart contract-compatible blockchains.

What Rollups Can and Cannot Do

Should you use a rollup L2? It wholly depends on your needs but going off the things they improve (and what they can’t fix) should help you decide if this solution fits you.

Use it if…

Think about another solution if…

Types of Rollups

Current implementations of the rollup technology for blockchain come in two sorts: optimistic and zero-knowledge. A general distinction between the two is how the observers assume network participants are behaving.

Optimistic rollups take an “innocent until proven guilty” approach. A fraud check is performed by validators only if a set number of them notice a discrepancy upon settlement. Otherwise, these protocols do not control every action — they use an optimistic assumption, hence the name.

On the contrary, zero-knowledge rollups use the “guilty until proven innocent” approach. They check every Merkle tree that contains all transactions before submitting it to the L1 blockchain with proof of validity. This proof is different from posting the information on all batched transactions, which optimistic rollup does.

Why take such different approaches and use both? Well, because each of them has its own merits!

Optimistic Rollups

ballons with smiley faces
Photo by Madison Oren on Unsplash

What does an optimistic rollup achieve by using its approach? While it compromises on settlement and withdrawal efficiency, it allows for complex transactions and smart contracts. This in turn helps dApps and protocols to be integrated into the L2, so the users have more options on where to put their ETH and tokens to work.

It bears repeating that due to the manager challenging, withdrawal to L1 can take a while. This time window is necessary for external validators to compare their recorded states of L2 to find discrepancies if any.

Popular rollups of this kind include Optimism, Boba Network, and Arbitrum.

Zero-Knowledge Rollups

person stapling a black and white tag to bag
Photo by S O C I A L . C U T on Unsplash

ZK-rollups, as they are also called, are arguably more secure and trustless as they don’t need a set of external validators. They also provide validity proof amortization, or in simpler terms, split the network fee for recording on L1 among all transactions rolled up in this batch. The more users on L2, the cheaper it gets! Another great thing about ZK-rollups is the lack of a challenge period on withdrawal since all batches are already settled by validity proofs.

Why haven’t zero-knowledge rollups replaced optimistic ones if they are so good? The key is in how they work: Merkle trees have trouble recording complex transactions, so ZK-rollups have limited EVM and smart contract compatibility. It makes it harder for DApps to use this kind of L2s, and it limits which DeFi and NFT products users can avail.

Some examples of these protocols are Loopring and StarkEx.

Quick Comparison of Optimistic and ZK-Rollups

Optimistic Zero-knowledge
Assumption Everyone is agreeable Everyone is malicious
Smart contracts Yes None at the moment
Dispute period Yes None
Scalability improvement (factor of) 77 500
Cost amortization Yes Yes

How Do You Use A Rollup L2?

Let’s suppose you would like to give one of these protocols a try. We did mention it will require extra actions but what exactly will you need to do? Of course, the bridging process is slightly different for each of the protocols but the general outline is as follows:

  1. Get a Web3 wallet: MetaMask or one of its analogs;
  2. Connect it to Layer 2 (usually through an official resource such as wallets or websites);
  3. Top up your L2 wallet with ETH or ERC20 tokens. This will incur a gas fee on Ethereum;
  4. Use them within the ecosystem. Enjoy near-instantaneous transactions and negligible gas fees but don’t forget to check that you are sending funds to the same network and not Ethereum.

A withdrawal process from an optimistic rollup layer would look like this:

  1. Head to a gateway to initiate withdrawal (it’s best to know where to go beforehand);
  2. Connect your Web3 wallet and choose how to do it. It can be the official bridge or a third-party service;
  3. Initiate a withdrawal with your wallet. This will start the verification challenge period, usually seven days. Progress can be checked on Etherscan or at the gateway site;
  4. Once the withdrawal has been confirmed, claim it. This will incur a gas fee on Ethereum, but you will be informed of it on initiation.

Withdrawing from a ZK-rollup layer is a bit easier:

  1. Head to an official resource (gateway/wallet) and choose to send assets to your L1 wallet. Choose the tokens and amounts, confirm the details;
  2. Loopring will require you to submit a token approval transaction (i.e. there will be a fee) first if it’s your first time withdrawing this token;
  3. Confirm the withdrawal details once again. Interacting with L1 will incur a gas fee. For StarkNet, initiating a withdrawal and claiming it are two separate transactions.

Consider these instructions before opting for a roll-up L2. On- and off-ramping requires paying fees a few times, so if you don’t move funds often, it may not be worth it. Challenge dispute periods are also a thing to keep in mind, even if you use a third-party bridge because they will lend you a requested asset on Ethereum, taking the risk for you.

Summing Up

Rollup layer-two solutions are heating up, so more users may get interested in what Arbitrum, Optimism, or Loopring have to offer. We hope our guide helped you to understand this technology better and decide if you would like to try it for yourself.

If you found our guide helpful, visit our social media for a stream of engaging content, or subscribe to our blog for more deep dives like this one.

Twitter | Reddit | Facebook | Telegram | YouTube

Sources:

Arbitrum Documentation Center

OMG Network Documentation

How to Use Layer-2 Rollups to Avoid Gas Fees | Alexandria by CoinMarketCap

ZK-Rollups Will Take “Years of Refinement”: Vitalik Buterin — Crypto Briefing

ZK-Rollups and the Path to Scaling Ethereum — Crypto Briefing

Optimistic Rollup | Alexandria by CoinMarketCap

DeFi Llama — DeFi Dashboard

Tags