EIPs Explained

ERC-7988 · Draft · ERC · 2025-07-08

ERC-7988: Minimal Avatar Smart Wallet (MASW)

Proposes one fixed, immutable smart-wallet contract that EOAs delegate to via EIP-7702, offering signed batch execution, relayer fee reimbursement, and two plug-in modules for policy and recovery.

What problem does it solve?

EIP-7702 lets an ordinary EOA point its code at any contract, so the account can batch calls or have gas sponsored without moving funds. That freedom also means every wallet can invent its own ABI, signature scheme and fee convention, and relayers, dApps and indexers must support each one separately.

Minimal Avatar Smart Wallet (MASW) proposes a single, standard delegate: one immutable bytecode, one signed-batch format and one fee-reimbursement path, with customisation pushed into two optional modules.

How it works

  1. Deploy MASW with the owner's EOA as _owner.
  2. The owner sends a type 0x04 (EIP-7702) transaction delegating to it. From then on, the EOA is the "avatar" and MASW's code runs at the same address until the delegation is cleared or replaced.

The main entry point is:

function executeBatch(
    address[] calldata targets, uint256[] calldata values, bytes[] calldata calldatas,
    address token, uint256 fee, uint256 expiry, bytes calldata signature
) external;
  • The owner signs an EIP-712 Batch struct that includes a global metaNonce and an expiry. The domain separator binds chainId and uses the owner's address as verifyingContract.
  • Any relayer can submit it. Calls run in order and the whole batch reverts on the first failure.
  • If fee > 0, the wallet pays the relayer in ETH (token == address(0)) or an ERC-20. The fee is signed, so a relayer cannot raise it.
  • Policy module (optional): preCheck / postCheck hooks that can veto the batch.
  • Recovery module (optional): an alternative signer validated through an ERC-1271-style isValidSignature returning 0x1626ba7e.

Sample code

Signing a batch for a relayer (ethers v6):

import { Wallet, TypedDataDomain } from "ethers";

const domain: TypedDataDomain = {
  name: "MASW", version: "1", chainId, verifyingContract: owner.address,
};
const types = {
  Batch: [
    { name: "targets", type: "address[]" },
    { name: "values", type: "uint256[]" },
    { name: "calldatas", type: "bytes[]" },
    { name: "token", type: "address" },
    { name: "fee", type: "uint256" },
    { name: "exp", type: "uint256" },
    { name: "metaNonce", type: "uint256" },
  ],
};
const batch = {
  targets: [usdc], values: [0n], calldatas: [transferCalldata],
  token: usdc, fee: 50_000n, exp: BigInt(Math.floor(Date.now() / 1000) + 30), metaNonce,
};
const signature = await (owner as Wallet).signTypedData(domain, types, batch);
// relayer calls executeBatch(targets, values, calldatas, token, fee, exp, signature) on owner.address

Things to know

  • Status: Draft. The interface and reference implementation may change. The fee-transfer row of the spec is still marked TODO.
  • A single global nonce means two relayers racing on the same batch will produce one success and one revert. Short expiries limit the impact.
  • The core logic is immutable. Upgrading means sending a new 7702 delegation, and swapping modules requires an owner-signed transaction, so a malicious module is the main extension risk.
  • There is no built-in cap on batch size. Install a policy module if you want one.
  • As with any 7702 delegate, delegating to a contract gives that code full control of the EOA's assets. Review the exact bytecode before signing an authorization.

#wallet #eip-7702 #account-abstraction #batching #sponsorship

Details

Authors
0xMostafas (@MostafaS) <[email protected]>
Status
Draft
Type
Standards Track / ERC
Created
2025-07-08
Requires

Machine-readable: Markdown · JSON