ERC-7806 Intent-based EOA smart account (Minimal intent-centric EOA smart account)

Draft · Accounts & wallets · created 2024-11-02

A minimal interface standard where an EOA delegates code to an account contract via ERC-7702 and signs an intent containing the work to execute, letting a solver execute it on the EOA's behalf to support batch processing and gas sponsorship.

Why it is needed

ERC-4337 requires running several contracts together for account abstraction, including an Account, EntryPoint, Paymaster, and Bundler, which makes implementation complex, makes processing a UserOperation expensive in gas, and leaves paymasters and bundlers functioning as effectively centralized trusted parties. Plain EOAs, on the other hand, could not use features like batch execution or gas sponsorship at all. Now that ERC-7702 lets EOAs delegate code, EOAs have become programmable like smart accounts, but without a common interface to standardize this, each project ends up implementing it in incompatible ways. This standard defines a simple interface in which a permissionless solver verifies and executes intents signed by an EOA, aiming to support batch execution and gas sponsorship without a dedicated EntryPoint or bundler.

What to implement

In depth

UserIntent structure

UserIntent consists of sender (the address of the account that issued the intent), standard (the address of the IStandard contract that will validate and interpret this intent), header (metadata interpreted by the standard, such as the validation method or replay-protection information), instructions (the execution content interpreted by the standard, for example a concatenation of (address,value,calldata) tuples or standardized values like (erc20TokenAddress,1000)), and signatures (the signatures required for execution). instructions and signatures do not necessarily need to be fully filled in by the EOA owner; some parts may be filled in by a solver or relayer.

An encoding format packed into bytes

UserIntent is packed with no fixed schema as bytes calldata userIntent. One example format places the sender address in the first 20 bytes, the standard address in the next 20 bytes, followed by three uint16 values (2 bytes each) giving the lengths of header, instructions, and signatures, then the header, instructions, and signatures data for each of those lengths, with any remaining bytes usable as additional data such as a nested intent. Each IAccount and IStandard implementation can encode and decode this bytes value in its own way.

The role of the IStandard interface

IStandard validates whether an intent is valid via validateUserIntent(intent), and unpacks the intent into an executable operations array via unpackOperations(intent). Both functions keep their return type as bytes4 (or bytes) so that future extensions do not require changing the function signature. This role is similar to the EntryPoint in ERC-4337 and ERC-7521, but in a simpler form focused only on validation.

The IAccount interface and ERC-7702 delegation

IAccount exposes only executeUserIntent(intent). An EOA can use SET_CODE_TX_TYPE=0x04 to delegate its code to a single shared IAccount implementation, so the implementation only needs to be deployed and audited once, and each EOA owner is responsible only for delegating to a safe implementation. Account contracts are recommended to be stateless to avoid the problem of sharing storage with other delegate contracts.

Gas abstraction design

The sender can specify in the intent's header or instructions what and how to pay, and payment can be made in any token held by the sender account. Execution costs can be covered by transferring tokens from the sender account to the tx.origin that submitted the transaction, enabling a gasless experience where the EOA owner does not pay gas directly.

Why re-entrancy protection is not enforced

This standard does not globally enforce re-entrancy protection mechanisms such as nonces, because some intents are designed to be executed multiple times by nature. Instead, each standard defines its own rules for preventing reuse or duplicate execution as appropriate for its purpose.

The format of the reference implementation RelayedExecutionStandard

In the example RelayedExecutionStandard, the header is either 8 bytes (an expiration timestamp) or 28 bytes (timestamp plus a designated relayer address). The instructions consist of a (token address, uint128 amount) pair in the first 36 bytes to be paid to the relayer, followed by 1 byte for the number of instructions to execute, then each instruction prefixed with a uint16 length. The signatures are always 65 bytes and sign over the combined header and instructions. markHash prevents re-execution of the same intent.

Proposal status

This ERC is currently in Draft status, has not yet been finalized, and its contents may change or discussion may stall going forward.

Things to watch out for

Original ERC · ← ERCs