Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC8000, which defines an Operator contract that enables batch execution for EOAs without migrating them to smart contract accounts.

This article explains the proposal below as covered on April 6, 2026. The existing figures and sequence diagram retain their original Japanese labels.

I also cover various EIPs, BIPs, SLIPs, CAIPs, ENSIPs, RFCs, and ACPs.

Overview

Architecture

ERC8000 consists of two components: Operator and Operated.

The following figure shows the overall ERC8000 flow, including how transient storage preserves the sender's identity.

Internal execution flow of the Operator

The sequence diagram provides a more detailed view.

sequenceDiagram
    participant EOA as EOA(ユーザー)
    participant Op as Operatorコントラクト
    participant C1 as OperatedコントラクトA
    participant C2 as OperatedコントラクトB

    EOA->>Op: execute([callA, callB])
    Note over Op: msg.senderをTransient Storageに保存
    Op->>C1: callA(callData)
    C1->>Op: onBehalfOf()
    Op-->>C1: EOAのアドレス
    Note over C1: _msgSender() = EOAアドレス として処理
    Op->>C2: callB(callData)
    C2->>Op: onBehalfOf()
    Op-->>C2: EOAのアドレス
    Note over C2: _msgSender() = EOAアドレス として処理
    Op-->>EOA: 各コールの戻り値

The sequence proceeds as follows:

  1. The EOA calls execute, submitting the calls it wants to execute together to the Operator.
  2. The Operator stores the sender's EOA address in transient storage and executes each call in sequence.
  3. Each target contract uses _msgSender() to call the Operator's onBehalfOf() and retrieve the actual EOA address.
  4. The target contract executes its logic with the EOA correctly identified as the sender.

Why use transient storage?

The Operator could use an ordinary storage variable to retain the sender's address. Ordinary storage persists after the transaction ends, however, creating the risk of a subsequent transaction reading a stale address.

EIP1153 introduced transient storage, which is automatically cleared at the end of the transaction. This eliminates persistence beyond the transaction and enables the Operator to retain accurate sender information safely.

For more on EIP1153, see the following article.

[EIP1153] Understanding Transient Storage in the EVM

Motivation

EOAs, SCAs, and the user experience

The following figure compares conventional EOAs with batch execution using ERC8000.

Comparison of separate EOA transactions and ERC-8000 batch execution

A conventional EOA executes approve and transferFrom in separate transactions, requiring two confirmations. With ERC8000, the Operator is intended to combine compatible calls into one transaction.

Ethereum wallets fall into two broad categories.

An EOA (Externally Owned Account) is an ordinary account controlled by a private key, as used in wallets such as MetaMask. An SCA (Smart Contract Account) is an account implemented as a contract and can offer advanced features such as batch execution and gasless transactions.

A typical usability problem for conventional EOAs is the two-step approve → transferFrom flow. For example, when swapping tokens on a DEX, the user first sends a transaction approving token spending and then submits a separate swap transaction. Executing two transactions in sequence requires two confirmations and, as the original article describes, doubles the associated confirmation and gas costs.

What EIP-7702 solves and what remains

EIP7702 introduced a mechanism for delegating code to an EOA, allowing it to behave like an SCA. A wallet supporting EIP-7702 can therefore offer batch execution.

In practice, many users continue to operate conventional EOAs without EIP-7702. At the time of the original article, EIP-7702 had not yet seen widespread adoption. Some users did not want to migrate to a compatible wallet, while others were reluctant to delegate code at all.

ERC8000 proposes a lightweight mechanism for offering these users the batch-execution experience without EIP-7702.

Specification

The specification defines two components:

Operator An intermediary contract that receives a batch-execution request from an EOA and executes multiple contract calls in sequence.

Operated An abstract contract that overrides _msgSender() to support calls from the Operator. Inheriting it enables a target contract to retrieve the actual EOA address correctly.

IOperator interface

The Operator contract implements the IOperator interface. Running the Operator as a singleton (a single deployed instance) is strongly recommended. Sharing one Operator across multiple Operated contracts concentrates security auditing efforts and improves confidence in the implementation.

The IOperator interface is defined as follows:

javascript
pragma solidity ^0.8.29;

interface IOperator {
    struct Call {
        address target;
        uint256 value;
        bytes callData;
    }

    function execute(Call[] calldata calls) external payable returns (bytes[] memory returnData);
    function onBehalfOf() external view returns (address sender);
}

The Call struct describes a call to be executed.

Field Type Description
target address Address of the contract being called
value uint256 Amount of ETH to send
callData bytes Call data (function selector and arguments)

execute

This function executes multiple calls submitted by an EOA as a batch.

  • Parameters

    • calls — Array of calls to execute
  • Return value

    • returnData — Array of byte sequences containing the return data from each call

If any call fails, the entire batch reverts. The function returns the results of all calls together.

onBehalfOf

This function lets a target contract retrieve the address of the actual caller (the EOA).

  • Return value
    • sender — Actual sender address within the call context

It returns a valid address only within the call context (while execute is running). Calling it outside that context causes a revert.

Operated contract

This abstract contract lets a target contract support calls from the Operator.

javascript
pragma solidity ^0.8.29;

import { Context } from "@openzeppelin/contracts/utils/Context.sol";
import { IOperator } from "./interfaces/IOperator.sol";

abstract contract Operated is Context {
    IOperator public immutable operator;

    constructor(address operator_) {
        operator = IOperator(operator_);
    }

    function _msgSender() internal view virtual override returns (address) {
        if (msg.sender == address(operator)) {
            return operator.onBehalfOf();
        }

        return msg.sender;
    }
}

The behavior of _msgSender() is as follows:

Caller Return value
Operator contract Actual EOA address returned by operator.onBehalfOf()
Any other caller Ordinary msg.sender

The target contract can therefore retrieve the correct sender for both direct calls and calls through the Operator. The design follows a similar approach to ERC2771, the trusted-forwarder pattern for meta-transactions.

ERC2771 defines a mechanism for gas sponsorship through meta-transactions, allowing a trusted forwarder to provide the signer's address instead of msg.sender. The Operated contract in ERC8000 applies this pattern to batch calls through the Operator.

[ERC2771] Meta-transactions and Gas Sponsorship

Additional considerations

Why omit calldata hashing and nonce management?

The Operator in ERC8000 deliberately omits calldata integrity checks (hash verification) and nonce management for replay protection. The design treats these as responsibilities of the wallet or frontend calling the Operator. Keeping the Operator as a simple execution intermediary makes the implementation compact and easier to verify.

Why choose transient storage?

Ordinary storage variables could retain the sender address, but their contents persist beyond the end of the transaction. EIP1153 transient storage is automatically cleared at the end of the transaction, eliminating that persistence risk. The onBehalfOf() call can reliably revert outside the call context through require. Transient storage is also less expensive in terms of gas than ordinary storage.

Why recommend a singleton?

The Operated constructor accepts any Operator address, but the design anticipates broad use of a singleton Operator. Sharing the same Operator across multiple Operated contracts concentrates auditing costs and facilitates community review.

Backward compatibility

ERC8000 does not require changes to existing smart contracts.

However, only contracts that inherit Operated and override _msgSender() can benefit from sender-aware batch execution through the Operator. If an existing contract does not support Operated, msg.sender will be the Operator address, and the contract will not identify the original sender correctly.

When compatible and incompatible contracts are mixed, batch execution applies only to Operated-compatible calls. The other calls require separate conventional transactions.

Security

Reentrancy protection

The Operator's execute uses ReentrancyGuardTransient, a reentrancy guard. Without protection, an attacker could reenter the Operator through a callback and overwrite the sender information in transient storage with another address. The nonReentrant modifier blocks this attack path.

Using a trusted Operator

The Operator address passed to the Operated constructor must identify a trusted contract. A malicious Operator could make onBehalfOf() return an arbitrary address, leading the target contract to trust the wrong sender. The proposal recommends a singleton Operator (a single deployed contract), so using a widely audited instance can reduce this risk.

Reference implementation

Operator implementation

The following is an example implementation of the IOperator interface defined by the specification.

javascript
pragma solidity ^0.8.29;

import {TransientSlot} from "@openzeppelin/contracts/utils/TransientSlot.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {ReentrancyGuardTransient} from "@openzeppelin/contracts/utils/ReentrancyGuardTransient.sol";
import {IOperator} from "./interfaces/IOperator.sol";

contract Operator is IOperator, ReentrancyGuardTransient {
    using TransientSlot for *;
    using Address for address;

    // keccak256(abi.encode(uint256(keccak256("operator.actual.sender")) - 1)) & ~bytes32(uint256(0xff))
    bytes32 private constant MSG_SENDER_STORAGE = 0x0de195ebe01a7763c35bcc87968c4e65e5a5ea50f2d7c33bed46c98755a66000;

    modifier setMsgSender() {
        MSG_SENDER_STORAGE.asAddress().tstore(msg.sender);
        _;
        MSG_SENDER_STORAGE.asAddress().tstore(address(0));
    }

    function onBehalfOf() external view returns (address _actualMsgSender) {
        _actualMsgSender = MSG_SENDER_STORAGE.asAddress().tload();
        require(_actualMsgSender != address(0), "outside-call-context");
    }

    function execute(
        Call[] calldata calls_
    ) external payable override nonReentrant setMsgSender returns (bytes[] memory _returnData) {
        uint256 _length = calls_.length;
        _returnData = new bytes[](_length);

        uint256 _sumOfValues;
        Call calldata _call;
        for (uint256 i; i < _length; ) {
            _call = calls_[i];
            uint256 _value = _call.value;
            unchecked {
                _sumOfValues += _value;
            }
            _returnData[i] = _call.target.functionCallWithValue(_call.callData, _value);
            unchecked {
                ++i;
            }
        }

        require(msg.value == _sumOfValues, "value-mismatch");
    }
}

Several implementation details are worth examining.

MSG_SENDER_STORAGE is a constant identifying the transient storage slot. It is calculated using a keccak256 hash to avoid collisions, following the storage-slot naming convention used in EIP-1967.

The setMsgSender modifier writes and clears transient storage before and after execute. When execute begins, the EOA address is written. Once execution finishes, the slot is cleared by overwriting it with address(0). Consequently, onBehalfOf() returns a valid address only within the call context and reverts outside that context through require.

execute is protected against reentrancy by the nonReentrant modifier. This is important because it prevents a target contract from calling back into the Operator and overwriting the sender information in transient storage.

For calls that send ETH, the implementation checks that the sum of each call's value matches msg.value. If the amounts do not match, it reverts with the value-mismatch error.

Example use of the Operated contract

The following example adapts a simple deposit and withdrawal contract to support the Operator.

javascript
pragma solidity ^0.8.29;

import {Context} from "@openzeppelin/contracts/utils/Context.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IOperator} from "./interfaces/IOperator.sol";
import {Operated} from "./Operated.sol";

contract OperatorCompatible is Operated {
    error InvalidToken();
    error InsufficientBalance();

    mapping(address => mapping(address => uint256)) public balance;

    constructor(address operator_) Operated(operator_) {}

    function deposit(address token_, uint256 amount_) public payable {
        if (token_ == address(0)) revert InvalidToken();
        address _sender = _msgSender();
        IERC20(token_).transferFrom(_sender, address(this), amount_);
        balance[token_][_sender] += amount_;
    }

    function withdraw(address token_, uint256 amount_) public {
        if (token_ == address(0)) revert InvalidToken();
        address _sender = _msgSender();
        if (balance[token_][_sender] < amount_) revert InsufficientBalance();
        balance[token_][_sender] -= amount_;
        IERC20(token_).transfer(_sender, amount_);
    }
}

When the contract is called through the Operator, _msgSender() returns the EOA address. Both deposit and withdraw recognize the EOA as the sender, so the balance mapping is also keyed by the EOA address. The original article illustrates the intended two-call user experience with approve(Operator, amount) → deposit(token, amount) in one transaction, eliminating the need for two separate confirmations.

Conclusion

This article examined ERC8000.

ERC8000 proposes batch execution through an intermediary Operator contract for EOAs that do not use EIP-7702 delegation. The Operator preserves msg.sender safely in transient storage during execution, and target contracts can identify the EOA by inheriting Operated. The aim is a practical way to improve the user experience without waiting for wider adoption of EIP-7702.

I also publish articles on the following platforms: