Interpretation of blockchain layer1 and layer2
Layer1 and Layer2
First of all, it should be clear that the concepts of Layer1 and Layer2 do not only refer to the Ethereum network, but the OSI model (Open System Interconnection Reference Model, that is, the Open System Interconnection Reference Model) that draws on the computer network communication architecture in the industry. The blockchain logical architecture is divided into three layers - Layer0, Layer1 and Layer2.
Among them, Layer is its most common interpretation - the meaning of "layer". The so-called Layer1 and Layer2 are the first and second layers. Compared with the above figure, the 0th layer corresponds to the underlying protocol of the OSI model, which roughly includes the physical layer, the data link layer, the network layer and the transport layer. The first layer (Layer 1) roughly includes the data layer, the consensus layer and the incentive layer. The second layer (Layer 2) mainly includes the contract layer and the application layer.
According to this dimension, mainstream public chains such as the Bitcoin network and the Ethereum main network that we are familiar with belong to the category of Layer 1. However, among the current public chain projects, Ethereum is the public chain that runs the most smart contracts and DAPPs, and it is also the public chain with the largest locked asset value and average daily transaction volume. The discussion of different expansion schemes is also the most, so in this article, unless otherwise specified, the Layer 1 and Layer 2 mentioned are generally based on Ethereum. Generally speaking, in the Ethereum network, the main role of Layer 1 is to ensure network security, decentralization and final state confirmation, achieve state consensus, and serve as a credible "encryption court" in a public chain network. The rules of contract design are arbitrated, and trust is transferred to Layer 2 in the form of economic incentives; while Layer 2 pursues more efficient performance as its ultimate goal. From the above schematic diagram of the blockchain technology logic architecture, we can see that as the first Layer 2 network can undertake most of the computing work for Layer 1. In recent years, many projects have been built based on Layer 2, which separates transaction behavior from the main chain, reduces the burden on the first layer network, and improves business processing efficiency. achieve expansion. In this process, although Layer2 has only achieved partial consensus, it can basically meet the needs of various scenarios.
At present, it is more appropriate to compare the relationship between Layer 1 and Layer 2 with the relationship between the central bank and commercial banks: Layer 1 assumes the role of the central bank, while layer 2 is the major commercial banks. In the current mainstream financial system, all assets must be settled in the central bank, and the specific circulation process can occur in the central bank and commercial banks at the same time. Because if everyone goes to the central bank for settlement, business congestion is bound to occur. Of course, a better solution is to have commercial banks handle a large number of transactions first, and then each commercial bank and the central bank will settle the overall business. Make the entire financial system operate more efficiently and orderly. So the enlightenment we can get from this is that for the problems of transaction congestion and high fees in the Ethereum network, a feasible solution has been released - depositing the assets of Ethereum into Layer 2, and then the assets The flow trading links are all carried out on Layer 2, and only the final settlement process can be placed on Layer 1.
Layer2 solution
What are the layer2 solutions? I often hear people say roll up, what is this?
After a long story, there are many solutions: channels, plasma, Sidechain, rollups.
Channels
Also translated as state channels, the most famous being payment state channels. Off-chain transactions, on-chain synchronization status. Similar to offline payment and online settlement, this is a bit like Alipay, but it is not so convenient (of course, most applications of blockchain are not very convenient at present). The processing capacity of this TPS can be very large, because the off-chain processing can be very efficient. The problem is that this application is more like an operation agreed by the B-end user, and it is difficult to connect with smart contracts to meet the needs of retail investors. Of course, some people say that setting up channels, staking coins, and monitoring the status of channels is a disadvantage. In fact, the core reason is not this. Well-known channels projects, such as raiden, are ranked after 500 in market value. This technology is similar to the Bitcoin Lightning Network.
Plasma
Presented by Joseph Poon and Vitalik Buterin. Plasma has the same problem as channels and cannot scale general-purpose smart contracts. The most famous project is OMG. Vitalik came up with it, but later V God said that the rollup is still better, so everyone will go after the rollup.
Sidechain
Ethereum sidechains, in theory, Huobi Ecological Chain Heco, Binance Smart Chain BSC, and OKChain are all Ethereum sidechains. The side chain and the main chain are essentially two chains, and the data and state are not synchronized. Therefore, Ethereum fundamentalists, Vitalik and many other big names are not very supportive of the development of side chains in their hearts, "my technical code is yours, yours is still yours". However, the rapid development of Heco and BSC recently has expanded the entire Ethereum ecosystem to a certain extent. It can be generally understood that other layer2 solutions are considered as their own sons, and the sidechain sidechain is a godson, and a powerful godson. Where the people who eat melons are easy to use, where the benefits are high, and others are close and distant, I don't care very much.
Rollup
Rollup can be translated as "rollup". The words roll up are written separately and refer to "roll up".
So what is the rollup of layer2 to summarize? What to roll?
In one sentence: Aggregate multiple transaction information (status) on the side chain to generate a message (hash) and upload it to the Ethereum mainnet. The simplification is understood as the connection between the side chain and the main chain is opened, and it already exists. A rollup is equivalent to a sidechain without consensus nodes. Some project parties do not have the resources to engage in sidechains, and several servers engage in a rollup, regularly sending status information to the main chain to ensure that the information will not be tampered with.
The continuously updated state hash value under the main chain is uploaded to the main chain. The chain cannot independently verify whether the information is true or false. Zkrollup can verify this simple information. Currently, it is mainly transfer information.
There are many kinds of rollup schemes for optimistic rollup, such as Optimistic Rollups, ZK Rollups, Arbitrum, StarkEx, etc. The most well-known ones are Optimistic Rollup and ZK Rollups, and other types are more improved debug versions of these two. Optimistic rollups will run a virtual machine called OVM ((Optimistic Virtual Machine) that can execute the same smart contracts on Ethereum. It actually sounds a bit like the three major public chains (Ethereum side chains), so optimistic rollups and heco, Bsc is also closely related to DeFi. Optimism is an important project in the field of Optimistic rollups. Loopring, Deversifi, ZKSwap, zkSync, StarkWare and many other projects are doing rollup solutions.
Blockchains currently suffer from scalability issues, and despite being decentralized and transparent, transactions are slow and costly. There are three existing scalability technologies, including the introduction of optimized blockchain protocols for each validator node, such as DAG, Hashgraph, Avalance, etc.; immature sharding technology; and Layer- 2 solutions. Public chains are by far the most efficient way to reach global consensus, but also the slowest database. Therefore, we should let the blockchain only carry the most suitable and good things such as decentralization, and other issues such as scalability and privacy can be solved through solutions that expand outside the chain. Add another layer on top of the blockchain, using the blockchain as an anchor for security. At present, some of the existing solutions are used to expand payments, some are used to expand smart contracts, and some are used for off-chain computing.
We often complain about the slow and expensive problems of Ethereum, which is actually a scalability problem. Layer-2 is to solve such problems. It can be said for sure that it has not been solved yet, but just pointed out a way, whether it can be repaired to the end. , It’s hard to say, it’s also what this article wants to express, who can have the last laugh? One batch is lurking, and one is successful, and the villa can be realized by the sea.
Let's take a look at the leading projects in the Layer-2 sector. MaticNetwork is a second-layer scalability platform that enables fast, simple and secure off-chain transactions, not only payment transactions, but also generalized off-chain smart contracts. Transactions on the Matic side chain are characterized by high speed, low cost and security, and the main chain is responsible for settlement; Ethereum is Matic's first first-layer basic chain, with high throughput: the internal test network obtains a transaction speed of more than 10,000 TPS with a single side chain (lose to Solana); what is still being done is to add more side chains, to achieve horizontal expansion, and to achieve a more efficient scalable platform.
Horseshoe has risen 750 times so far. This project has always embraced Cosmos, and it has also taken the ride of NFT. The future is still bright.
The second leader is Near. NEARProtocol is a highly scalable base protocol that ensures fast enough support for DApps to run on mobile devices. What I want to do is to be the fastest path for developers to enter the market, and to be the most friendly smart contract platform for users and developers.
NEAR has risen 300 times so far, but ETH2.0 still has a few years to land. During this period, it is the window period of NEAR. If the sharding technology can be successfully implemented, it will develop its own ecology. This is a potential point , the space for sharding technology + ecological speculation still exists.
Elrond is a high-throughput public chain focused on providing security, efficiency, scalability and interactivity through adaptive sharding technology and a new secure proof-of-stake consensus mechanism. In fact, among these three projects, EGLD is not very talkable. All the technologies and directions involved, and it is found that many people are working on the line. There is no novelty, but through speculation, the current increase has reached an astonishing fifty-two 10,000 times, it depends on whether the value behind this price is strong enough.
Last updated