Layer 2’s are called that because they’re built on top of Ethereum (the Layer 1). They are extensions of Ethereum where people can perform transactions while paying less fees. Here’s a useful way to imagine this: Ethereum is a road with tollbooths, and the traffic can be very slow. The more traffic there is, the more expensive each toll is. Layer 2’s are super-highways that are in parallel to the main road, allowing anyone to move back and forth between them.
Just like a car can either be on the main road or the super-highway, if a wallet has a balance on Ethereum, it can move that balance to instead be held on a Layer 2. From there, that ETH can be spent on NFTs or used in DeFi platforms, or eventually moved back to Layer 1. The fees on Layer 2’s are much cheaper than on Ethereum, so interacting with applications there can be much more cost-effective.
Layer 2’s generally only exist on Ethereum. Ethereum is one of the most expensive blockchains to transact on, having strived towards being secure and decentralized ahead of being cheap to use. Layer 2’s make it cheaper to transact in a broader Ethereum ecosystem, while alternate Layer 1’s exist that compete with Ethereum instead. These will often be immediately cheap to use due to either low traffic or greater centralization, so no Layer 2’s exist for other blockchains yet.*
Sidechains vs Rollups
There are two main types of Layer 2, sidechains and rollups, and the differences between them are important to understand.
A sidechain is an entire blockchain that runs in parallel to Ethereum and reports its status to the Layer 1. While connected to Ethereum through these status reports, sidechains are still separate blockchains. This means having a separate consensus model and set of validators. Sidechains require more than half of validators to agree on every block, and there are often very few validators to keep the network quick.
Rollups, on the other hand, are not blockchains. They are off-chain networks where people can perform transactions, and those transactions are bundled together (or rolled up) and posted to Ethereum as one. Rollups use “sequencers” to bundle transactions together, which are still centralized technologies (although some are working to create decentralized sequencers).
Optimistic and Zero Knowledge Rollups
Rollups are a type of Layer 2 that bundles transactions and posts them together to Ethereum. There are two types of rollups, Optimistic and Zero Knowledge, also with important differences.
Optimistic rollups don’t need validators, but instead make available the data they sequence to be verified and challenged by anyone, for a certain period of time. If anyone discovers a dishonest transaction during that time, they can immediately prove its dishonesty using cryptography. As a result, only one honest verifier is required to keep optimistic rollups secure (as in, every other verifier could be dishonest and it wouldn’t matter).
Zero Knowledge rollups, on the other hand, don’t need validators nor verifiers, instead using cryptography to prove the validity of every batch of transactions as it happens. Since every batch has an automatic proof of its own validity, no additional consensus or verification on transactions is necessary. While this is more secure, it is also more data intensive.
Currently, only optimistic rollups can be EVM-equivalent.* Zero knowledge rollups can’t perform the same complex transactions, since complexity makes generating those proofs more difficult. As a result, optimistic rollups seem to be better for elaborate applications, whereas zero knowledge rollups can be better for processing many simple transactions.
*The challenges towards creating EVM-equivalent zero knowledge rollups are significant, but there are companies working on these challenges and this could change in the future.
Why We Need Rollups
Rollups make fewer compromises to achieve scalability compared to sidechains. Only one honest verifier is required to keep an optimistic rollup secure; every other verifier could be dishonest and it wouldn’t matter. Optimistic rollups need 1/n honest verifiers, and anyone can become a verifier, but sidechains need 1/2 honest validators, and not anyone can become a validator.
Zero knowledge rollups don’t even need verifiers, but their applications are limited, at least currently. Rollups are centralized as far as their sequencers go, but decentralized alternatives may emerge. Rollups can become fully decentralized, whereas sidechains cannot. Further, assets are retrievable from rollups even if the companies behind them stop operating. The same is not true for sidechains, where assets are irretrievable if the sidechain stops operating.
Rollups are the best type of Layer 2 we have, and are seeing increasing prominence in Ethereum development. EIPs and upgrades are increasingly trying to make rollups even cheaper to use, in an effort to increase their capacity even more. In recent years, Ethereum has even moved to a rollup-centric roadmap.
If an upgrade can make Layer 1 costs 10x cheaper, that could lead to 100x or even 1000x cost savings on rollups, or a capacity to handle that many more transactions. It therefore makes sense that rollups will facilitate an increasing share of Ethereum transactions.
Layer 2's Today
Relatively speaking, sidechains are the easiest type of Layer 2 to deploy, and one that gives it’s creators notable control. The Polygon Foundation was able to increase gas fees at a moment’s notice to combat what they perceived to be on-chain spam. This centralized control also lead to the $622 million hack of the Axie sidechain. Both a blessing and a curse, it is likely more sidechains will exist in the future. Their relative ease to develop is likely why we’ve seen sidechains emerge ahead of rollups.
Optimism and Arbitrum publicly launched in 2021 and together have grown to hold over $5.5 billion in assets, as of today. Both are optimistic rollups and with many applications on them. Currently only Artbitrum, the larger of the two, is EVM-equivalent. While Optimism can execute most transactions the same way Ethereum would, but not all. Both networks require ETH to pay for gas.
Companies including Starkware (previously Cairo) and Loopring are developing Zero-Knowledge rollups, with versions already live to the public, but limited in the types of transactions they can handle. The term “zkEVM” has been a buzzword recently as Zero Knowledge rollups continue trying to become EVM-equivalent, but it is not clear if this is possible.
Naturally, Ethereum is limited. There’s only so much block space for transactions, and there are very good reasons why expanding block size doesn’t solve the problem (see my Data Availability write-up here). Instead, to allow more people to access the benefits of blockchain, we must expand the space we already have. This is what Layer 2’s accomplish. Rollups make the least compromises, and will likely be Ethereum’s foremost scaling solution.
This write-up is a summary of the full version available on my free newsletter. Sign up for simple write-ups on blockchain concepts, delivered every other week.
I'm holding a giveaway for a Savage Nation NFT, make sure you've signed up to my newsletter before Mar 23rd to enter!
Stay kind. Stay curious.
submitted by /u/phillistine