This article will focus on rollups — the most popular category of Layer 2 (L2) solutions for Ethereum, such as Optimism, Arbitrum, zkSync, Base, Blast, and others. While we will use the terms «rollup» and «L2» interchangeably for convenience, it's important to note that they are not the same thing.
L2 refers to any solution that optimizes interaction with a specific blockchain (L1) — saving time and money, enabling dapps that L1 doesn't support for technical reasons, and so on. For example, the Lightning Network is an L2 for Bitcoin that optimizes payments; Polygon, by the way, was also initially launched as an L2 for Ethereum.
A rollup is a special type of L2 chain that «rolls up» batches of transactions and sends them in this compressed form to Ethereum (or another L1). Their advantage lies in relatively high speed and low fees compared to L1.
In a nutshell, here's how rollups work:
- Rollups process and confirm user transactions like any other blockchain. When enough transactions are gathered, information about them is compiled into a «rollup,» which is then sent (like a package) to the Ethereum network and recorded on its blockchain.
- Thus, transactions from the rollup in one form or another make their way onto the main blockchain, although otherwise the rollup operates entirely independently of L1, having its own ecosystem of dapps and so forth.
The main challenge in developing rollups lies in proving that all transactions in the «rollup» are valid (after all, L1 validators didn't check them). The solution depends on the type of rollup.
1. Optimistic rollups simply assume that all transactions sent to Ethereum are valid. However, interested participants have a week from the time the «rollup» is received to challenge any transaction in it. For this reason, transactions in optimistic rollups are finalized on L1 only after 7 days, although for regular users, this is only a problem when sending cryptocurrency from the rollup to Ethereum (you will receive your ETH on L1 only after a week). Most popular rollups fall into this category: Arbitrum, Optimism, Base, and others.
2. ZK-rollups generate special cryptographic proofs that allow L1 to verify the validity of transactions without checking them. Hence the term «zero knowledge»: the verifying system doesn't need to know anything about what it's verifying — the proofs are enough. At the same time, the content of the transaction is finalized immediately upon receipt on L1, without any seven-day windows.
ZK-rollups include L2 solutions such as zkSync and Polygon zkEVM. Some experts, including Vitalik Buterin, believe that the future lies in this technology, although generating ZK-proofs is a laborious and costly process.