Risk Warning: Beware of illegal fundraising in the name of 'virtual currency' and 'blockchain'. — Five departments including the Banking and Insurance Regulatory Commission
Information
Discover
Search
Login
简中
繁中
English
日本語
한국어
ภาษาไทย
Tiếng Việt
BTC
ETH
HTX
SOL
BNB
View Market
A brief analysis of the development of Layer 2: cross-chain bridges, tokens and substitutability
星球君的朋友们
Odaily资深作者
2022-01-28 08:45
This article is about 2068 words, reading the full article takes about 3 minutes
No longer regard Ethereum as the initial source of everything, and get used to exploring the world of rollup freely.

Original source: The Way of Defi

Original compilation: Captain Hiro

Original source: The Way of Defi

Eric Wall tweeted the news the other day.

Some disturbing technical lessons I learned from EricaDAO's experiments:
Ethereum L2 (the second layer network) has some limitations that are not often discussed (at least I haven't seen any scientists discuss these issues). Although users can conduct transactions directly on L2, deploying contracts is not so easy.

It prompted me to think about how a token (or dapp, decentralized application) could be fully deployed on one L2, with plans to later expand to L1 (mainnet) or other L2s. Obviously, the experience Eric mentioned in the post was not friendly, so before we can figure out what happened to him, we need to first figure out what it means to be L2-first in this new world.

In fact, the problem Eric and his friends encountered was that when they first created a token on L2, they could not "cash out" it to L1.

We deployed an ERC20 contract on @arbitrum, but don't know how to withdraw tokens to L1.
Normally, if you want to withdraw your tokens from L2 to L1 (and you probably will, right?), you need to deploy a smart contract on L1 first, then deposit your tokens to L2. But then you have to pay all the on-chain fees and bridge fees.

The word "cashout" mentioned in Eric's post is very important, it has a very specific meaning. Let's first look at the current standard practice for scaling from Ethereum to L2. It operates as follows:

Here we have the two most basic operations of the cross-chain bridge: recharge on the left and withdrawal on the right.

In the example on the left, the token (DAI in this case) is locked on the L1 side of the Arbitrum token bridge. Then a related piece of information is passed between the chains, and a new token is minted on the L2 side, which we call "Arbitrum DAI". Note that the L1 and L2 tokens (DAI and Arbitrum DAI) are not the same. Maybe you think they are the same thing, but they are not. The above operation is called "recharge".

In the example on the right, we do the exact opposite, burn the previously minted "Optimism DAI", then send a message from L2 to L1 telling the L1 bridge to release the previously locked DAI. This operation is called "withdrawal".

To the end user, it feels like the same "DAI" is circulating on different mainnets and second-tier networks. In most cases, you can think of it this way, but if you are deploying a new token, you should be aware of the subtleties.

First, we need to understand the difference between a wrapped version of a token and a root token (the original token). In the example above, the root token is actually deployed on L1, which is considered "true DAI". Only one chain can host the root token. All the bridge can do is mint another token, which can be redeemed for the initially deposited DAI after minting is complete. This is exactly the same relationship between ETH and WETH.

Now, one of the prerequisites for all wrapped tokens to be redeemable for root tokens is that the total supply of any wrapped token must be less than or equal to the amount of root tokens locked in the bridge. As long as this relationship holds, tokens can be effectively swapped (the 7-day delay from L2 withdrawals is ignored here).

Now let’s look at the root token first being deployed on Arbitrum.

As you can see, the choice of where to put the root token is quite arbitrary. You can build a root coin and fork it from L1 or L2 to every other chain. We chose Arbitrum as the chain to deploy the root token because we can stick to Arbitrum without touching L1 (avoiding super high gas fees) until we are ready.

1. Security

1. Security

We mentioned the issue of fungibility earlier. If any of the tokens locked on one side of the bridge are stolen, the newly minted tokens are no longer backed and you lose fungibility. It is very possible for this to happen, but it is important to remember that similar to the barrel effect, your token is as secure as the weakest blockchain. This is why Ethereum is the best candidate for a root coin, as it can directly bridge to most other blockchains with just a few simple operations, and Ethereum itself is arguably the most secure blockchain one.

However, if we believe that L2 inherits the security model of Ethereum, then deploying root tokens on L2 should be no different in security than deploying on the Ethereum mainnet. For these smaller projects, it is very reasonable to start deploying projects from L2 in order to avoid the extremely high gas costs of the Ethereum mainnet.

2. Minting rights

Due to the asynchronous nature of cross-chain communication, if multiple chains are allowed to mint coins at any time, then we cannot provide token supply guarantees.

If you extend the ability to mint beyond the root chain, then you may run into a situation where the amount of tokens locked on the bridge becomes less than the total supply of the mint. This destroys the redeemability of the wrapped token, and thus its fungibility with the root token. We don't want that to happen.

A common practice is to mint root tokens on the bridge in advance, and notify the other party's "other minting rights contract", they can mint these wrapped tokens according to arbitrary logic as long as the amount of token allocation is not exceeded. This is how you allow simultaneous minting on multiple chains. This is easy with fungible tokens, but NFTs (Non-Fungible Tokens) pose some challenges because you may not know which tokens will be minted in advance. I'll leave that question for others as I'm not an NFT expert.

Original link

Original link

Layer 2
Cross-chain
Welcome to Join Odaily Official Community