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.

When an agent moves assets on-chain, knowing that the agent exists is not enough. For transfers and swaps, the application needs to determine whether the agent is authorized to carry out each specific action.

ERC-8273 defines an interface that uses an evaluation by a trusted attestor to authorize an agent's action for the duration of a single transaction. This article explains where that authorization is stored, what gets checked during execution, and which calls a DApp uses to verify it.

The specification is available here.

Overview

How the proposal works

In ERC-8273, an Attestor evaluates an agent's action in advance. If the action passes the evaluation, the Attestor calls attestAndCall on the registry contract. The registry saves an audit record and writes an authorization valid only for the current transaction to transient storage. The DApp is then called from the agent's wallet.

The DApp queries the registry with the calling wallet and the permitted action. If authorization exists, execution continues. Otherwise, the transaction reverts. At the end of the transaction, the EVM clears transient storage. Only the audit record remains on-chain.

ERC-8273 overview

The mechanism does not grant long-lived permissions. It authorizes the operation that was evaluated for the current transaction.

Attestation versus authorization

An attestation is on-chain evidence that an attestor has determined that a subject meets certain conditions. The ERC-8273 AttestationRecord stores who was evaluated, who evaluated them, and what was authorized in persistent storage.

A DApp does not decide whether to allow an operation now solely from that persistent record. It checks the transient authorization established for the current transaction.

flowchart LR
  A[Attestorの評価] --> B[監査レコードを保存]
  B --> C[一時認可をTSTORE]
  C --> D[DAppが認可を照会]
  D --> E[操作を実行]
  E --> F[トランザクション終了]
  F --> G[一時認可を自動消去]
  B --> H[監査レコードは残る]

Motivation

An agent ID identifies a particular agent. The ID alone cannot establish whether the agent should be allowed to perform a particular swap, mint, or administrative action.

ERC-8273 separates subject identity from per-action authorization. A capability represents a broad permission category, such as permission to perform DeFi operations. An actionDigest is a hash that binds a particular contract, function, and set of arguments.

ERC-8273 authorization scope

For example, when authorizing a swap of up to 1,000 USDC for WETH, the actionDigest can include the target contract, function selector, swap amount, recipient, and nonce. Changing the amount or recipient changes the hash, allowing the DApp to reject it as a different action.

An actionDigest of 0 indicates authorization that is not bound to a specific call. This form can be used for a coarse check, such as determining whether an agent has been attested. It must not be used for transfers, privileged state changes, or financial operations susceptible to reentrancy within the transaction.

Specification

Authorization data

The authorization scope is determined by the combination of the subject, capability, and actionDigest. The registry and the DApp use the same combination when writing and querying authorization.

js
// 交換を1回だけ認可する時の値
subjectId: 42
subjectType: keccak256("ERC8004_AGENT")
capability: keccak256("DEFI_SWAP_V1")
actionDigest: keccak256(abi.encode(<交換コントラクト>, <呼び出しデータ>, <nonce>))
wallet: <Agentウォレット>

The subjectId and subjectType are used to compute a subjectHash for lookups. The wallet is the wallet that the DApp checks as msg.sender. The evidenceHash can contain a hash of the evaluation report or signed evidence consulted by the Attestor.

ERC-8273 storage boundary

AttestationStatus

js
enum AttestationStatus { None, Recorded }

None is the default value when reading a nonexistent record. Standard records have the status Recorded. This status does not indicate whether the current action is authorized. Active authorization is checked in transient storage.

SubjectRef

js
struct SubjectRef {
    uint256 subjectId;
    bytes32 subjectType;
}

SubjectRef identifies the subject being evaluated. Since subjectId alone does not identify the namespace that issued the ID, subjectType specifies that namespace.

  • Fields
Field Description
subjectId Numeric identifier of the subject being evaluated.
subjectType Hash distinguishing the type of ID.

ExecutionRequest

js
struct ExecutionRequest {
    bytes32 profileId;
    bytes32 actionDigest;
    bytes data;
}

ExecutionRequest specifies how the registry calls a DApp from the agent wallet and which action to execute. The format of data depends on profileId.

  • Fields
Field Description
profileId Identifier selecting the execution profile.
actionDigest Hash binding the specific action. A value of 0 uses only the capability.
data Call data decoded by the execution profile.

AttestationRecord

js
struct AttestationRecord {
    uint256 subjectId;
    bytes32 subjectType;
    address attestor;
    bytes32 capability;
    bytes32 actionDigest;
    uint64 issuedAt;
    AttestationStatus status;
    bytes32 evidenceHash;
    address wallet;
}

AttestationRecord is a persistent record used to audit issued attestations. It is not where currently active authorization is stored.

  • Fields
Field Description
subjectId, subjectType The evaluated subject and its ID type.
attestor The attestor that issued the record.
capability, actionDigest The permitted capability and, where applicable, the specific action.
issuedAt The issuance timestamp.
status Status of the persistent record. Standard records are Recorded.
evidenceHash Hash identifying the off-chain evidence used in the evaluation.
wallet The agent wallet the DApp queries as the subject of authorization.

IERC165

supportsInterface

js
function supportsInterface(bytes4 interfaceId) external view returns (bool);

supportsInterface checks which ERC-8273 interfaces the registry implements. A DApp checks whether the required interface is supported before querying authorization.

  1. Provide the interface ID

    Pass the ID of the interface required by the DApp, such as IERC8273WalletAttestation.

  2. Receive the support status

    The registry returns true if it implements the interface.

  • Parameters
Parameter Description
interfaceId Four-byte identifier of the interface to check.
  • Return value
Return value Description
bool true if the interface is implemented.
  • Execution conditions

  • Caller

    A DApp that queries authorization or an application that displays interface support.

IERC8273

IERC8273 is the core interface for audit records, event logs, and read operations.

Attested

js
event Attested(
    uint256 indexed attestationId,
    address indexed wallet,
    bytes32 indexed capability,
    bytes32 actionDigest,
    bytes32 subjectHash,
    address attestor,
    uint256 subjectId,
    bytes32 subjectType,
    bytes32 evidenceHash
);

The Attested event is emitted when an attestation is issued. An indexer can query logs by wallet or capability and update an audit interface.

  • Fields
Field Description
attestationId Incrementing record ID within the registry.
wallet Agent wallet associated with the authorization.
capability Authorized capability.
actionDigest Hash binding the specific action.
subjectHash Lookup hash computed from subjectId and subjectType.
attestor The attestor that issued the record.
subjectId, subjectType The evaluated subject and its ID type.
evidenceHash Hash identifying off-chain evidence.

An attestationId is not unique across chains or registry contracts. An indexer records the combination of chainId, registry address, and attestationId.

isAttested

js
function isAttested(
    SubjectRef calldata subject,
    bytes32 capability,
    bytes32 actionDigest
) external view returns (bool);

isAttested uses the subject as a key and returns a bool indicating whether transient authorization exists in the current transaction. It can be used for display or off-chain checks in a simulation that establishes authorization in the same transaction.

  1. Compute the subject key

    Determine the transient storage key from subject, capability, and actionDigest.

  2. Read transient authorization

    Return true if a value exists, or false otherwise.

  • Parameters
Parameter Description
subject SubjectRef identifying the subject being evaluated.
capability Permission category.
actionDigest Hash of the specific action, or 0.
  • Return value
Return value Description
bool true if authorization exists in the current transaction.

Do not use this function as the authorization check for critical on-chain actions. Use getActiveAttestation, which reverts when authorization is absent.

latestAttestationId

js
function latestAttestationId(
    SubjectRef calldata subject,
    bytes32 capability,
    bytes32 actionDigest
) external view returns (uint256);

latestAttestationId returns the ID of the most recently issued audit record for the same subject and authorization scope. It does not return currently active authorization.

  1. Look up the persistent record

    Find the record with the same subject, capability, and action hash.

  2. Return the latest ID

    Return 0 if no record exists.

  • Parameters
Parameter Description
subject Subject being evaluated.
capability Permission category.
actionDigest Action hash, or 0.
  • Return value
Return value Description
uint256 ID of the latest audit record.

getAttestation

js
function getAttestation(uint256 attestationId)
    external view returns (AttestationRecord memory record);

This call retrieves an entire audit record by ID.

  1. Read persistent storage by ID

    Retrieve the AttestationRecord corresponding to attestationId.

  • Parameters
Parameter Description
attestationId ID of the audit record to retrieve.
  • Return value
Return value Description
record Audit record containing the issuer, subject, authorization scope, evidence hash, and wallet.

IERC8273ActiveAttestation

getActiveAttestation

js
function getActiveAttestation(
    SubjectRef calldata subject,
    bytes32 capability,
    bytes32 actionDigest
) external view returns (AttestationRecord memory record);

getActiveAttestation retrieves authorization for the current transaction using the subject as the key. It reverts if authorization is absent, making it suitable for DApp authorization checks.

  1. Query transient storage

    Read the authorization corresponding to the subject, capability, and action hash.

  2. Return the record or revert

    If an authorization ID exists, return the persistent record. Otherwise, revert the call.

  • Parameters
Parameter Description
subject Subject being evaluated.
capability Permission category.
actionDigest Action hash, or 0.
  • Return value
Return value Description
record Audit record corresponding to currently active authorization.

IERC8273WalletAttestation

isAttestedAddress

js
function isAttestedAddress(
    address wallet,
    bytes32 capability,
    bytes32 actionDigest
) external view returns (bool);

isAttestedAddress is a boolean query keyed by wallet. It can be used for display or indexer processing of simulated execution, but a DApp should not rely solely on this return value to enforce authorization for critical actions.

  1. Read the wallet's transient authorization

    Read the slot corresponding to wallet, capability, and actionDigest.

  2. Return whether it exists

    Return true if the slot contains an authorization ID.

  • Parameters
Parameter Description
wallet Agent wallet.
capability Permission category.
actionDigest Action hash, or 0.
  • Return value
Return value Description
bool true if authorization exists in the current transaction.

getActiveAttestationByWallet

js
function getActiveAttestationByWallet(
    address wallet,
    bytes32 capability,
    bytes32 actionDigest
) external view returns (AttestationRecord memory record);

getActiveAttestationByWallet is the authorization check a DApp uses when identifying the agent wallet as msg.sender. It reverts if authorization is absent.

  1. Hash the action in the DApp

    In action-bound mode, the DApp recomputes the same actionDigest from the call target, function, arguments, and nonce.

  2. Query using the wallet as the key

    Query the registry with msg.sender, capability, and the recomputed hash.

  3. Stop execution if authorization is absent

    Revert if the slot is empty.

  • Parameters
Parameter Description
wallet Wallet the DApp checks as msg.sender.
capability Permission category.
actionDigest Action hash recomputed by the DApp.
  • Return value
Return value Description
record Audit record for the currently active authorization.

ERC-8273 authorization check

IERC8273AtomicAttestation

attestAndCall

js
function attestAndCall(
    SubjectRef calldata subject,
    bytes32 capability,
    bytes32 evidenceHash,
    address wallet,
    ExecutionRequest calldata exec
) external payable returns (uint256 attestationId, bytes memory result);

attestAndCall is the sole issuance entry point, combining attestation issuance, transient authorization, and a DApp call. Only an authorized Attestor can call it.

  1. Validate inputs and permissions

    Confirm that the caller is an Attestor and that wallet, capability, and profileId are nonzero.

  2. Create an audit record

    Save the AttestationRecord in persistent storage and emit the Attested event.

  3. Authorize only the current transaction

    Write attestationId to transient storage for both the subject and the wallet.

  4. Call the DApp from the agent wallet

    Execute using the profile corresponding to profileId so that the DApp sees wallet as msg.sender.

  5. Propagate failures to the entire transaction

    If execution, profile validation, or the success check fails, revert the whole transaction, including the audit record and transient authorization.

  • Parameters
Parameter Description
subject Subject being evaluated.
capability Permission category.
evidenceHash Hash identifying the evaluation evidence.
wallet Agent wallet associated with the authorization and DApp call.
exec Execution profile, action hash, and execution data.
  • Return values
Return value Description
attestationId ID of the newly created audit record.
result Result returned by the execution profile.
  • Execution conditions

  • Caller

    An Attestor authorized by the registry.

  • Action hash

    When sending msg.value, actionDigest must be nonzero to bind the amount.

IAgentExecute

AgentCall

js
struct AgentCall {
    address target;
    uint256 value;
    bytes data;
}

AgentCall represents a DApp action invoked by the agent wallet. Multiple calls can be passed to executeFromRelayer as an array.

  • Fields
Field Description
target DApp contract to call.
value Amount of native tokens sent with the call.
data Call data containing the function selector and arguments.

executeFromRelayer

js
function executeFromRelayer(
    AgentCall[] calldata calls,
    bytes calldata authData
) external payable returns (bytes[] memory results);

executeFromRelayer is the agent wallet entry point called by the registry in the direct execution profile. Because the wallet itself calls target, the DApp receives the wallet as msg.sender.

  1. Validate the authorization data

    The wallet checks the chain, wallet, registry, profile, action hash, nonce, and validity period using authData.

  2. Execute the array of calls

    The wallet calls each target with its corresponding value and data.

  3. Return the results

    Return an array containing the return data from each call.

  • Parameters
Parameter Description
calls Array of DApp calls executed from the wallet.
authData Signature or session information authorizing the calls.
  • Return value
Return value Description
results Return data from each call.
  • Execution conditions

  • Authorization data

    The wallet validates authData, binding the caller, action hash, nonce, and validity period.

  • Caller

    The registry contract that selected the corresponding execution profile.

Execution profiles

An execution profile defines how the registry invokes a DApp from the agent wallet. Both profiles have the same authorization lifetime.

ERC-8273 execution profiles

Direct wallet execution

AGENT_EXECUTE_V1 is used with smart wallets implementing IAgentExecute or wallets using EIP-7702. The registry calls executeFromRelayer, and the wallet calls the DApp.

When actionDigest is nonzero, its calculation includes at least the array of calls and attestationId. The authData binds the chain ID, wallet, registry, profile, action hash, nonce, and validity period.

ERC-4337 UserOperation execution

ERC4337_USEROP_V1 is an execution profile for existing ERC-4337 wallets. The registry passes a UserOperation to the EntryPoint. The EntryPoint runs validateUserOp and execute.

The profile checks that the UserOperation's sender matches wallet. It also verifies that the intended action succeeded, for example through a DApp receipt or event proof, rather than treating the absence of a revert from the low-level handleOps call as proof of success.

sequenceDiagram
  participant A as Attestor
  participant R as Registry
  participant W as Agentウォレット
  participant D as DApp
  A->>R: attestAndCall
  R->>R: 監査レコードを保存
  R->>R: 一時認可をTSTORE
  R->>W: 実行を依頼
  W->>D: 操作を呼び出す
  D->>R: getActiveAttestationByWallet
  R-->>D: レコードを返す
  D-->>W: 操作結果
  Note over R: トランザクション終了時に一時認可を消去

Additional considerations

Why persistent audit records and transient authorization are separate

Persistent records allow auditors to determine who evaluated what after the fact. Transient authorization is cleared at the end of the transaction to prevent the same grant from being reused in a later transaction.

Why authorization failures revert

getActiveAttestation and getActiveAttestationByWallet revert when authorization is absent. This reduces the risk that a DApp receives a boolean result but forgets to check it before performing a critical action.

Why the registry must be trusted

ERC-8273 does not guarantee that every registry contract is equally trustworthy. Alongside interface support, a DApp explicitly selects a trusted registry address, a set of attestors, and an authorization policy.

Compatibility

How the proposal complements existing standards

ERC-8273 does not change how existing identity, token, or account standards work. A DApp uses ERC-165 to check support for the required interface before calling the appropriate authorization query.

ERC-8004 covers agent identity registration and asynchronous verification results. ERC-8273 complements it with synchronous authorization that can block a single on-chain operation.

For more on ERC-8004, see the following article.

https://qiita.com/cardene/items/6a280877dca6e1fc87af

EIP-1153 provides transient storage that is cleared at the end of a transaction. ERC-8273 uses it to hold authorization for the current transaction only.

Reference implementation

Combining issuance and execution

The reference implementation saves the audit record, then writes the same attestationId to transient slots for both the subject and the wallet. It then selects an execution profile.

js
function attestAndCall(...) external payable returns (uint256 attestationId, bytes memory result) {
    attestationId = _nextId++;
    _records[attestationId] = AttestationRecord(...);
    emit Attested(...);
    _attestTransient(...);
    result = _executeProfile(...);
}

If execution fails, the whole transaction reverts. This prevents the authorization or audit record from surviving when the intended operation fails.

Security

Include the action and nonce in actionDigest

A nonzero actionDigest includes the target contract, function selector, arguments, and a unique value such as a nonce. If native tokens are transferred, it also includes the amount. The DApp recomputes the hash according to the same rules and rejects authorization if the value differs.

Prevent reentrancy separately

Transient authorization remains available for the transaction's duration. In particular, when actionDigest == 0, authorization checks alone cannot prevent reentrancy within the same transaction. DApp contracts that perform critical operations use a reentrancy guard.

Monitor for compromised attestors

A compromised Attestor can issue new authorizations repeatedly within its permissions. Preventing an individual authorization from surviving into a later transaction is separate from limiting total losses while an attestor is compromised. Operators monitor Attested events, restrict the attestor's privileges, and prepare suspension and removal procedures.

Keep IDs on different chains distinct

An attestationId increments only within a particular registry contract on a particular chain. Audit tools and bridges record chainId, registry address, and attestationId as a single composite identifier.

Keep evidence references immutable

An evidenceHash identifies off-chain evaluation evidence. Do not use a mutable HTTP URL as the sole reference to evidence. Use content-addressed storage such as IPFS or signed evidence.

Conclusion

ERC-8273 is an interface for determining whether a particular on-chain action should be allowed, rather than merely identifying the agent. An Attestor evaluates the action, the registry creates transient authorization, and the agent wallet calls the DApp, all within one transaction.

The central idea is to avoid granting long-lived permissions and instead use authorization tied to the operation.