Author: Ashley. H, Gate.io Researcher
1. The relationship between layer 1 and layer 2 can be approximately analogized to the central bank and other commercial banks.
2. The layer 2 solutions are widely considered the future of large public chains, especially Ethereum.
3. Each side chain is an independent blockchain which has its own basic layer and consensus mechanism and can safely transfer assets with the main chain through a cross-chain bridge.
4. Plasma is a special side chain as well. It calculates the hash values of blocks containing trades, and uploads the hash values of these blocks to the main chain through smart contracts.
5. Rollups have many excellent features. Therefore, it stands out among a number of layer 2 solutions and has become a new favorite in the market today.
6. Rollup sets the original data on the chain, mainly in ZK-rollup and Optimistic-rollup directions.
In the previous article “Essentials for Crypto Newbie: What Is Layer 0, Layer 1 and Layer 2?
” and “Crack The "Impossible Triangle": Overview of Layer 1 Solutions
”, we introduced the six layers of blockchain systems, the widely discussed scaling topic: Layer 0/1/2 and the significant layer 1 solutions in history. In the article, we will continue with a brief overview of the layer 2 solutions of blockchain.
Layer 2 corresponds to the contract layer and application layer in the six layers of the blockchain. In the field of scaling, layer 2, also known as off-chain scaling, refers to the performance solutions for scaling outside the main chain. Generally speaking, layer 2 aims to move the calculation process down the chain. Compared with the layer 1 solutions with many restrictions, the layer 2 solutions are widely considered the future of large public chains, especially Ethereum.
The relationship between layer 1 and layer 2 can be approximately analogized to the central bank and other commercial banks. If all trades need to be confirmed in the central bank, the system of the central bank will be absolutely overloaded and even congested. If other commercial banks can be set up to help process certain trading confirmations, the central bank only needs to conduct the final settlement of the trades, which can alleviate the operation burden of the central bank. Under this relationship, the layer 1 solutions are similar to improving the central bank, purchasing new hardware and improving its own computing power. The layer 2 solutions refer to the method of establishing a commercial banking system that can operate efficiently.
Common layer 2 solutions comprise Side Chain, Plasma, State Channels, Rollup, etc.
01/ State Channels
State channels are very early layer 2 solutions.
We know that the whole Ethereum network is a transaction-based state machine, which is composed of the states of many accounts. Each time a trade on the block is executed, the state machine will be modified to the latest state. Meanwhile, because each node of the whole Ethereum network needs to be updated to the latest state, the processing capacity of the main chain of Ethereum is relatively weak.
Graphic: Ethereum state machine model
In the above model, each operation needs to change the state machine to generate a new state. The idea of the state channels is to transfer the process of maintaining the state machine out of the chain. State Channels are actually nodes on the network, which constitute channels for direct connection between different users or between users and services. Specifically, the Lighting Network of Bitcoin
and the Raiden Network of Ethereum are the specific applications of state channel technology.
Among them, the Lighting Network of Bitcoin
can also be called a "payment channel". It is assumed that a large number of trades (or "micro trades") will occur frequently between the trading parties. If each such micro trade needs to be recorded and put on chain, it will bring processing burden. If these micro trades are processed through the payment channel, the intermediate processes are stored off the chain, and only the final trading results are submitted to the main network, then the burden of the main network can be greatly alleviated.
Therefore, the state channels do not require high computing power of the main network, and can compress trade and improve efficiency in some practical scenarios.
02/ Side Chain
Strictly speaking, the side chain is not a real solution, but a relationship between chains, that is, the corresponding relationship between the main chain and the side chain. Take the Ethereum side chain as an example. Each Ethereum side chain is an independent blockchain, with its own basic layer and consensus mechanism, and some of them have their own native proofs. However, the side chain needs to be compatible with Ethereum and can safely transfer assets with the main chain through a cross-chain bridge.
For example, Polygon and Skale are the side chains of Ethereum, and BSC, which supports EVM (Ethereum virtual machine) and can connect to the public chains of Ethereum, can also be considered the public chains in the broad sense of Ethereum. Take Polygon for example. The Gas fee rate of Polygon network is quite low, and the handling fee of each trade is less than $0.0001. Meanwhile, the TPS of Polygon can reach more than 7000, and the trade can be confirmed in a few seconds. In addition, Ethereum also has some side chains dedicated to some applications. For example, Ronin is a high-performance side chain specially set for on-chain games such as Axie Infinity.
On one hand, Because the side chains are independent blockchains and even have their own basic tokens, which makes the main chain and side chain in a delicate relationship of "complementation" and "competition". On the other hand, because the security of the side chain only depends on its own mechanism design, and has nothing to do with the main chain itself, it can not get any guarantee from the main chain, which makes the side chain an incomplete solution.
Plasma is actually a special side chain, but because it can borrow the main chain block, it is better than the general side chain in security. Plasma technology was proposed by Joseph Poon and Vitalik Buterin in an article entitled Plasma: Scalable Autonomous Smart Contract in 2017. When it was proposed, people placed high hopes on Plasma technology, and even thought that Plasma was expected to improve the processing capacity of Ethereum to the same level as Visa.
Compared with the side chain operating independently of the main chain, which only returns trading results and is vulnerable to attack. Plasma actually calculates the hash values of blocks containing trades and uploads the hash values of these blocks to the Ethereum main chain through smart contracts. On the one hand, because only the hash value of these blocks is uploaded, the amount of data actually put on the chain is very small. On the other hand, due to the existence of continuous hash value records, users can "challenge" when they suspect that the trades have been tampered with, so as to verify the authenticity of the trades. Therefore, this system has good security. When using it, the users need to lock the asset in the contract of the corresponding root chain and submit the corresponding proofs to the verifier. When a participant fails to provide the proof, the Plasma block will not be confirmed, and other users can safely exit from the chain to protect the security of assets.
However, during the operation of the Plasma, each subchain has its own mechanism to verify the block and realize an anti-counterfeiting proof. If all users try to exit at the same time, all valid states will be submitted for verification, which will also cause network congestion. This is also known as the so-called "batch exiting" problem. Meanwhile, Plasma can only trade assets and does not flexibly support smart contracts, which also limits the scope of Plasma as a solution.
Rollup has many similarities with state channel technology, but compared with state channels, Rollup, improved on Plasma technology, is more powerful and flexible. Due to many outstanding features, Rollup, which was born in 2019, stands out among a number of layer 2 solutions and has become a new favourite in today's market.
Plasma sets the original trading data off the chain, whereas Rollup places the original data on the chain. Specifically, it summarizes a batch of trading information into the recall data of a trade, and then periodically packs it into blocks and submits it to layer 1 to complete the record. Presently, Rollup technology has given birth to two main directions - ZK-rollup and Optimistic-rollup.
ZK-rollup combines Zero Knowledge Proof technology to upload the original transaction data to the chain, and uses Zero Knowledge Proof to automatically verify the effectiveness of the trades. However, all trading data needs to be proved, which leads to huge computational overhead and poor performance of ZK-rollup.
The Optimistic-Rollup uses Fraud Proof technology. As the name suggests, the concept of this technology is more "optimistic". After the original trading data is confirmed, it is "optimistically" assumed that all trades are valid and will not prove all information, but will only find invalid trades through Fraud Proof and "punish" the corresponding trading verifier.
Currently, slicing + Rollup is considered to be the optimal solution for Ethereum scaling. Perhaps in the near future, the dispute over scaling that has lasted for several years will come to an end. At that time, blockchains including Ethereum can finally break through the performance bottleneck and obtain new value. Let's all enjoy the brighter prospects.
Author: Ashley. H, Gate.io Researcher
*This article represents only the views of the researcher and does not constitute any investment advice.
*Gate.io reserves all rights to this article. Reposting of the article will be permitted provided Gate.io is referenced. In all other cases, legal action will be taken due to copyright infringement.