Chain Abstraction

The Most Obvious ‘Next Step’ in Blockchain UX: ChainID

José.Virtual | Aug 28, 2024

Blockchain is a type of hosting infrastructure for applications, like Microsoft Azure and Amazon Web Services (AWS). But unlike blockchain, Web2 infrastructure is abstracted from users.

For instance, when you log into Twitter, you are not required to create an AWS account. Or, if you switch tabs to pay for a ChatGPT subscription, you are not required to create a new account in Azure nor reconnect your Visa to this new backend.

Of course not, that sounds insane. And yet, this is the current reality in blockchain. But it is all about to change.

Source: Virtual Labs

What is Chain Abstraction?

Chain abstraction refers to radically improving Web3 UX by hiding blockchain complexities from the user. Chain abstraction is not defined by any single technology, but builds on early primitives such as account abstraction’s ERC-4337 and adds new ideas such as ChainID.

Chain abstracted protocols have three distinct advantages:

  • Elimination of wallet clicks
  • Elimination or abstraction of bridging frictions
  • Unification of liquidity

User Experience Before Chain Abstraction

Alice holds 1,000 USDC on Ethereum, secured by her private key. She wants to buy Iggy Azalea's $MOTHER.

  1. $MOTHER is live on Solana, which uses a different key pair, so Alice must install a new wallet, Solflare, and write down a new seed phrase.
  2. She connects to AllBridge, a cross-blockchain bridging provider, and transfers 490 USDC from Ethereum to Solana, paying ~$10 in fees and waiting 15 minutes.
  3. Alice needs Solana’s native gas token, $SOL, in order to process any transactions. She swaps USDC for wrapped $SOL on Ethereum and bridges again, waiting an additional 15 minutes.
  4. She connects to Jupiter Exchange and completes the swap.

This bridging process results in a frustrating user experience, rendering blockchain inaccessible to most users—especially with such seamless centralized alternatives, such as Coinbase and Binance.

User Experience After Chain Abstraction

Alice holds 1,000 USDC on Ethereum, secured by her private key. She wants to buy $MOTHER, but VDEX exists.

  1. Alice deposits 500 USDC into VDEX on Ethereum, or any app powered by Virtual Rollup 1.2.
  2. She buys $MOTHER.
VDEX Orderbook Chain Abstracted Flow

With chain abstraction, the user never even realizes they are trading on the blockchain. Their liquidity remains safe in one account on their preferred chain and the expensive and unsafe practice of bridging is eliminated.

ChainID

After seeing the promised land of seamless UX, the next logical question is how is chain abstraction possible while maintaining the same trust assumptions?

Definitions:

  • Virtual Labs utilizes ZK state channels running on a peer-to-peer gossip network in a turing-complete application layer we call Virtual Rollups
  • VDEX is the native perpDEX on Virtual Rollup
  • ChainID is the feature that accomplishes chain abstraction
ZK State Channel Flow on Single Chain

Here’s how it works:

Virtual Rollup 1.2 is made up of two parts: smart contracts that hold escrow and self-verified P2P state channels. All trades occur within the state channels while the smart contracts only handle deposits and withdrawals. So, it is the smart contract’s job to accept the deposit and create the state channel.

After the state channel is created onchain, the user receives the initial state root from the smart contract. Then, the user and VDEX each sign the subsequent trades, not dissimilar to a 2/2 multisig. The user and VDEX store each other's signatures on their own devices. Therefore, at any one time the user stores the deposit state root signature and N trade signatures. To withdraw and unilaterally claim their capital, the user runs a function to combine the previous signatures into one 520-bit withdrawal signature.

Here's the trick: the smart contracts deployed across multiple chains are identical. Therefore, this 520-bit withdrawal signature can be submitted across any chain that has deployed Virtual Rollup and holds enough liquidity. However, if the chains are identical, then why can a user not submit the same signatures across all chains and double-spend?

The deployed smart contracts are identical except for one variable: ChainID—the blockchain knows which chain they are in relation to other chains. For example, say that Ethereum is chainID:0 and Bitlayer is chainID:1. When the withdrawal signature is generated, its chainID is set to a specific value: 0,1,2... which represents the user’s desired withdrawal chain. Therefore the user can withdraw only on this chain and the signature will fail if submitted to the other near-identical contracts.

So, changing just 32 bits allows a sort of connected smart contract network, which forms the escrow of Virtual Rollup.

Additionally, although the purpose of Virtual Rollup is to eliminate bridging—and achieve sub-millisecond finality—users could employ VDEX’s liquidity to bridge funds as well.

Virtual Bridge

Virtual Bridge allows the user to bridge funds by depositing on one chain, submitting no trades, and immediately withdrawing on another chain. It is called Virtual Bridge not only after its maker, Virtual Labs, but also because it is not actually a bridge. But, people could use Virtual Bridge to move funds in the same way they use Binance or Coinbase to do so—as an exhcange for moving funds.

Unlike these other exchanges, Virtual Bridge, powered by Virtual Rollup 1.2 is theoretically trustless. The user does not need to trust VDEX as they verify the state transitions themselves (of course, there is always smart contract risk).

Another unintended benefit of the Virtual Bridge is that it allows for instant crosschain settlement. The reason bridges take so long is because transactions must finalize, or otherwise be at risk of a reorg. But if a user deposits and makes trades or earns yield, by the time they go to withdraw, the initial deposit has long been finalized. Thus, the withdrawal could be processed and sent immediately (within one blocktime).

Virtual Rollup Bridge Diagram

Conclusion

Chain abstraction will be accomplished by many different protocols using many different methods. We prefer the combination of ZK state channels and ChainID due to the inherent advantages of self-custody and sub-millisecond finality (in co-geographically located clients).

Perhaps the greatest advantage Virtual Rollup’s chain abstraction solution is that the user can hold all of their idle funds on a single blockchain of their choosing. Funds are not scattered across many blockchains—all with varying security and decentralization—which is a common concern for users.

Regardless of the methods used, it's clear chain abstraction is needed to provide a comparable user experience to Web2 apps. For further reading, check out our Docs and Whitepaper, and integrate Virtual Rollup 1.2 here.

X | Discord | LinkedIn | YouTube

Clicky