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.

Background

ERC-8107 lets AI agents decide who can participate in a task using attestations signed by ENS name owners. ENS is a naming service that lets users look up who owns an Ethereum name.

The official specification is available here.

Overview

ERC-8107 provides a way to decide whether to delegate work to another AI agent. An ENS name owner signs an attestation indicating that another name is trusted to participate in a particular kind of work.

For example, suppose gatekeeper.eth assigns work and does not directly know bob.eth. It trusts alice.eth, and alice.eth trusts bob.eth. If the application can verify both signed attestations, the gatekeeper can delegate work to Bob through Alice.

ERC-8107 calls the contract that stores these attestations and checks the submitted sequence of ENS names a Trust Registry. The application submits gatekeeper.eth, alice.eth, and bob.eth in order. The registry checks both adjacent attestations against the participation rules before accepting Bob.

Storing attestations signed by ENS owners and using them to choose who receives work

The diagrams retain their Japanese labels.

ENS names make ownership verifiable

The ENS Registry maps names such as alice.eth to their current owners. Looking up the owner shows whose judgment an attestation from alice.eth represents. ERC-8107 bases trust on the name owner's signature and does not attach a score directly to the agent.

Looking up the ENS name owner and having that owner sign the attestation

For more on how ENS associates names with owners, see the following article.

See the following article for more on ERC-137.

[ERC-137] How ENS associates names with addresses

Who submits an attestation?

An ENS name owner signs data that contains their own name, the other party's name, the purpose, and the expiry. The specification calls this signed data a TrustAttestation. The registry keys the stored record by trustor, trustee, and scope.

Who decides whether the candidate can participate?

The coordinator submits a sequence of ENS names that reaches the candidate. This sequence is a TrustPath. The registry checks attestations only between adjacent names. The application or an indexer finds the path, and the contract checks it against a scope, minimum trust level, expiry rules, and any requirement to pass through at least one trust anchor. The specification groups those settings in ValidationParams.

Motivation

With a centralized list of participants, a coordinating agent has to keep verifying candidates directly. To delegate to bob.eth without already knowing that name, gatekeeper.eth needs a way to use attestations by alice.eth. ERC-8107 gives the coordinator a sequence of signed statements it can verify.

A centralized participant list compared with a gate based on signed trust between ENS names

ERC-8001 defines a minimal way for several agents to divide work. It defines coordination types and participants and delegates the decision about admitting a candidate to an external module. ERC-8107 supplies an identity gate for that purpose.

See the following article for more on ERC-8001.

[ERC-8001] How multiple agents coordinate safely

Specification

When gatekeeper.eth relies on alice.eth to delegate work to bob.eth, each neighboring pair in the path must have an attestation that meets the gate's participation rules. The stored record represents an ENS name owner's decision about trusting another name for a scope. It does not measure the candidate's ability.

The specification has four trust levels.

Level Stored decision How a gate treats it
Unknown No decision about accepting or rejecting the trustee is stored for this pair. Cannot justify participation.
None A refusal is stored. Rejects a path containing this edge.
Marginal The trustor accepts the trustee to a limited extent. Usable when the gate's minimum is Marginal or below.
Full The trustor accepts the trustee as if it had verified the trustee directly. Usable even when the gate requires Full.

An Unknown record is missing. A None record represents an explicit refusal. The gate requires either Marginal or Full and accepts only attestations at or above its minimum.

An ENS owner signs an attestation and a relayer submits the signed record

Attestation contents and validity

The contract uses namehashes, fixed-length identifiers derived from ENS names. When gatekeeper.eth accepts alice.eth, it signs a TrustAttestation that says who trusts whom, for what purpose, and until when.

The scope identifies the purpose. For example, a trustor can record separate decisions about approving bob.eth for payments and for voting. The zero value bytes32(0) represents a general-purpose attestation. The nonce orders updates from each trustor. New attestations use a higher value, preventing an old signature from overwriting a newer record.

Interface overview

ITrustRegistry provides operations to store and read attestations, validate a path, and configure an identity gate. In the running example, the owner of alice.eth signs an attestation for bob.eth and someone submits it to the registry. The application then submits a path starting at gatekeeper.eth so the registry can decide whether Bob meets the gate's rules. Events expose changes, and view functions expose current values.

js
event TrustSet(bytes32 indexed trustorNode, bytes32 indexed trusteeNode, TrustLevel level, bytes32 indexed scope, uint64 expiry);
event TrustRevoked(bytes32 indexed trustorNode, bytes32 indexed trusteeNode, bytes32 indexed scope, bytes32 reasonCode);
event IdentityGateSet(bytes32 indexed coordinationType, bytes32 indexed gatekeeperNode, uint8 maxPathLength, TrustLevel minEdgeTrust);
event IdentityGateRemoved(bytes32 indexed coordinationType);

function setTrust(TrustAttestation calldata attestation, bytes calldata signature) external;
function setTrustBatch(TrustAttestation[] calldata attestations, bytes[] calldata signatures) external;
function revokeTrust(bytes32 trustorNode, bytes32 trusteeNode, bytes32 scope, bytes32 reasonCode) external;
function getTrust(bytes32 trustorNode, bytes32 trusteeNode, bytes32 scope) external view returns (TrustLevel level, uint64 expiry);
function getNonce(bytes32 trustorNode) external view returns (uint64);
function verifyPath(TrustPath calldata path, ValidationParams calldata params) external view returns (bool valid, bool anchorSatisfied);
function setIdentityGate(bytes32 coordinationType, bytes32 gatekeeperNode, ValidationParams calldata params) external;
function removeIdentityGate(bytes32 coordinationType) external;
function getIdentityGate(bytes32 coordinationType) external view returns (bytes32 gatekeeperNode, ValidationParams memory params, bool enabled);
function validateParticipantWithPath(bytes32 coordinationType, TrustPath calldata path) external view returns (bool isValid);

TrustAttestation

Field Purpose
trustorNode Namehash of the ENS name making the attestation.
trusteeNode Namehash of the ENS name being evaluated.
level One of Unknown, None, Marginal, or Full.
scope The purpose for which the attestation applies. bytes32(0) means a general scope.
expiry The expiry timestamp. A value of 0 means no expiry.
nonce The trustor-specific value used to order signed updates.

Only the ENS name owner can authorize this record. A relayer can submit the transaction, but the owner of alice.eth decides whom Alice accepts. EIP-712 defines how to sign the names, scope, expiry, and nonce together as structured data. Changing those fields invalidates the signature, so the relayer cannot replace the trustee or change the expiry.

See the following article for more on EIP-712.

[EIP-712] Hashing and signing typed structured data

A contract that owns an ENS name can use ERC-1271 to report whether it considers a signature valid. This lets contract wallets and ordinary wallets act as trustors. The relayer can submit a valid signature but cannot turn it into a different attestation. The signing domain includes the chain ID and Trust Registry address to prevent reuse across chains and registries. EIP-5267 lets signers read that EIP-712 domain from the contract and confirm which chain and registry the signature is for.

See the following article for more on EIP-5267.

https://qiita.com/cardene/items/3f0d49e6796d6f35d3218b

ValidationParams and TrustPath

A TrustPath is the sequence of ENS names from gatekeeper.eth to the candidate bob.eth. A path with [gatekeeper.eth, alice.eth, bob.eth] in TrustPath.nodes contains two edges to check.

ValidationParams specifies the maximum path length, minimum trust level per edge, permitted scope, whether expiries are required, and whether a path must pass through at least one eligible trust anchor. The maximum length can be set from 1 to 10, and the anchor list can contain up to 10 ENS names. The minimum edge level cannot be Unknown or None.

APIs that change trust

setTrust(TrustAttestation calldata attestation, bytes calldata signature) verifies the ENS owner's EIP-712 signature and sets the attestation. The submitter can be a relayer. The signer determines the content. The current draft uses controllerOf(node) to resolve the controller, including for names held in the ENS NameWrapper.

setTrustBatch(TrustAttestation[] calldata attestations, bytes[] calldata signatures) sets several records from the same trustorNode.

revokeTrust(bytes32 trustorNode, bytes32 trusteeNode, bytes32 scope, bytes32 reasonCode) changes the record to None, for example when alice.eth no longer accepts bob.eth.

Event Recorded change
TrustSet Sets or updates a trust level, scope, and expiry.
TrustRevoked Records an explicit revocation and its reasonCode.

APIs that read trust

getTrust(bytes32 trustorNode, bytes32 trusteeNode, bytes32 scope) returns the current trust level and expiry for the scope. An expiry of 0 means the record has no expiry.

getNonce(bytes32 trustorNode) returns the current nonce so the next signed update can use a higher value.

API that verifies a path

Checking the scope, trust level, expiry, and anchors of a submitted path

verifyPath(TrustPath calldata path, ValidationParams calldata params) takes a path already found by an indexer or application and checks adjacent attestations. The contract does not search for candidates. It checks only the submitted path.

The main conditions are scope, minEdgeTrust, expiry, maxPathLength, and the anchor candidates in requiredAnchors. The return value valid reports whether the path passes validation, and anchorSatisfied reports whether the required anchor condition is met.

ERC-8001 identity gate

setIdentityGate(bytes32 coordinationType, bytes32 gatekeeperNode, ValidationParams calldata params) configures the starting name and admission conditions for a coordination type. removeIdentityGate(bytes32 coordinationType) deletes that configuration. getIdentityGate(bytes32 coordinationType) returns the gatekeeper, parameters, and enabled state.

validateParticipantWithPath(bytes32 coordinationType, TrustPath calldata path) applies the configured gate to a candidate. In the example, it supplies the admission decision for Bob under Gatekeeper's policy.

Event Recorded change
IdentityGateSet Coordination type, gatekeeper, maximum path length, and minimum edge trust.
IdentityGateRemoved Removal of the identity gate.

ITrustRegistry

TrustSet

js
event TrustSet(
      bytes32 indexed trustorNode,
      bytes32 indexed trusteeNode,
      TrustLevel level,
      bytes32 indexed scope,
      uint64 expiry
   );

Emitted when an ENS name sets or updates its attestation for another name.

  • Fields
Field Details
trustorNode Namehash of the ENS name making the attestation.
trusteeNode Namehash of the ENS name being evaluated.
level The updated trust level.
scope The purpose of the attestation.
expiry Expiry timestamp. A value of 0 means no expiry.

TrustRevoked

js
event TrustRevoked(
      bytes32 indexed trustorNode,
      bytes32 indexed trusteeNode,
      bytes32 indexed scope,
      bytes32 reasonCode
   );

Emitted when an existing attestation is explicitly revoked.

  • Fields
Field Details
trustorNode Namehash of the name revoking the attestation.
trusteeNode Namehash of the name affected by the revocation.
scope The scope being revoked.
reasonCode Identifier for the reason for revocation.

IdentityGateSet

js
event IdentityGateSet(
      bytes32 indexed coordinationType,
      bytes32 indexed gatekeeperNode,
      uint8 maxPathLength,
      TrustLevel minEdgeTrust
   );

Emitted when an identity gate is configured.

  • Fields
Field Details
coordinationType ERC-8001 coordination type.
gatekeeperNode ENS name at the start of the admission path.
maxPathLength Maximum number of trust edges.
minEdgeTrust Minimum trust level per edge.

IdentityGateRemoved

js
event IdentityGateRemoved(bytes32 indexed coordinationType);

Emitted when an identity gate is removed.

  • Fields
Field Details
coordinationType ERC-8001 coordination type whose gate was removed.

Implementation errors

The implementation reverts with custom errors for invalid attestations or conditions. Callers can use the error to identify which input failed.

Error Condition What to check
SelfTrustProhibited A name attests to itself. Check that the trustor and trustee are different.
NonceTooLow The nonce is at or below the current value. Read getNonce and sign again with a higher value.
AttestationExpired The signed record has expired. Sign again with a new expiry.
InvalidSignature The ENS owner's signature cannot be verified. Check the EIP-712 domain and signing authority.
NotAuthorized The caller lacks authority to revoke a record or configure a gate. Check the relevant ENS owner or operator permissions, or the gate administrator role.
ENSNameNotFound The specified name is missing. Check the namehash and ENS registration.
TrustNotFound No record exists to revoke. Check the trustor, trustee, and scope.
GateNotFound The target identity gate does not exist. Check the coordination type and its gate configuration.
InvalidValidationParams The parameters are outside the allowed bounds. Check the path length, minimum trust level, and number of anchors.
BatchTrustorMismatch Batch records have different trustors. Use the same trustorNode for every record.
BatchNonceNotIncreasing Batch nonces do not strictly increase. Prepare the signatures with strictly increasing nonces.

setTrust

js
function setTrust(
      TrustAttestation calldata attestation,
      bytes calldata signature
   ) external;

Sets a trust attestation signed by an ENS owner.

  1. Verify the signer. Check the ENS owner of attestation.trustorNode, or the signature validated through ERC-1271 when a contract owns the name.
  2. Check update order. Require a nonce higher than the trustor's current value.
  3. Store the record. Store the trust level and expiry by trustorNode, trusteeNode, and scope, then emit TrustSet.
  • Arguments
Argument Details
attestation Signed data containing the trustor, trustee, level, scope, expiry, and nonce.
signature The ENS owner's signature under the EIP-712 domain.
  • Conditions

  • The attestation must carry a signature authorized by the ENS owner.

  • The nonce must be greater than the previous value.

  • The submitter can be someone other than the signer.

setTrustBatch

js
function setTrustBatch(
      TrustAttestation[] calldata attestations,
      bytes[] calldata signatures
   ) external;

Sets several attestations signed for the same ENS name.

  1. Pair the arrays. Match each item in attestations to its entry in signatures.
  2. Check the trustor and signatures. Confirm that all records share the same trustorNode and have valid signatures.
  3. Store the records. Set each attestation and expose each update through its event.
  • Arguments
Argument Details
attestations Array of attestations to set.
signatures Corresponding EIP-712 signatures.
  • Conditions

  • The arrays must have corresponding entries.

  • All records must use the same trustorNode, valid signatures, and new nonces.

revokeTrust

js
function revokeTrust(
      bytes32 trustorNode,
      bytes32 trusteeNode,
      bytes32 scope,
      bytes32 reasonCode
   ) external;

Changes a scoped attestation to None.

  1. Verify authority. Check that the caller is the ENS owner or an authorized operator.
  2. Invalidate the attestation. Set the trust level to None for that scope.
  3. Record the reason. Emit TrustRevoked with the reasonCode.
  • Arguments
Argument Details
trustorNode Namehash of the name revoking the attestation.
trusteeNode Namehash affected by the revocation.
scope Scope for the revocation.
reasonCode Identifier for the reason.
  • Conditions

  • The caller must be the ENS owner or an operator authorized by that owner.

getTrust

js
function getTrust(
      bytes32 trustorNode,
      bytes32 trusteeNode,
      bytes32 scope
   ) external view returns (TrustLevel level, uint64 expiry);

Returns the current scoped trust level and expiry between two ENS names.

  1. Identify the record. Look it up by trustorNode, trusteeNode, and scope.
  2. Return the result. Return its level and expiry.
  • Arguments
Argument Details
trustorNode ENS namehash of the trustor.
trusteeNode ENS namehash of the trustee.
scope The scope to read. bytes32(0) is the general scope.
  • Return values
Return value Details
level The current trust level.
expiry Expiry as a Unix timestamp. A value of 0 means no expiry.
  • Conditions

  • Anyone can read the record.

getNonce

js
function getNonce(bytes32 trustorNode) external view returns (uint64);

Returns the current nonce used to order signed updates.

  1. Specify the name. Use trustorNode to look up the trustor's nonce.
  2. Return the current value. Signers use this value to choose the nonce for a new update.
  • Arguments
Argument Details
trustorNode ENS namehash whose nonce to read.
  • Return values
Return value Details
uint64 The current nonce.
  • Conditions

  • Anyone can read the nonce.

verifyPath

js
function verifyPath(
      TrustPath calldata path,
      ValidationParams calldata params
   ) external view returns (bool valid, bool anchorSatisfied);

Checks an ENS path found offchain against attestations stored in the contract.

  1. Check the path shape. Inspect the nodes, edges, and path endpoints.
  2. Check adjacent attestations. Verify scope, expiry, and the minimum trust level for each edge.
  3. Check trust anchors. Return whether the path includes any required intermediate ENS name.
  • Arguments
Argument Details
path The submitted sequence of ENS names and its edge scopes.
params Rules for path length, minimum edge trust, and any requirement to pass through at least one trust anchor.
  • Return values
Return value Details
valid Whether the path meets the validation conditions.
anchorSatisfied Whether the required anchor condition is met.
  • Conditions

  • Anyone can call the view function.

setIdentityGate

js
function setIdentityGate(
      bytes32 coordinationType,
      bytes32 gatekeeperNode,
      ValidationParams calldata params
   ) external;

Configures the path's starting point and validation conditions for an ERC-8001 coordination type.

  1. Select the coordination type. Identify the configuration by coordinationType.
  2. Save the rules. Store gatekeeperNode and params, then emit IdentityGateSet.
  • Arguments
Argument Details
coordinationType ERC-8001 coordination type.
gatekeeperNode ENS namehash at the start of the path.
params Rules for path length, minimum edge trust, and required anchors.
  • Conditions

  • The caller must have the configuration authority defined by the implementation.

removeIdentityGate

js
function removeIdentityGate(bytes32 coordinationType) external;

Removes an identity gate for a coordination type.

  1. Select the coordination type. Identify the configuration by coordinationType.
  2. Remove the gate. Delete the settings and emit IdentityGateRemoved.
  • Arguments
Argument Details
coordinationType ERC-8001 coordination type whose gate to remove.
  • Conditions

  • The caller must have the configuration authority defined by the implementation.

getIdentityGate

js
function getIdentityGate(
      bytes32 coordinationType
   ) external view returns (
      bytes32 gatekeeperNode,
      ValidationParams memory params,
      bool enabled
   );

Returns the starting name, validation rules, and enabled state of the gate for a coordination type.

  1. Select the coordination type. Identify the configuration by coordinationType.
  2. Return the configuration. Return the gatekeeper, parameters, and enabled flag.
  • Arguments
Argument Details
coordinationType ERC-8001 coordination type whose gate to read.
  • Return values
Return value Details
gatekeeperNode ENS name at the start of the admission path.
params The configured path validation parameters.
enabled Whether the gate is enabled.
  • Conditions

  • Anyone can read the configuration.

validateParticipantWithPath

js
function validateParticipantWithPath(
      bytes32 coordinationType,
      TrustPath calldata path
   ) external view returns (bool isValid);

Evaluates a submitted ENS path against the gate for a coordination type.

  1. Read the configuration. Check whether the gate is enabled and which ENS name is its starting point.
  2. Check the endpoints. Check that the submitted path starts at the gatekeeper and ends at the intended candidate.
  3. Validate the path. Apply the configured ValidationParams and return the admission decision.
  • Arguments
Argument Details
coordinationType ERC-8001 coordination type used for the decision.
path Precomputed path of ENS names from the gatekeeper to the candidate.
  • Return values
Return value Details
isValid Whether the candidate passes the gate.
  • Conditions

  • Anyone can call the view function.

Additional notes

ERC-8107 leaves path discovery to the indexer or client. Applications can use different search strategies, while the contract can reproduce the justification for admitting bob.eth by checking the same submitted path.

Trust records are scoped. A trustor can make different decisions about the same ENS name for payments and for voting.

Compatibility

Relationship to existing standards

ERC-8107 reads ENS owners, verifies their signatures, and adds an identity gate. It uses existing names as trustors without changing their ownership or records.

Standard What ERC-8107 uses What ERC-8107 leaves to the existing standard
ENS Namehashes and current owners. Name registration, transfers, and record updates.
EIP-712 and ERC-1271 An attestation signing format and signature checks for contract-owned names. The wallet's signing method.
ERC-8001 An identity gate for a coordination type. The coordination workflow and participant data.

ERC-8001 uses the gate when the coordination type has been configured with setIdentityGate. A task without a gate does not require an ERC-8107 path.

Reference implementation

Storing an attestation

The proposal's TrustRegistry.sol stores attestations and validates submitted ENS paths. For setTrust, it looks up the owner of attestation.trustorNode, then checks the owner's EIP-712 signature or uses ERC-1271 if a contract owns the name.

Even with a valid signature, the registry rejects stale or equal nonces and expired attestations. It stores successful records by trustor, trustee, and scope, updates the nonce, and emits TrustSet. A relayer can submit the transaction, but the attestation and its update order come from the ENS name owner.

Verifying a submitted path

The application supplies a candidate path such as [gatekeeper.eth, alice.eth, bob.eth]. verifyPath inspects adjacent pairs. It reads the scoped attestation first and looks up the general scope only if the scoped record is missing.

js
(TrustLevel level, uint64 expiry) = getTrust(
   path.nodes[i],
   path.nodes[i + 1],
   params.scope
);

if (level == TrustLevel.Unknown && params.scope != bytes32(0)) {
   (level, expiry) = getTrust(
      path.nodes[i],
      path.nodes[i + 1],
      bytes32(0)
   );
}

The path fails when an edge is below the minimum, explicitly set to None, or expired. The registry also checks whether an intermediate ENS name appears in requiredAnchors. The first and last names are not intermediaries and do not satisfy that check.

validateParticipantWithPath connects path verification to ERC-8001. It returns true if no gate is configured for the coordination type. If a gate is configured, it checks that the path starts at gatekeeperNode and admits the candidate only when verifyPath returns both validity and a satisfied anchor condition.

Security considerations

Cycles without a trust anchor

An attacker can create many ENS names and add attestations between them. That alone does not create a valid path from the application's trusted starting point. Gate rules can specify anchors, maxPathLength, minEdgeTrust, and expiry conditions.

ENS transfers and expiry

An ENS-name attack and safeguards including trust anchors, short paths, and monitoring transfers

Attestations between many names still need a valid path from the application's trust root. Shorter paths, a minimum of Full, and expiry requirements can make weak chains less useful.

When an ENS name transfers, stored attestations about that name remain in the registry. Attestations already recorded by the former owner can also remain effective until expiry. Applications should monitor ENS Transfer events, recheck paths after a transfer, and use expiry rules instead of treating a transfer as a fresh attestation. Signed nonces help stop replaying old updates to restore an earlier state.

Conclusion

ERC-8107 stores attestations signed by ENS name owners and verifies precomputed paths for admitting participants. The signer determines whose trust decision is recorded, and a relayer can submit it. Applications can define trust anchors, minimum trust levels, scope, expiry, and path length for a particular type of work.

Find more of my writing and resources here.