Layer 2 solutions have become an integral part of the Ethereum road-map, especially short term. This is a good time to do an overview on Rollups and talk about the progress on rollups this year.
Question #1 - What are Layer 2 (L2s)
L2 are technologies that help scale a Blockchain network. Layer 1 is what you refer to as the base technology: Bitcoin, Ethereum etc. Layer 2 usually help scale by taking transactions off the L1 network.
Question #2 - Why do we need these L2s
As network traffic increases, so does the load on the network - thus increasing transaction fees, transaction time and such. This makes user experience of the apps built on the network poor. Even using the network becomes unappealing. As Vitalik puts it well: To scale, we can either change how the Layer 1 handles the transaction (bigger blocks, sharding etc) or change the way the user uses the network - L2s do the latter.
There are many different approaches to this scalability problem - almost all include Off Chain transactions and they all use the Ethereum Virtual Machine to maintain the security aspect. The first approach to this is Rollups. You might’ve been hearing about Optimism, Arbitrium and Polygon Hermez this last month - All these are examples of Rollups. Rollups perform the transaction off-chain, but some of the data is kept on chain. This, as you will see, is different from some other L2s that move data and transactions, both off chain.
Rollups replace on-chain data with processed data - Usually batches with proof on them. A Smart Contract on L1 maintains the Rollup State Root (A merkle root of balance,code etc). The state root switches to the new state root if the previous state root matches current state root. At this point, we need to check the post-state root so that we know that the batches are correct - Optimistic Rollups (Such as Optimism and Arbitrium) use fraud proofs (all state root published, upon detecting fraud, can submit proof on-chain) and ZK rollups use ZK-SNARK proof. This is where the math and the logic gets hairy too, so I leave you with this bird’s eye view of rollups - a lot of which was inspired from this article.
State Channels work differently. They allow user to commit however number of transactions they want off-chain, publishing only 2 transactions on chain. An example would be two users playing Rock Paper Scissors - 3 rounds on the Ethereum mainnet - winner takes home 1 ETH (wild, I know). The game would open up a State Channel, making all the fundamental game transactions happen off-chain in a “Channel” - this will mainly be the shape the player chooses - displayed when both the players choose the shape and then deciding the winner. Once both the users sign using multisig,the final state transaction is published to the L1. As you can image, calling the smart contract for 3 rounds and having such computation occur would be expensive on mainnet. So we do it using EVM running off-chain systems.
Plasma L2s are interesting. On these systems, you can create smaller copies of the mainnet, these will be the Child chains - on top of which you can spawn other child chains. These child chains are stacked on top of each other in the Merkle Tree. Each child chain serve a purpose and can operate independently. If you remember fraud proofs from optimistic rollups, it’ll come in handy. The fraud proof technique is used to save the user from malicious nodes and exit from a corrupt transaction. You can read further about it here.
Sidechains aren’t truly layer 2 since they run an EVM-compatible chain parallel to the mainnet, usually with a bridge. But they have their own set of rules, and don’t use native Ethereum main net security. In this case, Rollups are closest to using native EVM security.
I’ve always considered the Ethereum upgrade to be a multi-step process. EIP1559, on the surface, doesn’t seem to bring much to the table for the everyday user - however it deeply affected the miner economics, inviting a lot of debates (and protests). The beacon chain’s shift to PoS this October will mark the beginning of going from PoW to PoS, however there isn’t much discussion in the mainstream about this either. The users often care about big leaps in Engineering and Tokenomics, such as Bitcoin’s halving or Polkadot’s Parachain, and they expect Ethereum to have this same gargantuan leap where PoS, Sharding, Beacon Chain, EIP1559 all come together to form Ethereum 2.0. But this process is a step-by-step transition, like a Ship of Theseus, coming together to form the new Ethereum 2.0. Between this, there are short term solutions that fit snugly into the grander vision.
There has been a trend where EVM-based sidechains have been outperforming Ethereum and the Rollup ecosystem in the past few months in terms of onboarding new users. Coming from a developing nation (India), this was a anecdotal shift, not just a statistical one. Friends aped into tokens such as Safemoon on the Binance Smart Chain - and this was an eye-opener. I realized most casual investors don’t care about conversations involving security, decentralization. And it makes sense, I personally don’t care about the departmental politics at Johnson and Johnson, I care if $JNJ helps me pay my rent. Casual investors wanted to have fun and make money.
To keep up with these well-shilled “Ethereum Killers” with EVM-compatibility - Ethereum rollups had to outperform them. And while I don’t have any personal qualms with Binance Smart Chain, it was obvious why it was performing so well. In my country, a UniSwap swap on Ethereum mainnet costs the same as about 50 Tacos (at the time of writing) from Taco Bell would cost you. Sure, these transactions will be cheaper on Optimism, the gas required to bridge from mainnet to Optimism is equal to rent for a family of 3 in a mid-tier city. Meanwhile Binance? You can send tokens from the Binance app for a trivial fee.
But in Q3 of this year, something interesting happened - the launch of UniSwap on Optimism bought about a bunch of liquidity from mainnet to optimistic rollups. This, and DyDx on Starknet nboarded users to the world of Rollups, the market was warming up to the idea of L2s - Gas had started to be a concern (as represented in the historical Gas data graph below, provided by Statista) and reputed names launched on these Rollups.
Such projects onboarding onto Rollups made me particularly bullish about the future of Ethereum scaling. Ethereum has the network effect and security in the space with which very few L1s can compete with. Any L1 in this space has to face the Blockchain Trilemma, and it’ll be interesting to see if an L1 is sufficiently decentralized, how far would it go as far as efficiency is concerned, would it fall victim to the Jevon’s paradox? Vitalik states “the internet of money should not cost 5 cents a transaction.” - but Ethereum has struggled with this too. Rollups are one of the most innovative L2 solutions, especially in a dapp-heavy ecosystem.
To me, Rollups and its mainstream adoption are the most exciting developments in 2021. They’ve been around since 2018 (from what I recall, Barry Whitehat’s that repository was the World’s introduction to Rollups). L2s that don’t trade-off security and are scalable promise a bright future to me.