EIPs Explained

EIP-7701 · Withdrawn · Core · 2024-05-01

EIP-7701: Native Account Abstraction

A withdrawn proposal for protocol-level account abstraction: a new transaction type split into validation, payment and execution phases run by the account and an optional paymaster. Superseded by EIP-8141.

What problem does it solve?

On Ethereum, only an externally owned account (EOA) with an ECDSA key can start a transaction, and that same account must pay gas. Smart contract wallets work around this with ERC-4337, which runs a separate mempool, bundlers and an EntryPoint contract. That works, but it adds infrastructure, gas overhead and trust assumptions outside the protocol.

EIP-7701 proposed making this native: let a contract account define its own rules for validating a transaction, and let a separate contract (a paymaster) pay the gas, all as part of the core transaction format.

How it works

The proposal added a new EIP-2718 transaction type ("AA transaction") whose fields include sender, sender_validation_data, optional deployer and paymaster with their data, sender_execution_data, and separate gas limits for each phase.

A transaction runs as a series of top-level calls, each with a role:

  1. Deployment (only if the sender has no code yet): the deployer creates the account.
  2. Sender validation: the account checks the signature or whatever rule it uses.
  3. Paymaster validation (optional): the paymaster agrees to pay.
  4. Sender execution: the actual action.
  5. Paymaster post-op (optional): the paymaster settles up afterwards.

Two new opcodes tie this together:

  • CURRENT_ROLE returns which phase the code is running in.
  • ACCEPT_ROLE works like RETURN but also states which role the contract is accepting. If a validation phase does not end with a matching ACCEPT_ROLE, the transaction is invalid and cannot be included in a block.

A TXPARAM* opcode family (modelled on CALLDATA*) lets the account read transaction fields such as the nonce, the paymaster, or the signing hash. During these calls msg.sender is the fixed entry-point address 0x7701 and tx.origin is the sender.

Sample code

Shape of the proposed transaction payload (RLP, from the spec):

AA_TX_TYPE || rlp([
  chain_id, nonce,
  sender, sender_validation_data,
  deployer, deployer_data,
  paymaster, paymaster_data,
  sender_execution_data,
  max_priority_fee_per_gas, max_fee_per_gas,
  sender_validation_gas, paymaster_validation_gas,
  sender_execution_gas, paymaster_post_op_gas,
  access_list, authorization_list
])

Simplified processing order (pseudocode):

payer = tx.paymaster or tx.sender
charge(payer, max_gas * gas_price)
if no_code(tx.sender):
    assert call(tx.deployer, role=SENDER_DEPLOYMENT).accepted
assert call(tx.sender, role=SENDER_VALIDATION).accepted
if tx.paymaster:
    assert call(tx.paymaster, role=PAYMASTER_VALIDATION).accepted
call(tx.sender, role=SENDER_EXECUTION)          # may fail; tx still included
if tx.paymaster:
    call(tx.paymaster, role=PAYMASTER_POST_OP)
refund(payer, unused_gas * gas_price)

Things to know

  • Status is Withdrawn. The spec states it was superseded by EIP-8141 (Frame Transaction), which is the place to follow native account abstraction work.
  • The transaction type number was never assigned (TBD), and the proposal never shipped on mainnet.
  • For account abstraction you can use today, see ERC-4337 and the EOA delegation mechanism of EIP-7702.
  • The spec flagged a security point that carries over to any similar design: a contract that unintentionally contains an "accept" path could authorise actions, so tooling and auditors would need to flag it.

#account-abstraction #core #transactions #wallets #withdrawn

Details

Authors
Vitalik Buterin (@vbuterin), Yoav Weiss (@yoavw), Alex Forshtat (@forshtat), Dror Tirosh (@drortirosh), Shahaf Nacson (@shahafn)
Status
Withdrawn
Type
Standards Track / Core
Created
2024-05-01

Machine-readable: Markdown · JSON