A new direction for Ethereum? This article understands the positioning, advantages and implementation methods of Layer3
IOBC Capital
2022-09-30 13:30
本文约4720字,阅读全文需要约19分钟
Layer 3 may open up a new space for Ethereum, but there are still many technical details to be resolved.

Original Author: Kamu Yuan

Vitalik discussed the concept of Layer 3 in a recent article. So, what is Layer 3?

Let's briefly review Layer 1 and Layer 2 first.

The ecological development of the early public chains, especially Ethereum, was limited by network performance. The number of transactions per second (TPS) that could be processed was relatively small, and the network was often congested, and the transaction gas fee was relatively expensive, which could not support high-performance applications. develop on it. In order to improve the scalability of the network, various expansion schemes have been proposed one after another.

There are two main routes for expansion:

  • One is in the original blockchain itself, that is,Expansion on Layer 1, so that the blockchain itself has a higher transaction capacity and processing speed. The main problem with this approach is that if scaling is done with larger blocks, the blocks will become harder to verify and the network will become more centralized.

  • The second is to add a layer to the blockchain, which is often saidLayer 2 expansion. This method does not put all activities (such as computing, storage, consensus) directly into the original chain (monolithic layer 1 blockchain), but throughModular Execution Layer, that is, some off-chain Layer 2 protocols to process a series of transactions. The smart contracts on the chain only do two jobs: process deposits and withdrawals, and verify that all actions that occur off the chain are in compliance with the rules.

The era of Rollup nesting dolls has begun? This article understands the positioning, advantages and implementation methods of Layer3

In the process of discussing the expansion of Layer 2, a new concept-Layer 3 gradually emerged.

Layer 3 is based on the idea that:

If a Layer 2 protocol can be added on top of Layer 1 to help process transactions to improve security and scalability, can an additional Layer 3 protocol be added on top of Layer 2 to continue to increase security and scalability?

first level title

Is continuous expansion feasible by stacking more layers?

Rollup is an expansion technology, mainly to solve the two bottlenecks in the expansion of the blockchain runtime: computing and data.

where the computational bottleneck can be defined byFraud proof or SNARK to solve, which relies on a small group of people to process blocks, and others only need to perform a small amount of calculations to verify the correctness of these processing results.

These schemes, especially SNARK, can be expanded almost unlimitedly, and a lot of calculations can be reduced to a proof by performing SNARK on SNARK.

But data is different.Rollup uses a series of tricks to reduce the amount of data that needs to be uploaded to the chain for a transaction. The size of a simple currency transfer is compressed from 100 bytes to 16 bytes, and a privacy-preserving ZK-SNARK transaction can be compressed from 600 bytes. to 80 bytes.

But Rollup still needs to maintainAvailability of on-chain data.That is to say, the data on the chain needs to be available and verifiable to the user, so that the user can independently calculate and verify the state of the Rollup, and can join as a validator when the existing validator is offline.

The data can only be compressed once, and the compressed data cannot be compressed again with the same compression logic.

so,Rollup on Rollup (multi-layer stacking) does not actually bring more benefits in terms of scalability.

first level title

If it is not suitable for general expansion, what is more reasonable to do with Layer 3?

Polynya describes what a viable Web3 network looks like in the article "Fractal Scaling". The article mentioned that trying to cram everything into one server and parallelize it in one server is far worse than bringing the concept of parallelism to the next level, that is,Add a new Layer 3 for parallel processing, so that the content can be extended to multiple servers. Parallel and specific expansion through fractal means, this is where we need layer 3. Any application that is computationally intensive will require rollups tailored to the application. This has several advantages:

  • Optimized applications with zero virtual machine overhead

  • No MEV, or limited MEV, i.e. harmful MEV can be mitigated with simple solutions

  • Choose fine-tuned hardware for a specific purpose (a general-purpose chain will always have some bottlenecks that are not suitable for a certain application).

  • Solving the Impossible Triangle of Transaction Quality - A small transaction fee can be paid, but spam can still be avoided through targeted anti-DDoS solutions.

Starkware also proposed their Layer 3 solution. The idea of ​​recursion it adopts can even be used on more levels to achieve fractal level solutions. An example of this ecology is shown in their proposal, shown below.

The era of Rollup nesting dolls has begun? This article understands the positioning, advantages and implementation methods of Layer3

Its layer 3 includes:

  • StarkNet, with Validium's data availability, is mainly used for some particularly price-sensitive applications.

  • The StarkNet system with better application processing performance for APP, such as the application of a specially designed storage structure.

  • Serving StarkEx systems like dYdX, Sorare, Immutable, and DeversiFi with Validium or Rollup data availability can bring scalability benefits to StarkNet.

  • A private StarkNet instance (also acting as L4 in this example) can implement privacy preserving transactions without including them in the public StarkNet.

Starkware mentioned three visions about Layer 3 in the article, and Vitalik also recognized these three modes in his article:

  1. Custom functions. That is, layer 2 is used for expansion, and layer 3 is used for specific functions, such as privacy.In this vision, instead of trying to provide "scalability squared", there are layers in the stack dedicated to helping applications scale, and then other layers provide custom functionality for different use cases.

  2. Custom extensibility. That is, layer 2 is used for general expansion, and layer 3 is used for customized expansion.Custom expansion may come in different forms: special applications that do not use EVM for calculations, Rollup that uses data format optimization to compress data for specific applications, etc.

  3. Customize security. That is, layer 2 is used for expansion without trust (rollups), and layer 3 is used for expansion of weak trust (validiums).first level title

Layer 3 cost

Rollup and validium need to make a trade-off between confirmation time and fixed cost. But Layer 3 can solve these.

Each transaction in Rollup has a very low fee: about 16-60 bytes of data, depending on the application.

But Rollup also has a high fixed cost, which comes from each time a batch of transactions needs to be submitted to the layer 1 chain: if it is an optimistic rollup, it needs 21000 layer 1 gas per batch, and if it is a ZK rollup, it will exceed 400,000 gas , if it is a quantum-safe STARK, it will require more than one million gas.

Of course, rollup can also simply choose to wait until there are transactions worth 10 million gas before submitting the entire batch of transactions, but this will cause a very long batch interval, forcing users to wait longer for high-security confirmations.

Therefore, they need to trade off in different schemes: longer batch interval and optimal cost, or shorter batch interval and increased cost.

In the article, Vitalik showed a ZK rollup with a batch cost of 600,000 gas and a fully optimized ERC20 transfer (23 bytes) with a cost of 368 gas per transaction. Assume this rollup is in the early adoption stage with a TPS of 5. Calculate the gas between each transaction and batch interval:

The era of Rollup nesting dolls has begun? This article understands the positioning, advantages and implementation methods of Layer3

If they have a lot of customized Validium and a custom environment for APP, they may not need to use 5tps. In fact, layer 3 can indeed solve this problem.ZK rollup in ZK rollup only has a layer 1 cost of about 8,000 gas(500 bytes for proof). This changes the above table to:

first level title

What are the advantages of Layer 3?

The advantages of Layer 3 are as follows:

  • Better scalability:Derived from the multiplier effect proved by recursion.

  • Application designers building layer 3 gain greater control.

  • privacy:For example, zero-knowledge proofs are applied to privacy-preserving transactions on open Layer 2.

  • Cheaper/simpler layer 2-layer 3 interoperability:The current deposit and withdrawal process between layer 1 and layer 2 is very expensive. In contrast, due to the cost-effectiveness of layer 2, these processes are not only attractive but also easy to implement when applied to layer 3. While the latency of moving assets between layer 2 and layer 3 may be higher than the latency between applications deployed on the same layer 2, cost and throughput are directly proportional.

  • Cheaper/simpler layer 3-layer 3 interoperability:Independent layer 3 will interoperate through layer 2 instead of layer 1. Layer 2 is obviously cheaper than its layer 1 counterpart. In the absence of layer 3, these would all run on layer 2, which would have to interoperate through the rather expensive layer 1.

  • Layer 3 acts as a "canary" network for layer 2:first level title

Implementation of Layer 3

Starkware introduced the specific implementation of layer 3 in their solution.

A classic layer 2 structure includes the following components:

  • Track layer 2 on layer 1Smart contract for state root(e.g. StarkNet smart contracts on Ethereum)

  • oneVerifier smart contractTo prove the validity of the state transition proof

  • On layer 1, it is used to manage tokens entering and exiting layer 2Bridge contract for deposit and withdrawal

  • Used on layer 2 as a token on layer 1Counterparty’s Token Contract, such as ERC20, ERC721

The era of Rollup nesting dolls has begun? This article understands the positioning, advantages and implementation methods of Layer3

A fractal layer 3 structure is shown in the figure below. Just place on layer 2State Tracking and Verifier Smart ContractValidity certificateValidity certificateRuns safely on layer 2. When layer 2 also uses the validity proofs submitted to layer 1, this becomes a very elegant recursive structure, and the compression advantage of layer 3 proofs can multiply the compression advantages of layer 2 proofs.

first level title

For dApp developers, there are several options for infrastructure:

For dApp developers, there are several options for infrastructure:

The advantage is that you can inherit the ecology (users) of Ethereum and its security, but for a dApp team, the development cost of Rollup is obviously too high.

The advantage is that you can inherit the ecology (users) of Ethereum and its security, but for a dApp team, the development cost of Rollup is obviously too high.

The cost of development will be lower (for example, dydx chose Cosmos), but you will lose the ecology (users) and security of Ethereum.

The cost of development will be lower (for example, dydx chose Cosmos), but you will lose the ecology (users) and security of Ethereum.

3. Develop a Layer 1 blockchain by yourself

Let's compare three cases:

Let's compare three cases:

  • safety:Alt-layer 1> Rollup > Cosmos

  • safety:Rollup > Cosmos > Alt-layer 1

  • Ecology/Users:Rollup > Cosmos > Alt-layer 1

  • Control:Alt-layer 1> Cosmos > Rollup

epilogue

epilogue

Layer 2 can reduce the gas cost of each transaction and improve the scalability of the chain. At the same time, Layer 2 retains the benefits of decentralization, common logic, and composability. Through the design of the recursive structure, Layer 3 may also inherit these advantages of Layer 2.

A common point of view at present is that some applications require specific customized services, and these services will be provided by Layer 3.

Layer 3 may open up a new space for Ethereum or blockchain, just like Rollup. But there are still many technical details that need to be resolved, and it will take time.

Original link

Original link

IOBC Capital
作者文库