Golden Recursion Inc. logoGolden Recursion Inc. logo
Advanced Search
Rollups

Rollups

Rollups are regular smart contracts on the Ethereum mainnet that serve as the relay between the mainchain and layer 2, where computations occur.

Overview

Rollups are scaling solutions built for the Ethereum blockchain. This, as the name suggests, involves collecting transactions into a rollup, which is presented to the Ethereum blockchain as a single transaction. By doing this, a rollup can increase the efficiency of transactions on the Ethereum blockchain while reducing the cost of those transactions, which is split among the users of the rollup. And the Ethereum blockchain, which can only process around fifteen transactions per second, is capable of turning one of those transactions into a bunch of transactions through the rollup. Vitalik Buterin, Ethereum cofounder, has stated that until Ethereum can increase the speed natively, scaling solutions such as rollups will continue to play an important role in the implementation of the Ethereum blockchain.

Rollups and Ethereum scaling

As the demands on the Ethereum network have grown, the blockchain has reached certain capacity limitations, and this has, in turn, increased the cost of using the network. This problem has led to the need for scaling solutions, which are, as the name suggests, solutions intended to increase the network's scalability through increasing its transaction speed and transaction throughput without sacrificing decentralization or security. On the Ethereum blockchain, high demand has led to slower transactions and higher gas prices, and using scaling solutions can increase the capacity and, for some, lead to a meaningful and mass adoption of Ethereum. But it is equally important that those scaling solutions remain decentralized and secure while keeping the barrier for entry low. In the realm of scaling solutions, there are technically two categories: on-chain scaling solutions and off-chain or layer 2 scaling solutions.

On-chain scaling

On-chain scaling solutions, as their name suggests, require changes to the Ethereum protocol, and the main focus of on-chain scaling tends to be sharding, which splits a database horizontally to spread the load. In the context of Ethereum, sharding reduces network congestion and increases transactions per second by creating new chains, or shards. This can also reduce the load for validators on their nodes.

Off-chain scaling

Also known as layer 2 solutions, off-chain scaling solutions are implemented using a protocol or network separate from the layer 1 network and, therefore, make no changes, in the case of Ethereum, to the mainnet protocol. Some of these solutions derive their security from the Ethereum consensus mechanism, including rollups or state channels, while other solutions involve the creation of new chains that derive their security separately. The latter group tends to include sidechains, validiums, or plasma chains.

Layer 2 or off-chain solutions tend to be sought because they can increase the transactions per second, which improves network congestion and improves user experience. The transactions can reduce gas fees for users and, therefore, make the Ethereum mainnet more inclusive and accessible, updates to scalability are not at the expense of decentralization or security, and the applications at layer 2 networks bring their own efficiencies when working with assets at scale. These solutions include the following:

  • State channels—these utilize multisig contracts to enable participants to transact off-chain and settle with the mainnet. This minimizes network congestion, fees, and delays.
  • Sidechains—A sidechain is an independent Ethereum Virtual Machine (EVM)-compatible blockchain that runs parallel to a mainnet and is made compatible via two-way bridges; sidechains work under their own chosen rules of consensus and block parameters.
  • Plasma —A plasma chain is a separate blockchain anchored to the main Ethereum chain and uses fraud proofs to arbitrate disputes.
  • Validium—A validium chain uses validity proofs such as zero-knowledge proofs but does not store data on the main layer 1 Ethereum chain, which can lead to 10,000 transactions per second per validium chain, and multiple chains can be run in parallel.
  • Rollups—Rollups perform transaction execution outside layer 1 and then posts the data to the layer 1 network where consensus is reached. As transaction data is included, this allows rollups to be secured by Ethereum's native security.
How rollups work
Example of where Rollups exist in reference to the Ethereum mainnet.

The idea of rollups dates back to 2014, when Vitalik Buterin described them as shadow chains, which, unlike other scaling solutions, are compatible with the smart contracts powering many DeFi applications. Since then, these shadow chains have been renamed rollups, and these allow the off-chain aggregation of transactions inside an Ethereum smart contract to reduce fees and congestion, increasing Ethereum's transactions per second from 15 to more than 1,000. The general process of rollups is similar to using a debit or credit card, such that a series of transactions occurs in the background, being processed through several applications. But in rollups, the transactions are taken off of the Ethereum blockchain, occur on a sidechain or the rollup, and are returned as a bundle of transactions to scale Ethereum to handle increased transaction traffic.

Using rollups

Despite their inherent complexity, using rollups tends to be a simple experience for the user. Rollups work similarly, with the idea that a user's funds are bridged to the layer 2 network, or the rollup, where the transaction can be completed. These transactions can include buying or selling cryptocurrencies or NFTs, moving funds between wallets, or interacting with DeFi protocols. Once these transactions are complete, the user can return their funds back to the layer 1 blockchain.

More practically, this looks like a user, taking a wallet such as MetaMask, with ETH or another ERC-20 token (or other Ethereum-compliant token). The wallet is then switched to the layer 2 network, which is a similar process to any DeFi protocol in which a wallet can be connected. Once the wallet is connected to the layer 2 network, the user's tokens are "bridged," or moved from one network to another. This movement incurs a transaction fee to bridge funds from Ethereum to a rollup. But once the funds are in the rollup, the user can trade funds as usual.

Some networks charge ETH for transaction fees, requiring the user to have ETH to pay those fees, but the fees on rollups are cheaper than on the Ethereum blockchain itself. And some rollups charge almost no fee at all. Once transactions are complete, the funds can be bridged back to the Ethereum blockchain, which can entail converting funds from a rollup back into ERC-20 tokens or ETH in a process similar to the initial movement of funds.

Two main types of rollups

There are two main types of rollups: Optimistic and Zero-Knowledge (ZK). Both are developed to further reduce transaction costs, with both working to reduce wait times and payments for transactions while ensuring the transactions are not fraudulent.

Optimistic rollups

In an optimistic rollup, a transaction is assumed to be valid by default and only runs computation for a fraud proof. In this case, the rollup will present evidence that a state transition was incorrect, usually if the transaction is challenged. Optimistic rollups sit in parallel to the Ethereum mainnet on layer 2 and do not perform any computation by default. Instead, once a transaction is complete, the new state is submitted to the Ethereum mainnet, which essentially notarizes the transaction. The advantages of optimistic rollups tend to include the following:

  • Lower gas fees
  • Increased throughput
  • Smart contract capability
  • Security

While the disadvantages of optimistic rollups can include those below:

  • Long withdrawal time (challenge periods can last for weeks)
  • If a fraudulent transaction is discovered, the rollup automatically calls a fraud proof and runs the transaction's computation using the available data, leading to long withdrawal times
Zero-knowledge rollups

Zero-knowledge rollups, also known as ZK-rollups, bundle thousands of transactions off the main Ethereum chain and create a cryptographic proof known as a validity proof, or a SNARK (succinct non-interactive argument of knowledge), which is posted to the mainnet. This means a ZK rollup needs a validity proof, rather than all of the transaction data, which decreases the cost to transact because less data is being included. When using a ZK rollup, there is less hesitation to move assets from layer 2 to layer 1, as the validity proof has already been approved by the ZK rollup and has authorized the transaction. The advantages of ZK rollups tend to include the following:

  • They have near-instant transfers
  • They are not vulnerable to the attacks that optimistic rollups may be affected by
  • They are secure
  • They are decentralized

There are also some disadvantages of ZK rollups:

  • Validity proofs are extreme to compute for small applications with less on-chain activity
  • A user can influence transaction ordering
  • Some rollups do not offer Ethereum Virtual Machine (EVM) support
Optimistic versus zero-knowledge rollups

Optimistic rollups have to provide time for the network participants to submit fraud proofs in the case there is one, before a transaction can be finalized on the layer 1 blockchain, or mainnet. This can take a long time to ensure all fraudulent transactions can be disputed, with wait times taking as many as a few weeks before funds can be withdrawn from the Optimistic rollups. Some projects tackle this problem through liquidity pools, reducing wait times through almost instant withdrawals and a small convenience fee. For some, this fee is acceptable, especially for transacting smaller funds, but for professional traders, this fee for liquidity would be reflected in their profit margins.

This makes ZK rollups look better than Optimistic rollups, but ZK rollups depend on Ethereum Virtual Machine (EVM)-compatibility. Due to the complexity behind the ZK rollups, it is harder to create an EVM-compatible ZK rollup, and therefore it is difficult to scale general purpose applications without having to rewrite the application logic. Various projects have worked to address this problem, often using virtual machines capable of executing the smart contracts with zero-knowledge proof computation. Optimistic rollups do not have as many problems as ZK rollups in dealing with EVM compatibility. They have to introduce a few modifications to run their own version of the EVM, but most contracts can be ported without making changes.

Differences in computation requirement

ZK rollups have higher computation requirements than Optimistic rollups, with nodes computing zero-knowledge proof to be high-specification machines, which can make it harder for average users to be able to run them.

Scaling

Both Optimistic and ZK rollups can scale the Ethereum network, increasing as much as 45 transactions per second, but with the potential to scale up to 1,000 to 4,000 transactions per second, depending on the types of transactions.

Challenges and risks in rollups

While rollups borrow Ethereum's core security guarantees, there remains some risk. For one, rollups' smart contracts can contain bugs, as with any program, and while fail-safes and audits can help prevent exploits, relying on external programs to handle transactions always carries additional risk. Both types of rollups are still in their infancy, and due to this, they remain somewhat centralized and include many of the incumbent risks of centralization, such as a development team maintaining partial control over a network, and, theoretically, allowing a development team to maintain partial control over the network and related contracts. Some rollups also rely on centralized sequencers to coordinate transactions on the layer 2 chain. A sequencer is not capable of spoofing or altering transactions, but there are theoretical concerns it could censor or re-order them to extract some benefit. Most projects around rollups promise to, or have begun, to decentralize. Other challenges facing rollups and related projects include the following:

  • User and ecosystem onboarding, as not many applications use rollups, and rollups are unfamiliar to users, with a few wallets beginning to integrate rollups, but many do not allow them for payments.
  • Cross-rollup transactions, as efficiently moving assets and data from one rollup to another without incurring the expense of going through a base layer have not been developed.
  • Auditing incentives, how to maximize the chance that one honest node will be fully verifying an optimistic rollup so they can publish a fraud proof if something goes wrong; and for small-scale rollups is not a significant issue, and they can rely on altruism, but larger-scale rollups require more explicit reasoning.
  • Exploring the design space between rollups and other scaling solutions, which could result in other techniques for keep state relevant data on chain.
  • Maximizing security of pre-confirmation, as many rollups provide a notion of pre-confirmation for faster user experience, where the sequencer provides a promise that a transaction will be included in the next batch, and the sequencer's deposit is destroyed if they break their word. But this scheme is limited, and the possibility of making too many promises to too many actors at the same time requires the mechanism to be improved.
  • Improving speed of response to absent sequencers, if the sequencer of a rollup is offline, it would be valuable to recover from the situation either quickly or cheaply to a different rollup or to replace the sequencer.
  • Efficient virtual machines for zero-knowledge rollups, as generating the proof for the ZK rollups requires an EVM code, or some different VM for existing smart contracts that can be compiled to, and has been executed quickly.

Further Resources

Title
Author
Link
Type
Date

An Incomplete Guide to Rollups

Web

Rollups - The Ultimate Ethereum Scaling Solution - Finematics

Web

February 8, 2021

Rollups -- Ultimate Solution to Cheaper & Faster Ethereum Transactions? (Part 1)

Henrique Centieiro

Web

March 9, 2022

References

Golden logo
By using this site, you agree to our Terms & Conditions.