Ethereum Layer-2 Scaling Solutions
The core idea of Ethereum Layer 2 scalability is to build a second-layer network on the basis of the main chain to help Layer 1 share the network pressure to achieve overall efficiency improvement.
With the explosion of Ethereum's ecological application, the transaction volume of the Ethereum network has risen sharply, and the price of ETH has also risen rapidly due to ecological development.
The prosperity of DeFi has brought congestion in Ethereum, and users' frequent asset transfers to obtain maximum liquidity and mining profits continue to push up Gas fees. When ordinary users participate in these applications, transactions become slow, the network is congested, with high gas fees and high price of ETH, an ordinary Defi contract call can even reach dozens of hundreds of dollars.
Under this circumstance, the scaling of Ethereum is not only expected, but also the general trend. Only by alleviating this mechanism congestion and high handling fees, can the healthy development of the Ethereum ecology be realized.
Layer 1 to Layer 2
Basically, there are two ways to scale a blockchain:
Layer 1——Onchain scaling，to work on the main chain itself to improve transaction capacity.
Layer 2——Offchain scaling, to change how people use the blockchain. In other words, instead of putting all the interactions on the main chain, some can go off-chain to alleviate congestion.
Sharding is ETH 2.0's scalability solution that will take place when Ethereum moves its consensus mechanism from Proof of Work (PoW) to Proof of Stake (PoS). This is a complex, major upgrade, and it is a Layer-1 solution.
Sharding is a technique that takes large chunks of computational work and splits it into smaller pieces called "shards." But Sharding won't happen overnight as it's only one part of the larger Ethereum upgrade.
As a result, Layer 2 is on the track, and more are used. Layer 2 salability is the general term for the off-chain salability plan, which refers to putting part of the calculation process on the blockchain off-chain and transmitting the calculation results back to the blockchain, so as to achieve a improvement of the computing power of the blockchain. In contrast, Layer 1 scalability is to improve on the blockchain protocol to achieve scaling. While Layer 2 scalability does not change the blockchain protocol itself, scaling is achieved through the interaction of on-chain smart contracts and off-chain data.
The Basic Framework of Layer 2 Scalability
The core idea of Ethereum Layer 2 scalability is to build a second-layer network on the basis of the main chain to help Layer 1 share the network pressure to achieve overall efficiency improvement. The current Ethereum Layer 2 scalability technology architecture mainly includes: State Channel, Sidechain, Plasma, ZK Rollup, Optimistic Rollup, Validium.
The key points of the scalability mechanism of Layer 2 are the contract design of Layer 1, the protocol design of Layer 2, and the design of cross-chain data interaction, especially the process design of asset deposit and withdrawal.
Typically, the layer1 chain has higher security and liquidity, and the layer 2 is a new chain wanting to leech security and liquidity from Layer 1.
Ethereum Layer-2 Scaling Solutions
The picture shows the ecological development of Ethereum Layer 2 in March 2021. It can be seen that the ecological development of Ethereum Layer 2 is becoming more mature and is still developing vigorously. The Layer 2 track has become a focus of attention. However, the development of each technology is a process of continuous progress, not overnight. From the side chain scalability to the Rollup mechanism, each technology merges with each other and continues to evolve and develop.
The side chain is an independent blockchain with its own independent consensus mechanism. Security does not depend on the main chain, and more efficient consensus mechanisms such as DPOS and POA are often adopted. The focus of the side-chain technology route is the design of the cross-chain mechanism.
The basic principle of the cross-chain mechanism is to lock assets on the main chain and issue related assets on the side chain. If you want to return to the main chain, you only need to destroy the assets on the side chain and unlock the related assets on the main chain.
The state channel is that both parties of the transaction lock assets on the chain to create a payment channel and conduct transactions off-chain. When users withdraw assets from the main chain, they only need to submit the proof of multiple off-chain transactions to the main chain smart contract for verification. The state channel dilutes the processing fees of multiple transactions, and is especially suitable for small multi-frequency transaction scenarios.
On August 11, 2017, Vitalik Buterin and Joseph Poon published a paper titled "Plasma: Autonomous Smart Contract". This article introduces a new technology that can improve the processing efficiency of Ethereum.
Like the state channel, Plasma is a technology for processing off-chain transactions and needs to rely on the underlying technology of Ethereum to ensure its security. But Plasma's entry point is different. It can allow the creation of a "child" blockchain on the Ethereum main chain. These " child-chains", in turn, can also create their own "child-chains", and so on. Plasma is a technology that can implement an "unregulated" side chain. In other words, even if all validators on the "Plasma chain" conspire to commit evil, the assets on the Plasma chain are safe and can be returned to the main chain.
The Rollup mechanism refers to highly compressing transactions and uploading them to the main chain, and verifying the authenticity of the transaction package through zero-knowledge proof or fraud proof, which solves the problem of Plasma's data unavailability. The Rollup mechanism implements a hierarchical model in which data is on the chain and operations are off-chain, thereby ensuring the security of assets to the greatest extent.
The core problem of the Rollup mechanism is to verify the authenticity of the transactions in the compressed transaction package. For this problem, the solutions are mainly divided into two types: ZK Rollup based on zero-knowledge proof; Optimistic Rollup based on fraud proof.
ZK Rollup adopting zero-knowledge proof is to send the zero-knowledge proof corresponding to the transaction at the same time when sending the transaction package, and the smart contract verifies the authenticity of the transaction package through the zero-knowledge proof.
The overall process is as follows:
- The user transfers in and locks assets, and the Layer 2 state tree adds account information and generates corresponding assets;
- In the Rollup network, users sign and send transactions;
- The sorter collects transactions, compresses and packs them into a transaction package, generates a zero-knowledge proof, and updates the state tree according to the transaction package;
- The sequencer broadcasts the transaction package and zero-knowledge proof to the main chain;
- The smart contract verifies the authenticity of the transaction package through zero-knowledge proof, updates the value, and executes the corresponding transfer operation.
Optimistic Rollup uses Plasma's "fraud proof" method, that is, anyone can verify and question the data on the return chain. Once a problem is found, the data will be rolled back to ensure safety, but this method has a fatal problem is the existence of the verification period. Usually, the verification period is about 2 weeks, which means that when users want to transfer money from Layer 2 to Layer 1, they need to wait about two weeks.
Optimistic Rollup uses a side chain that runs parallel to the Ethereum main chain. After completing a batch of transactions, Rollup will propose a new status to the mainnet. For example, they matched and notarized the transaction. They can process about 300 smart contract calls per second or about 2,000 basic transfers per second. Since it is compatible with the Ethereum Virtual Machine (EVM), anything you do on Ethereum can also be done on Optimistic Rollup. This is a solution for extending general smart contracts and an easy way to migrate decentralized applications (Dapps) with a reasonable degree of security.
Validium is a layer 2 solution that has emerged in recent years. It uses zero-knowledge proof like ZK rollup. The difference is that Validium's asset data is stored off-chain, while ZK rollup is stored on-chain. This means that Validium has low security and is suitable for Dapps such as games that require less security trust.
Layer 2 Solutions Comparison
Compared with transactions on the Ethereum chain, it is cheaper and scalable
The security of the side chain itself and the security of the cross-chain process: Once the side chain fails, the assets transferred to the side chain are very likely to be lost
Single transaction costs are lower; transaction privacy is guaranteed; and the fund security of participants is guaranteed
Poor user experience and usability; poor scalability of the network scalability mechanism, making it difficult to achieve other operations outside of the chain transaction
Gas fee is fixed; it can ensure the safety of users' assets in the case of Layer 2 failure
Lack of flexibility, transaction data is not available
High degree of decentralization and verification efficiency, faster speed, higher throughput and scalability
The process of generating zero-knowledge proofs is complex and difficult, not only requires a lot of calculations, but also the customization development of applications is difficult, and it is difficult to realize a universal platform compatible with existing applications
It is easier to implement a common platform; compatible with EVM smart contracts, reducing the workload of developers, and greatly reducing the difficulty of project migration
The verification efficiency is low, and the transaction compression rate is also lower, so the capacity scalability capability is also worse
Uses zero-knowledge proof like ZK rollup, so it is more efficient and faster
Asset data is stored off-chain, lower security
The Classification of Projects of Layer 2 Scalability Solutions
What are the Layer 2 projects on the Mexo platform?
Polygon is a Layer 2 scalability platform that realizes fast, simple and secure off-chain transactions, not only payment transactions, but also generalized off-chain smart contracts. The mission of Polygon is to use a layer 2 scalability solution to promote large-scale applications using decentralization, scalability and security, and to use side chains for off-chain computing to achieve this, while using the Plasma framework and decentralized PoS network verifiers to ensure asset security.
Token name: MATIC
SKALE Network is a high-throughput, low-latency, configurable Byzantine fault-tolerant elastic blockchain network. The initial application scenario of the network will be the side chain of the Ethereum blockchain. SKALE Network uses Proof-of-Use. Proof-of-Use is a new built-in activation mechanism that requires users to mortgage tokens to help secure and expand the protocol.
Token name: SKL
Celer Network is a high-performance Layer 2 scalability platform that aims to achieve the grand vision of bringing the scale of the Internet into the blockchain and helping the commercialization of the blockchain through the above technological innovations. Celer Network has created a multi-person two-way generalized state connection channel, which can build fast, easy-to-use, low-cost and secure blockchain applications on the Internet scale through off-chain scalability technology and incentive encryption economics.
Token name: CELR
Loopring is an open multilateral transaction protocol between tokens based on ERC20 and smart contracts. Through this protocol, it is possible to establish a decentralized exchange application that does not require asset custody and fund freezing. Adopting decentralized technology, providing a zero-risk token exchange model, and allowing multiple exchanges to conduct off-chain matching and on-chain clearing and settlement of the same order through competition. The smart contract and zero-knowledge proof of the Loopring protocol allow the use of the ZK Rollup structure to build a high-performance DEX.
Token name: LRC
ZKSwap is a new set of exchange protocols based on ZK Rollup technology. The tokens on Ethereum are transferred to Layer 2 through ZK Rollup technology. Based on the continuously generated zero-knowledge proof, it guarantees the consistency of the state of Layer 1 and Layer 2, thus allowing all exchanges to occur on Layer 2, real-time redemption with zero gas cost can be achieved, and it has unlimited scalability. ZKSwap allows users to get rid of the limitations of Ethereum's TPS and block confirmation time, giving DEX a CEX (centralized exchange)-like experience, and at the same time control their own financial security in real time.
Token name: ZKS
Future Prospects for Ethereum Layer 2 Scaling
At present, the Layer 2 scalability technology of the Ethereum network is in a period of rapid development, and solutions are blooming. Each solution has its own advantages and has also received support from related projects and communities that match its own characteristics.
Layer 2 scalability is inseparable from cryptocurrency wallets, blockchain browsers, and market quotation websites to support and follow up the corresponding projects to provide a better user experience. Layer 2 scalability will reduce operating costs on the chain and promote the innovation of blockchain projects, thereby giving birth to deeper blockchain applications in fields such as games, DeFi, and virtual worlds.
Hope that in the coming time, we will see the rise of more Layer 2 projects. Of course, also hope that the Layer 2 scalability plan will achieve a more comprehensive development.
- ALEXANDER SKIDANOV: Overview of Layer 2 approaches: Plasma, State Channels, Side Chains, Roll Ups
- Ali Atiia: Layer-2 for Beginners
- Ivan: Comparing Layer-2 Ethereum Scaling Solutions
- Messari: An overview of the progress and advantages and disadvantages of various Ethereum Layer Scaling solutions
- This article was organized and edited by Mexo, please indicate the source for reprint.