What are Ethereum rollups? Layer 2 scaling explained

Rollups are L2 solutions that "roll up" multiple transactions into a single piece of data before sending it back to the Ethereum blockchain, hence the name. However, they aren’t the only scaling technology available. 

ethereum rollups
ethereum rollups

Ethereum has long established itself as the uncontested leader of DeFi, serving as a platform where developers can build applications and programs without the interference of any third party. However, Ethereum falls short of being able to process more than 15 transactions per second, and its exorbitant and unpredictable gas fees make many activities, like minting NFTs, pointless. 

Ethereum’s shortcomings spurred the need for alternative smart contracts blockchains, giving rise to numerous rivaling networks dubbed “Ethereum killers.” Yet, none of them managed to knock Ethereum off its pedestal yet due to the development of different scaling solutions that started offloading transactions from the mainnet. 

Blockchain trilemma

One may ask, why can’t devs just add more throughput to the network so it can process more transactions? Turns out they really can’t because of the concept known as blockchain trilemma. 

First described by Vitalik Buterin, the blockchain trilemma states that the network can only provide two of three properties simultaneously: decentralization, scalability, and security. 

Decentralization means no centralized entity, individual, organization, or group, has control over the entire network. 

Scalability stands for the network's ability to handle the increasing amount of transactions without sacrificing the speed. 

Security means that the blockchain is resilient to the 51% attack which happens when a malicious user controls more than half of the network's computing power (in case of PoW) or more than half of the staked cryptocurrency (for PoS

A triangle of blockchain trilemma.
Image: Vitalik Buterin (vitalik.ca)

Every attempt to scale Ethereum would mean sacrificing either decentralization or security, a step the Ethereum community is unwilling to take. Their aim is to build a blockchain that has all three properties. For this purpose, developers implement Layer 2 solutions – secondary protocols built on top of the existing network. 

The history of Ethereum scaling solutions

While rollups are currently the most popular scaling technology, it wasn’t always the case. Layer 2 protocols have undergone an impressive transformation in recent years, exploring various solutions along the way. 

State channels 

State channels are an Ethereum scaling solution that allows two parties to make unlimited transactions off-chain, while only two of them have to be submitted to the mainnet: the first and the last one. To open the state channel, participants deposit a certain amount of funds to the smart contract and then transact for as long as they wish without settling their payments. Only when all parties involved are ready to “cash out,” the finalizing transaction is submitted to the Ethereum network, paying all users their dues and closing the channel. 

In this case, the Ethereum network is used only as a settlement layer to process the last transaction, with most activity happening off-chain, greatly offloading the mainnet. That means payments can be processed instantly, and fees are considerably smaller. At the same time, state channels are not without limits. They require locking up some liquidity, which can be problematic when transacting with many users on the different channels, plus they aren’t suitable for all types of transactions. 

Examples of state channels are Celer, Bitcoin Lightning, and Ethereum's Raiden Network. 

Plasma

Plasma is another L2 solution that is essentially multiple separate blockchains anchored to the main Ethereum chain. Similarly to optimistic rollups, plasma uses fraud proofs to settle disputes. Its structure resembles branches of a tree, where the Ethereum network is a trank, and every plasma chain is a distinct branch, having its own block validation mechanism, blockchain history, and specific function.  

Plasma chains are fairly similar to sidechains, with one important distinction. The latter use a separate consensus mechanism and operate independently, connecting to the mainnet via a two-way bridge. Plasma chains, on the other hand, derive their security from Ethereum, publishing every block hash to the mainnet. In case of an attack, users can safely withdraw their funds from the compromised branch to the root network. 

Still, plasma chains have several shortcomings, such as long withdrawal time and reliance on third-party operators to post block hash to the mainnet. Additionally, plasma supports only basic token transfers or swaps but isn’t suitable for more complex transactions.

Sidechains

Sidechains are independent blockchains bridged to the main network. Sidechains use independent consensus algorithms to that of the mainnet and often have utility tokens that are used to transfer value between them and the main chain. An example of a sidechain is Polygon which runs on top of Ethereum. And the Liquid Network is a sidechain for Bitcoin.

Some Ethereum sidechains are EVM-compatible, which means that they can easily execute smart contracts written in Solidity for the Ethereum Virtual Machine. Many DApp developers move their projects to the sidechain, so users can enjoy higher transaction speed and much lower gas fees. 

However, using sidechains involves serious trade-offs. Unlike plasma, this scaling solution doesn’t inherit Ethereum’s security and is solely responsible for the safety of users’ funds. Additionally, sidechains sacrifice some degree of decentralization for higher scalability.

How do rollups really work, anyway?

Now, when we’re finally done with the earlier scaling solutions, let’s take a closer look at rollups. So, what makes them so popular?

Rollups got their name because they would “roll-up” a large volume of transactions into one simple transaction that gets published to the mainnet, preventing network congestion. Depending on how the transaction data is recorded on the L1, rollups fall into two groups: optimistic and zero-knowledge.

Optimistic rollups assume that all transactions are valid until proven otherwise, hence the name. Before the transaction data is posted to the mainnet, there’s a period of time when potentially fraudulent transactions can be verified and contested by submitting a “fraud proof.” The rollup contract then verifies the proof and reverts a batch containing invalid transactions and all batches after it. If exposed, the malicious user would lose the locked funds. 

The downside of using optimistic rollups is the long confirmation period due to potential fraud challenges. The largest optimistic rollups are Arbitrum and Optimism.

Zero-knowledge rollups have a completely different approach to verifying transactions. Instead of assuming that all transactions are valid, zk-rollups use validity proofs to confirm them instantly. Such proofs can verify a batch of transactions without revealing the data.

The disadvantage of using zk-rollups is that validity proofs require a great amount of computational power to process, as the math behind them is quite complex. The most known zero-knowledge rollups on Ethereum are Starknet, Loopring, and zkSync

Unlike other L2 scaling solutions, rollups can support general-purpose EVM code, therefore enabling DApp migration. According to Vitalik Buterin, this makes them a “cornerstone of Ethereum scaling in the short and medium-term future.”

The future of rollups

Despite rollups being a very promising technology, they still present many challenges to developers. First of all, since rollups store data on-chain, their scalability is limited by Ethereum’s storage capacity. Moreover, many rollups rely on the centralized sequencer that posts new batches to the mainnet. With many independent projects, there also comes a problem of fractured liquidity, when funds are dispersed between multiple scaling solutions. 

On the other hand, among other scaling solutions, rollups are the closest to having all three properties of the blockchain trilemma, offering a decent degree of decentralization and security, though moderate scalability.