Blockchains are slow and expensive and have been since inception. Running them on faster computers puts them out of reach for those who can’t afford it. For years it seemed as though this scalability trilemma would be a persistent problem but thanks to recent innovations, we have found a way forward through Layer-2s.
Layer-2s are slated to be the next big thing in blockchain development, they offer cheap and fast transactions while preserving security and decentralisation. Layer-2 solutions are blockchains built on top of the main blockchain (Layer-1) and this is the approach that Ethereum (ETH) is taking to scale its over-burdened network.
Layer-1 scaling problem
Traditionally, a user will input their commands on a Layer-1 and wait for their transaction(s) to be executed. However, there is limited space (aka blockspace or blocks) to input these transactions and this is what causes the backlog. Making these blocks bigger means that more transactions can fit inside which makes the network faster. Unfortunately, bigger blocks require faster, more expensive computers. If we want a distributed network, we can’t create these financial barriers otherwise only the elite would be able to run the system - a problem most are already far too familiar with.
The solution for avoiding bigger blocks is to rely on another blockchain. On this blockchain, users will input thousands of transactions and then these transactions will be bundled together into one. This one transaction (which represents thousands) is then posted to the Layer-1 blockchain and verifies the accuracy of these transactions. The Layer-2 can have “bigger blocks” run by a few because they are being checked and verified by the Layer-1 run which is decentralised and run by many. But if the transaction still needs to be checked by the slow and expensive Layer-1 don’t we run into the same problem?
Layer 2s and their scaling solution
Well firstly, the expensive Layer-1 transaction fee is split among the thousands of transactions making each transaction much cheaper. In fact, this solution inverts the problem on its head - previously, more transactions meant higher demand for blockspace and hence higher transaction fees. Now, more transactions mean more users to share the costs with, so more users equals cheaper fees. This is why, as shown below, Layer-2s can be so cheap, the Layer-2 transactions are “rolled up” into one Layer-1 transaction. This is also why some Layer-2s are also known as rollups.
Secondly, despite relying on the Layer-1 blockchain to verify transactions, Layer-2s/rollups can operate much faster. This has two explanations depending on which type of rollup we’re talking about, optimistic rollups or validity rollups.
Optimistic rollups are as the name suggests, optimistic. They don’t wait for the Layer-1 to verify the transaction, they optimistically assume the transaction is correct and move on to the next batch. However, it assumes that there are other actors watching the posted transactions to ensure their accuracy. If a transaction is found to be wrong, the one who posted the transaction is punished while the whistleblower is rewarded. The whistleblower submits proof to the Layer-1 that fraudulent activity occurred and this “fraud-proof” (which involves re-executing the transactions) is used to determine the outcome of the dispute. So long as there is at least one person in the world watching these transactions (for financial gains or otherwise), optimistic rollups get the job done.
Validity rollups (aka Zero Knowledge rollups or ZK rollups) also bundle transactions into one and post it to the Layer-1. However, along with this transaction, they also post a validity proof. Using fancy cryptographic maths, this proof immediately proves to the Layer-1 that all of the transactions are in fact valid without having to re-execute the transactions. The Layer-1 verifies the proof in a very short period of time and then moves on to the next transaction. However, zk-rollups are more CPU-intensive as creating the proofs requires a material amount of computing time.
The Layer-2 landscape in charts
Among all of the Layer-2s in development, validity rollups are the most popular due to the ability to quickly know the validity of a transaction bundle. However, the maths behind these validity rollups is relatively new so progress is slower than optimistic rollups. Below we show the percentage of Layer-2s based on the type of proof used, where optimistic rollups used fraud proofs while validity rollups use validity proofs.
While the Layer-2 landscape is still in its infancy, it is progressing quickly as the number of daily active addresses continues to climb. While one user may have multiple addresses, it is still a useful proxy for network usage as highlighted below.
As Layer-2s pay a fee to post to the Layer-1, their increased popularity has led to them becoming a larger share of Ethereum’s revenue as shown below. In fact, Layer-2s Arbitrum and Optimism are already the 5th and 7th largest chains by Total Value Locked (TVL) respectively, with DeFi ecosystems larger than Solana.
While TVL measures the value locked in all the dApps in a chain, Total Value Escrowed (TVE) measures the value locked in the dApps as well as in users’ wallets. Among the Layer-2s Arbitrum and Optimism are the clear leaders in TVE (combined total of $3.7bn), highlighting the maturity of optimistic rollups in the space. Below we show the leading Layer-2s by TVE.
Conclusion
Layer-2s seem to be the solution that Ethereum has needed for many years. They offer users cheap and faster transactions while borrowing the strengths of decentralisation and security from the Ethereum network. In fact, an upcoming upgrade to Ethereum, EIP-4844, will make transactions on Ethereum Layer-2s an order of magnitude cheaper. At current demand levels, this would potentially make transaction fees on chains like Arbitrum, Optimism and zkSync, fractions of a cent.
The design space for Layer-2s is largely unexplored with many different variations arising from different parts of the world. This free-market approach to scaling Ethereum may actually give it a leg up when compared to competing Layer-1s. All in all, the technological fundamentals are improving and the future of Layer-2s seems bright.