Orchestrating with EIP-7702 Delegated EOAs
EIP-7702 enables developers to set smart account code to their EOA address.
This means that apps can set the Orchestrator smart account to their EOA address and get the best of both EOA Orchestration and Smart Account Orchestration
Key Benefits
The key benefits of EIP-7702 powered Orchestration:
- Users don't have to deposit funds to a new Smart Account (no onboarding friction)
- Users get all the benefits of smart account based orchestration such as:
- Chain Abstraction
- Unified Token Balances
- Multi-Chain Gas
Key Drawbacks
The key drawback of the EIP-7702 orchestration is that it's not available for any users using extension/external wallets. These wallets (such as MetaMask, Rabby, Trust, ...) don't allow for EIP-7702 delegations to be set to EOAs under their control. The EIP-7702 delegation is set by signing and posting a Type 4 EVM transaction, which these wallets will reject.
Who Can Leverage EIP-7702 Orchestration?
EIP-7702 orchestration is available to apps building on Embedded wallets such as Privy, Dynamic, etc... Since embedded wallets will allow the app to delegate the EOA to the orchestrator smart account, apps can easily leverage this functionality.
Using EIP-7702 Orchestration
Leveraging EIP-7702 orchestration is done in two steps:
Delegate
Sign an authorization message which will set the Nexus smart account code to your wallet.
Delegation is done by signign an EIP-7702 delegation message which will delegate the account to the Nexus 1.2.0. implementation address. Nexus 1.2.0. is our EIP-7702 compliant version of the Nexus smart accounts.
// This is the address of the EOA to which
// address we'll be "installing" the smart account to.
const eoa = privateKeyToAccount('0xPrivateKey')
// Create an instance of a viem wallet client and extend it with the
// required eip7702 actions.
const walletClient = createWalletClient({
chain: odysseyTestnet,
account: eoa,
transport: http(),
}).extend(eip7702Actions())
const authorization = await walletClient.signAuthorization({
// Address of the Nexus Proxy Singleton
contractAddress: '0x000000004F43C49e93C970E84001853a70923B03'
})
Initialize the account
Afer the EIP-7702 delegation has been set, you can use the same orchestration
as you would for smart accounts, with the only difference beign that you'd
need to override the accountAddress
parameter when initializing the
account.
// Override the accountAddress parameter to be the same
// as your EOA address.
const oNexus = await toMultichainNexusAccount({
signer: eoa,
accountAddress: eoa.address,
chains: [optimism, polygon, base]
})
To learn how to use orcehstration with smart accounts (including EIP-7702), read the Smart Account Orchestration guide.
Execute
The documentation for EIP-7702 powered execution is currently in development. If you're looking to integrate EIP-7702 powered multichain orchestration or multichain gas abstraction and sponsorships - reach out.