Skip to content

For dApps using Embedded Wallets

If you are using an embedded wallet provider (e.g. Privy, Dynamic, Web3Auth, Magic, ...) you're able to delegate your EOA to a Biconomy Smart Account (this is not possible with external wallets such as MetaMask, Rabby, etc... - for those, use Companion Account based execution)

Why EIP-7702

EIP-7702 is an upcoming upgrade to Ethereum and EVM blockchains which enables wallets to convert the user EOA wallets into Smart Accounts

With EIP-7702, wallets can drastically improve the UX for their users by offering smart account features, such as:

  • Gas Abstraction
    The ability to pay for gas with ERC20 tokens

  • Gas Sponsorship
    Wallets can sponsor user gas onchain and offer their users a different way of paying for their transactions (e.g. prepaid, postpaid, ...)

  • Batch Execution
    The ability to batch execute transactions with a single signature

  • Enable Automation
    Wallets can install (or enable apps to install) Session Keys on accounts, which provide a safe way to automate wallet actions. Session keys provide guardrails, meaning that the Session Key signer can only execute the exact transactions approved by the wallet/user. This can include enabling dollar cost averaging, TWAP selling, yield rebalancing, ...

The Most Comprehensive EIP-7702 Solutions Suite

At Biconomy, we have built the most comprehensive EIP-7702 solution on the market, enabling wallets to add all of the above mentioned features, as well as many advanced - Biconomy stack specific features:

  • Unified User Balances
    Wallets can present apps with a Unified Multichain Balance. The app can then "pull" the funds they need to the chain of their choosing. Wallets can work with solvers and bridges to provide this liquidity.

  • Cross-Chain Gas Abstraction
    Wallets can enable users to pay for gas with native or ERC20 tokens across chains. E.g. a user can pay for a transaction on Base with USDC or ETH on Arbitrum.

  • Native Scheduling and Automation
    The Biconomy MEE Nodes can commit to execute a transaction at some point in the future or to execute a series of transactions in some time period. For Biconomy integrators, this is available without installing a separate module.

Quickstart Guide for Developers

Install Packages

Install AbstractJS TypeScript SDK and viem

npm install @biconomy/abstractjs viem @rhinestone/module-sdk@0.2.7

Override the Smart Account Address

In order to create an EIP-7702 enabled wallet, you need to implement just one small change to the initialization process. When initializing your Nexus account instance, you need to override the accountAddress paramter to the address of your embbeded wallet EOA.

// Function which initializes your embedded wallets. For this, check the tutorials
// from the embedded wallet providers themselves. This function should result in a
// signer object.
const embeddedWalletEOA = initializeEmbeddedWallet()
 
// The multichain Nexus account 
const mcNexus = await toMultichainNexusAccount({
 
  // Make sure that the chains here are actually EIP-7702 enabled
  chains: [sepolia],
  transports: [http(), http(), http()],
  signer: embeddedWalletEOA,
 
  // Overriding the account address parameter here! You *must* set
  // this paramter to the EOA address in order to enable EIP-7702
  accountAddress: embeddedWalletEOA.address
}) 

Execute with MEE

After you have delegated your EOA to a Nexus Account with the EIP-7702 delegation, you're able to use the full feature-set of Multichain Orchestration, Smart Sessions and Gas Abstraction APIs. The only difference from the regular execution flow is that you have to set the delegate field to true!

const eip7702TxResult = await meeClient.execute({
  feeToken: {
    chainId: sepolia.id, // Pay for gas on Sepolia
    address: zeroAddress // Native token (ETH)
  },
  instructions: [ ], // Supertransaction instructions
 
  // This enables the EIP-7702 Flow
  delegate: true
})

From this guide you can see that adding EIP-7702 to your flows is as easy as overriding two properties in the standard MEE execution flow.