An article exploring how to solve the L2 liquidity fragmentation issue

Foresight News
2024-02-09 15:24:54
Collection
Make using Ethereum as simple as it was before 2020.

Original Author: Tim Robinson

Original Compilation: Luffy, Foresight News

Why Do We Need Seamless Liquidity?

Last weekend, all my friends on Farcaster were talking about a hot new coin on Base: $DEGEN. Under FOMO, I checked my Rabby wallet to see how much I could invest:

An article discussing how to solve the L2 liquidity fragmentation issue

Well, I could put $500 into this token, but I just need to sell some other assets. What does my portfolio look like?

An article discussing how to solve the L2 liquidity fragmentation issue

Terrifying, almost every token is on a different L2. To get $DEGEN, I have to perform multiple cross-chain and trading operations. Even if the fees are low, the time required for cross-chain and exchanges is still frustrating.

We must solve this problem; our goal is to make the entire Ethereum ecosystem feel like a single network. Let’s see how unified liquidity can combine with wallet upgrades, how to abstract cross-chain, and make the cross-chain L2 experience feel like using a single chain.

No Need for Cross-Chain

Why are cross-chain bridges so bad right now? They have many flaws:

  • You have to visit a separate website, connect your wallet, approve, transfer, and pray it arrives at the other end…

  • Cross-chain transfers often take 5 to 30 minutes to complete, which is too slow; ideally, it should be under 10 seconds.

  • Most cross-chain bridges require locking liquidity on both networks. The more L2s we have, the more fragmented the liquidity becomes. Low liquidity makes it difficult to transfer large amounts of funds between chains, resulting in worse prices.

  • Only certain liquid tokens can be transferred cross-chain, and for most networks, these tokens are ETH and stablecoins.

  • There are some wrapped tokens that do not require locking liquidity and can support any token. However, after cross-chain, you will receive a non-native version of the desired token and must swap it for the real token to use in any DApp on the new network, which requires liquidity, so we end up in the same trap.

Most importantly, if we don’t need to cross-chain, why are we wasting millions of hours doing this?

Wallets and Applications Should Handle Cross-Chain Automatically

When you use a DEX or lending protocol, it should track your tokens across all chains. When you deposit tokens from another chain, it should automatically cross-chain them to the correct chain in the background, so the user experience should feel exactly the same as if you were operating solely on the Ethereum mainnet.

Applications and wallets want to achieve this, but the underlying infrastructure isn’t good enough yet. If completing a cross-chain transfer takes 10 minutes and you lose 1% of your tokens in the process, most users will be dissatisfied.

Let’s dive deeper into the infrastructure layer and see how to solve this problem.

How to Achieve Seamless Liquidity Flow

There are three main methods for unifying liquidity across L2 networks, each with different trade-offs but complementary to each other.

  • Shared ecosystem cross-chain bridges: Achieving seamless aggregated liquidity across the entire chain ecosystem.

  • Minting/burning tokens: Tokens can be transferred without limits between any supported chains.

  • Trustless native cross-chain bridges: Achieving aggregated liquidity across ecosystems.

Shared Interoperability Layer

When you cross-chain from the Ethereum mainnet to any L2, the process looks like this:

An article discussing how to solve the L2 liquidity fragmentation issue

How current cross-chain bridges work

Each cross-chain bridge is a smart contract on Ethereum, which we call a "native bridge." When you cross-chain to an L2, your assets will be locked on L1, and a copy will be minted on L2. These networks have the capability to mint any asset supported by their native bridge in unlimited quantities.

Despite having the same name, they are not referred to as wrapped assets, but assets that cross-chain from Ethereum to any L2 through the native bridge are actually wrapped assets because their contract addresses are different. The contract address for USDC on Ethereum starts with 0x a0b8, on Arbitrum it starts with 0x af88, on Optimism it starts with 0x 0b2c, and on Polygon zkEVM it starts with 0x a8ce.

These assets look the same because wallets and applications have an official asset list and display official icons, so users will never know the difference.

What if not every L2 had its own cross-chain bridge, but they all shared one? Assets could be minted on a shared chain called the interoperability layer and then minted on the destination L2. An article discussing how to solve the L2 liquidity fragmentation issue

How aggregated blockchain bridges work

Polygon calls this new design an aggregated blockchain.

What’s the benefit of this design? When transferring assets from one chain in this ecosystem to another, such as from Polygon zkEVM to OKX X1, it doesn’t have to go back to Ethereum through a traditional cross-chain bridge first. Instead, you can burn the asset and let the interoperability layer mint the exact same amount of assets on the target chain.

An article discussing how to solve the L2 liquidity fragmentation issue

Transferring funds on the aggregated blockchain

Now, the assets that cross-chain through the aforementioned interoperability layer are identical on every chain in the ecosystem. Assuming the interoperability layer is free to use and fast (Polygon claims their final completion time is under 20 seconds), you will be able to cross-chain any amount of assets between any L2 in the ecosystem for free in a matter of seconds.

Polygon and zkSync are both developing this interoperability layer for their ecosystems, and from the design documents shared by Optimism that include shared cross-chain bridges, they also seem to be exploring this area.

The downside of the interoperability layer is that it can only operate within a single ecosystem and requires all chains to use a single cross-chain bridge, which increases risk, but the benefits of allowing liquidity to flow seamlessly between all chains in the ecosystem outweigh this.

Since all tokens can be exchanged across ecosystems, your wallet does not need to display the chain where the assets are located or categorize tokens by chain. Instead, your wallet might look like this:

An article discussing how to solve the L2 liquidity fragmentation issue

When executing transactions across multiple chains, your wallet can simply show that you are using the "Polygon" network and automatically perform all cross-chain operations in the background.

This design is so wonderful; why wasn’t it completed sooner? ZK Proofs have only recently become fast and cheap enough to make this solution possible. The interoperability layer uses ZK Proofs for all minting/burning, so it can be completed in seconds without any challenge period.

Advantages

  • A fast, simple, standard way to transfer tokens between chains

  • Can transfer any number of tokens across chains without slippage

  • May be completely free to use

Disadvantages

  • Only applicable to a single ecosystem

  • A single cross-chain bridge is a single point of failure for the entire ecosystem

  • Must be designed from scratch and cannot be added to existing ecosystems without significant changes

Cross-Chain Tokens

Chains can delegate cross-chain functionality to the tokens themselves instead of relying on a shared ecosystem cross-chain bridge. Tokens need to implement mint/burn functionality and allow users to burn tokens at any time to mint them on another chain. An article discussing how to solve the L2 liquidity fragmentation issue

Migrating DAI from zkSync to Polygon without using the Ethereum mainnet

These mint/burn messages can be relayed through middleware (such as Layer Zero or Chainlink CCIP). Layer Zero is developing a project called Omnichain that will allow tokens to achieve this functionality.

Some tokens have already implemented this. Circle recently launched their Cross-Chain Transfer Protocol (CCTP), implemented across 8 different networks.

Since USDC has high liquidity across many networks and available liquidity has no upper limit, it may be the perfect intermediary for transferring assets between chains. Wallets can exchange the tokens you want to cross-chain into USDC, use CCTP to cross-chain that USDC, and then exchange it back for the token you want on the target chain. This can be achieved with minimal fees or slippage and handled automatically by your wallet.

The downside of delegating liquidity unification to tokens is that it must be implemented by individual tokens, and wallets and applications must know which tokens they can automatically cross-chain and which they cannot.

It also requires tokens to wait for chain completion before sending tokens, which can take minutes to hours, depending on how frequently data is written to Ethereum. If tokens do not wait for finality, it may lead to double spending by minting on the target chain and then recovering the send on the sending chain during a reorganization.

Another risk to consider is that token security relies on the security of each chain and relay system. If an L2 is compromised, it could mint new tokens by sending malicious messages to other chains (for example, claiming it burned tokens when it actually did not). The same could happen if a token relay or oracle is attacked. This would lead to the collapse of tokens across all chains.

Cross-chain tokens have been implemented in the Cosmos ecosystem through ICS-20 before. It solves the "one chain compromising tokens on all chains" issue by allowing tokens to track the path they took to reach the current chain. If token X is sent via chain A -> B -> C, and some X tokens are sent via A -> C, if chain B is attacked, the first set of X tokens will be worthless, but the second set of the same X tokens will still have value because they did not cross chain B. This creates an additional problem of token interchangeability that wallets and applications must solve.

Advantages

  • Tokens can be freely transferred on any L2 chain

  • Can transfer any number of tokens without slippage

Disadvantages

  • Chains must be secure; a compromised chain could jeopardize tokens on all chains.

  • Wallets must know which tokens can automatically cross-chain to simplify the user experience

  • Tokens must wait for finality before transferring, which can take minutes or hours

Trustless Native Cross-Chain Bridges

L2 chains with ZK cross-chain bridges can allow fast, free token transfers by trusting the native cross-chain bridges of other L2 chains. This can be achieved by users burning tokens on one chain and then using the burn proof to mint that token on the native cross-chain bridge of another chain.

For example, if Scroll checks the Linea cross-chain bridge and considers it secure (and cannot be made insecure through upgrades), they can set up a service to monitor the L1 state root of the Linea cross-chain bridge, allowing any user on Linea to publish proof of their burned tokens on Linea, with this burn transaction included in the L1 state root, and mint equivalent tokens on Scroll.

An article discussing how to solve the L2 liquidity fragmentation issue

Transferring tokens between two L2s without using the Ethereum mainnet

Vitalik’s this article goes into more detail about the process of chains checking each other's states.

This is similar to cross-chaining back to Ethereum and then cross-chaining to another L2, but this method saves on high L1 gas fees.

The current risk is that the number of tokens locked in these native cross-chain bridges may not match the number of tokens minted on L2, which is a core property of L2 that has not been compromised so far. In the example above, if a user transfers $1 million of DAI from Linea to Scroll, the Scroll cross-chain bridge will be short that $1 million of DAI, and if the user wants to withdraw a large amount of tokens from the native Scroll cross-chain bridge, there will not be enough available tokens. Cross-chain bridges can coordinate these discrepancies by transferring L1 tokens in bulk between each other or by maintaining bilateral trust between them, so that even after the Scroll cross-chain bridge is emptied, large holders can withdraw funds through the Linea cross-chain bridge.

Advantages

  • Tokens can be freely transferred between trusted chains

  • Can transfer any number of tokens without slippage

Disadvantages

  • If one cross-chain bridge is compromised, it may affect all bridges that trust it

  • Cross-chain bridges will lock and mint different amounts of tokens on their networks, which may lead to withdrawal issues.

Economically Secure Fast Finality Layer

These three methods have excellent scalability and security, but there is one flaw that significantly slows down transfer speeds: waiting for finality. Completing a block requires the sending network to write its data to Ethereum, which can take up to an hour, and then the Ethereum mainnet must complete, which can take another 15 minutes.

Through economic incentives, we can create "soft finality," where the economic value of the transaction is greater than its actual value. This can be achieved by nodes staking on services like Eigenlayer, where their stakes can be slashed, proving that the transaction has been completed. If the transaction is somehow reverted, the nodes will be slashed, and the slashing can be used to fill the gaps caused by the rollback.

The benefit of this approach is that transactions can be soft-confirmed in seconds, greatly speeding up all cross-chain token transfers.

This is something Near is investigating. The proof of sending/burning does not need to be written to Ethereum L1 and finalized; instead, the proof is written to a fast finality chain, where finality is guaranteed by Eigenlayer stakers, who will be slashed if there is a rollback or recovery. This tweet further details how it works.

Let’s see how this fast finality layer can improve all three token transfer methods:

  • The interoperability layer is already a fast final layer managed by ecosystem teams (Polygon, zkSync, etc.). It allows transfers within the ecosystem to take only a few seconds.

  • When tokens are minted/burned cross-chain, the fast final layer can prove that the transaction has been completed and will not be reverted, instead of waiting for the transaction to complete on Ethereum (which can take up to 20 minutes). Then, the target chain can trust that layer and mint immediately after verifying the transaction.

  • Similarly, when L2s trust each other’s cross-chain bridges, they can settle token transfers through this fast final layer instead of waiting for Ethereum.

Advantages

  • Token transfers can be completed in seconds.

Disadvantages

  • It is unclear how to use the slashing mechanism to fix potential double-spending vulnerabilities.

  • Relies on other layer chains that are not Ethereum to ensure security.

Future Wallet Experience

After implementing these new unified liquidity improvements, what additional steps are needed to make cross-L2 wallets feel like using a single chain? The remaining two biggest issues are cross-chain gas and integrating applications with the system.

Inter-Chain Shared Gas

If users are constantly crossing multiple chains, how do they obtain gas on all these chains to pay for transfer fees?

This issue is being addressed through account abstraction AKA EIP-4337 and paymasters. Paymasters are addresses that you can request to pay your transaction fees. Some wallets (like Avocado and Ambire) allow you to preload gas balances and then use that gas on any chain, similar to a prepaid debit card.

Another simple solution is Bungee Exchange Refuel, which obtains gas on one chain and provides you with a bit of gas on another chain. This is a worse user experience than paymasters and will leave users with a bit of gas on many chains, but it works for EOA accounts (standard non-smart contract accounts).

Gas-Free Applications

Paymasters also unlock the ability for applications themselves to run paymasters and pay all user transaction fees. This would allow anyone to use applications on their own chain without crossing the front bridge. The application can profit in other ways, such as selling goods or providing a free demo mode, but you must pay for the full experience.

Making Applications Easily Utilize Unified Liquidity

Many applications load user token balances by calling balanceOf, which is a slow process and does not work cross-chain. They are often unaware of tokens that may cross-chain from other networks.

This issue should be solved at the wallet level so that each application does not have to reinvent the wheel to support a multi-chain future. EIP-2256 introduces standard functions that wallets can implement, allowing all token balances to be loaded at once, although currently, this is only single-chain.

If wallets are multi-chain aware and know how to transfer tokens from one chain to another, they can inform applications of the cross-chain tokens that users can immediately use, and when users interact with applications, the wallet will automatically cross-chain them before executing the action.

Conclusion

I hope you now have a better understanding of how liquidity between future L2s will flow more seamlessly and how wallets can fully abstract the blockchain using these new technologies, making using Ethereum as simple as it was in 2020, without the high fees.

Thanks to Chad Fowler, Alejo Salles, Mike B, Montana Wong, and Centauri.eth for their feedback on this article.

ChainCatcher reminds readers to view blockchain rationally, enhance risk awareness, and be cautious of various virtual token issuances and speculations. All content on this site is solely market information or related party opinions, and does not constitute any form of investment advice. If you find sensitive information in the content, please click "Report", and we will handle it promptly.
banner
ChainCatcher Building the Web3 world with innovators