ERC-7821: Minimal Batch Executor Interface

A minimal batch executor interface for delegations


Metadata
Status: DraftStandards Track: ERCCreated: 2024-11-21
Authors
Vectorized (@Vectorized), Jake Moxey (@jxom), Hadrien Croubois (@Amxx)
Requires

Abstract


This proposal defines a minimal batch executor interface for delegations. A delegation is a smart contract that implements logic which other smart contracts can delegate to. This allows batched executions to be prepared in a standardized way.

Motivation


With the advent of EIP-7702, it is possible for Externally Owned Accounts (EOAs) to perform atomic batched executions.

We anticipate that there will be multiple EIP-7702 delegations from multiple major vendors. To enable frontends to detect and prepare a vendor-agnostic batched transaction, we will need a standardized interface for batched executions.

In the absence of such a standard, vendors may choose to create their own proprietary implementations, causing fragmentation. Imagine visiting your favorite decentralized exchange and realizing that their frontend is still incompatible with your EOA delegation. The infamous approve and swap workflow cannot be fixed just by EIP-7702 alone.

We need a standardized batch executor interface.

Hence the utmost motivation for this proposal, which has been crafted for maximal simplicity, extensibility, performance and compatibility.

Specification


The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.

Overview

The minimal batch executor interface is defined as follows:


Recommendations

To support the approve + swap workflow on EOAs with delegations, frontends SHOULD:

  1. Query supportsExecutionMode(bytes32(0x0100000000000000000000000000000000000000000000000000000000000000)), ensuring that it returns true.

  2. Perform execute(bytes32(0x0100000000000000000000000000000000000000000000000000000000000000), abi.encode(calls)).

Rationale


We aim for radical minimalism to keep the standard as left-curved as possible. Simplicity is the key to adoption. Our North Star is to get every decentralized exchange to support the approve + swap workflow for EOAs with delegations as soon as possible.

execute and supportsExecutionMode

We have opted to use the execute and supportsExecutionMode functions in ERC-7579 for better compatibility with the existing smart account ecosystem.

While radical minimalism is the goal, some compromises have to be made in the pursuit for better adoption.

For minimalism, this standard does not require implementing ERC-165 and the executeFromExecutor function in ERC-7579.

Optional encoding of opData in executionData

The opData bytes parameter can be optionally included in executionData by either doing abi.encode(calls) or abi.encode(calls, opData).

Replacing address(0) with address(this)

For calldata compression optimization.

Backwards Compatibility


No backwards compatibility issues.

Reference Implementation



Security Considerations


Access controls for execute

Implementations should ensure that execute have the proper access controls.

Copyright


Copyright and related rights waived via CC0.