Gas Abstraction and Creating Multichain AA Wallets

Gas Abstraction and Creating Multichain AA Wallets

On this page

TL;DR

ERC-4337 enables the users to outsource gas management without letting go of the control of their accounts. 

Account abstraction is a powerful concept that offers several compelling reasons for its adoption. By decoupling the execution environment from the account model, developers gain greater freedom in defining custom account structures and implementing complex logic within smart contracts. 

It also introduces the concept of paymasters, which are smart contracts capable of sponsoring gas fees and allowing users to pay the gas fees in ERC-20 tokens. We take this one step further by making the smart contract wallets interoperable across different chains and consequently, allowing multichain gas management as well.

Gas Abstraction

Arguably one of the most beneficial key features of ERC-4337 is gas abstraction, which enables smart contracts to abstract away the complexity of gas management from users. Instead of users needing to pay the gas fees for transactions, paymasters can pay the gas fees, providing a better user experience.

By decoupling smart contracts from externally owned accounts, ERC-4337 offers enhanced flexibility in designing and deploying complex decentralized applications. Developers can implement custom account structures and access control mechanisms, opening up new possibilities for creating innovative DeFi protocols, NFT marketplaces, and decentralized exchanges (DEXs).

It is, however, not a silver bullet to all the UX problems with managing gas…

The Limits of Account Abstraction

When you deploy a smart contract account, it only exists on the specific blockchain where it was deployed. While the basic concept of account abstraction allows for more versatile and flexible smart contracts, these contracts are tied to the blockchain network. They may not be interoperable, and so does its gas management.

You can still deploy an AA wallet to exist on the same address on different EVM chains through the CREATE2 opcode. However, the challenge remains the same: You will still need to bridge information between these different contracts on different chains. To make it even more complex, you have to refuel gas on each of them to be able to use the AA wallet on multiple chains.

To be completely transparent, this is also a problem with externally owned accounts (EOAs) where the user has to constantly bridge and deposit just to cover gas. But account abstraction can pose more challenges because the state of smart accounts do not automatically sync on all chains and may need a relayer, plus it will cost a little more gas to send transactions with smart accounts than with EOAs.

Unifying Multichain Account Abstraction

The solution to this ‘account fragmentation’ problem is to creatively utilize an often overlooked feature of smart contract accounts: the flexibility of its transaction architecture. 

Take this example from Light. They introduced a novel approach to cross-chain interoperability by using a proto-state channel to communicate all the states of contracts in different networks. A unique schema for messages that separates the chainId from the main signature is passed onto this, and when the user signs a message, it creates a valid pre-signed payload for all networks. This pre-signed payload updates the state of the smart account whenever the user sends a transaction to a new chain. The gas is also managed across different chains

There are also other ways to communicate the state of smart wallets in different chains like interoperability protocols, but they can cost more for accounts that make frequent cross-chain transactions.

Taking Unified AA Further with MPC

Now picture this: the user navigates to a dApp and selects the option to sign in with their social media account. When they log in, they can see their balance and control the wallet through the website. And when they log in to another dApp on a different chain, they can use the same smart contract account to transact with it, without needing to bridge tokens for gas. Then they only sign once even for the most complex transactions like providing liquidity to a DEX. The experience is fast and web2-like, but the wallet is completely controlled by the user and not locked into just one platform.

That is what MPC on smart contract accounts can do. 

Implementing Multi-Party Computation (MPC) on smart contract accounts for decentralized wallets can be a game-changer, bringing advantages like:

  1.  Asset Fluidity

Web3Auth’s MPC facilitates smart account interoperability across different dApps, avoiding vendor lock-ins. Meanwhile the chain abstraction like the one mentioned with Light can make it easy for them to transact in different blockchain networks. This eliminates the need for users to bridge tokens for gas or navigate complex setup procedures when transitioning between different chains, streamlining the user experience and expanding the possibilities for cross-chain interactions.

  1. Accessibility

By integrating social login functionality and abstracting away gas fees, MPC makes blockchain technology more accessible to mainstream users who may be deterred by the complexities of managing private keys or navigating blockchain interfaces. This broader accessibility fosters greater adoption and engagement within the blockchain ecosystem, driving growth and innovation.

  1. Security and Control

Despite the simplified user experience, MPC ensures that users retain full control and ownership of their crypto assets. The decentralized nature of smart contract accounts protects the users' funds and personal information, mitigating risks associated with non-custodiality

  1. Flexibility

Smart contract accounts are programmable. They can execute predefined logic and perform a wide range of operations autonomously. Developers can deploy custom smart contracts tailored to specific use cases, enabling complex functionalities and access control.

The Road Ahead

While the concept of multichain smart contract wallets holds a lot of promise, it's important to acknowledge the challenges and complexities involved in their implementation. Web3Auth currently has Wallet Ecosystem, enabling assets inside smart wallets to be portable across dApps. 

Interoperability between disparate blockchain networks remains a significant hurdle for the mainstream user, so we are also working on a technology that will facilitate seamless cross-chain communication for smart contract wallets.

Moreover, ensuring the security and reliability of the code powering these wallets is paramount. This is why we have gone through such rigorous security measures as essential steps to safeguard users' funds and maintain trust in the ecosystem.

Are you interested in exploring a unified gas abstraction platform for MPC wallets with us? Let us know in the comments section!