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 by design. To help it, additional solutions such as rollups are being invented and implemented. Even Vitalik Buterin highlighted rollup-using L2s as a viable solution to Ethereum’s scalability woes. We prepared an explainer to rollups and why are they changing the narrative in crypto right now.
Join our Telegram channel https://t.me/CHCryptoNews for more crypto insights!
- Rollup solutions are add-ons for Ethereum that operate on layer two. They batch transactions into Merkle trees and submit these as proofs to the main chain after a verification process;
- As a result, the cost of settling transactions on Ethereum is split between all transactions in a batch, and there can be hundreds of them. It is also much faster than on the main chain because a consensus vote happens separately from submitting a transaction;
- Rollups today come in two forms: optimistic, which checks and compares the state of layer two on settlement; and zero-knowledge, which submits proof of validity to Ethereum as settlement.
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.
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…
- You make transactions frequently. Not only ETH but tokens and popular stablecoins too are supported by most of them;
- You are an active DeFi user. Save time and money on each bid, loan, and repayment;
- Same with NFTs: you can mint them on L1 and transfer to an L2 of your choice.
Think about another solution if…
- DApps you use require complex transactions with smart contracts. These are most likely to not be supported on such L2s, anyway;
- Settlement and withdrawal time matters. Moving funds back to L1 can take up to one week if a dispute arises;
- You seek an easy solution. L2 rollups are not plug-and-play and will require you to make extra steps.
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!
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 a fraud challenge period 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.
- Arbitrum is one of the most popular rollups on Ethereum, as evidenced by its $1.32B in total value locked (TVL). Technically, it is a fork of geth, and it does not have a native token. Dispute period for withdrawing from Arbitrum is one week but there are fast-bridge applications to help with that;
- Optimism (OP) is a runner-up, with a $750M TVL as of February 2023. Its users can enjoy using DeFi protocols such as Synthetix (SNX), Uniswap V3 (UNI), and Curve (CRV), to name a few;
- Boba (BOBA) was made by the people behind OMG Network (OMG). In late 2021, they decided to prioritize optimistic rollup over Plasma and launched a new protocol. At the peak, its TVL came up to $615M but as of February 2023, it is $4M with 40% being in SushiSwap.
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.
- Loopring (LRC) was initially built as a hybrid decentralized exchange that uses ZK-SNARKs (succinct non-interactive argument of knowledge) but later its scope of operations increased to an Ethereum L2. The protocol is in the mid-range with a TVL of $124M;
- StarkEx uses another variation, ZK-STARK (scalable transparent argument of knowledge) which does not need a trusted setup like SNARK. Among the users of StarkEx are dYdX, Immutable X, Sorare, and DeversiFi.
Quick Comparison of Optimistic and ZK-Rollups
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:
- Get a Web3 wallet: MetaMask or one of its analogs;
- Connect it to Layer two (usually through an official resource such as wallets or websites);
- Top up your L2 wallet with ETH or ERC20 tokens. This will incur a gas fee on Ethereum;
- 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:
- Head to a gateway to initiate withdrawal (it’s best to know where to go beforehand);
- Connect your Web3 wallet and choose how to do it. It can be the official bridge or a third-party service;
- 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;
- 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:
- Head to an official resource (gateway/wallet) and choose to send assets to your L1 wallet. Choose the tokens and amounts, confirm the details;
- 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;
- 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.
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 Medium for more deep dives like this one.
And join our Telegram channel https://t.me/CHCryptoNews for more crypto insights!