ERC-8107 ENS Agent Trust Registry (ENS Trust Registry for Agent Coordination)
Review · Signatures & auth · created 2025-12-16
A standard that records trust attestations between agents on-chain using ENS names as identifiers, and verifies trust paths to determine eligibility to participate in ERC-8001 multi-agent coordination.
Why it is needed
ERC-8001 defines only the minimal functionality for multi-agent coordination, leaving reputation and trust decisions to be handled as modules. As a result, an agent looking to initiate coordination has no common way to answer questions like "should this agent be allowed into the coordination" or "can this agent's judgment in vouching for other agents be trusted." A central registry would solve the problem of establishing trust with an unfamiliar agent, but it would mean relying on a single operating entity. Using addresses directly as identifiers also has the problem that accumulated trust records break whenever a key is rotated. This standard borrows the web-of-trust model from OpenPGP, proven over more than 25 years, recording trust against ENS names, which survive key rotation, as identifiers and propagating it along paths.
What to implement
event NoncesInvalidated(bytes32 indexed trustorNode, uint64 newNonce): Occurs when a truster invalidates unsubmitted attestations.event IdentityGateRemoved(address indexed coordinator, bytes32 indexed coordinationType): Occurs when an identity gate is removed.function invalidateNonces(bytes32 trustorNode, uint64 newNonce) external: Raises the nonce floor, invalidating all attestations that were signed but not yet submitted. Callable only by the controller.function getNonce(bytes32 trustorNode) external view returns (uint64): Returns the truster's current nonce.function removeIdentityGate(bytes32 coordinationType) external: Removes the caller's gate for the given coordination type.function resolveAgent(bytes32 node) external view returns (address agent): Safely reads a node's forward address record and returns the agent's address, or the zero address if none exists.
In depth
The four trust levels and transition rules
Levels are fixed as a four-value enum: Unknown (0), None (1), Marginal (2), Full (3). There is exactly one path to reach each level. Marginal and Full are reached only by a valid attestation with a higher nonce, and None is reached only by revokeTrust or revokeTrustBatch. Unknown is the default and cannot be reassigned, and once a relationship is created it is never deleted from storage. Therefore setTrust must reject attestations whose level is Unknown or None. Revocation is not permanent, so a new attestation with a higher nonce can move a relationship from None back to Marginal or Full. No level transition changes the denial flag, and no denial flag change changes the level.
Differences from the OpenPGP model
This borrows the trust levels and certification path model of the RFC 9580 OpenPGP web of trust, but not its validity computation. OpenPGP considers a key valid once it gathers either one fully trusted signature or several partially trusted signatures, but verifyPath checks only a single path, and every edge on that path must satisfy minEdgeTrust. It does not define a rule for summing multiple Marginal attestations. The correspondence is: public key to ENS name, key signature to trust attestation, key owner's trust level to the TrustLevel enum, key validity to coordination participation eligibility, and certification path to the chain of trust through agents.
Revocation and denial are separate judgments
Each record carries a denial flag independent of its level. Revocation removes only a single attestation, i.e. a single edge, so a path that goes through another agent's attestation remains valid. Denial lets the truster, within their own judgment, disregard even another agent's attestation and block that counterparty. The setTrust family must not change the denial flag, and setDenial and clearDenial must not change other stored fields such as level or expiry. Effective denial is computed as the OR of the flag for the universal scope bytes32(0) and the flag for the specific scope, and a false scope-specific flag cannot override a true universal flag. clearDenial takes the expectedNonce at review time, and if an attestation has been recorded since then it reverts with NonceChanged; if an unsubmitted signature might exist, it recommends raising the floor first with invalidateNonces before reviewing.
ENS integration and NameWrapper handling
The agent identifier is the ERC-137 namehash. For a wrapped name, the registry's owner resolves to the NameWrapper contract, so controllerOf resolves the actual controller as the ERC-1155 holder that NameWrapper's ownerOf points to. The nameWrapper address must be fixed at deployment and must not be allowed to change afterward, since an adversarial contract placed there could claim control of every wrapped name. A wrapped .eth second-level name loses its signing authority once its NameWrapper expiry passes (typically registration expiry plus a 90-day grace period), at which point its controller becomes the zero address, but an unwrapped name keeps its registry owner even after expiry. Because a new controller inherits the existing trust relationships when a name is transferred, a short expiry of at most 90 days is recommended for attestations in sensitive scopes.
Separating signing authority from operator authority
An attestation must be signed by the name's controller (controllerOf), and if the controller is a contract it is verified via ERC-1271. The implementation first attempts ECDSA recovery and rejects high-s malleable signatures, then falls back to ERC-1271 only for controllers that have code, since sending an EOA that gained code via an EIP-7702 delegation straight to ERC-1271 would reject an otherwise valid signature. An operator approved via isApprovedForAll may call revokeTrust and revokeTrustBatch, but must not call setDenial, clearDenial, or invalidateNonces. This is because denial carries the same level of authority as an attestation signature, and invalidateNonces has a broad effect, invalidating unsubmitted attestations across all trustees and scopes. A valid setTrust signature may be submitted by any address.
Path validation parameters and gate constraints
ValidationParams consists of maxPathLength (1 to 10, counted in edges, so direct trust has length 1), minEdgeTrust (only Marginal or Full allowed), scope, enforceExpiry, and requiredAnchors (up to 10). The defaults are maxPathLength 5, minEdgeTrust Marginal, the universal scope, enforceExpiry true, and no anchors. verifyPath and setIdentityGate use the same routine to check these constraints. setIdentityGate additionally rejects a gate with anchors whose maxPathLength is under 2 with UnsatisfiableAnchors, since only an intermediate node can satisfy an anchor and a single-edge path cannot pass through one. verifyPath does not perform this additional check and simply returns false for such parameters. All of edge checks, validator denial checks, and anchor constraints must pass for a true result; there is no partial success.
ERC-8001 integration and address resolution
Gates are stored under the key (msg.sender, coordinationType), so the caller owns its own namespace, requiring no separate authorization, and well-known coordination type constants cannot be squatted. Since ERC-8001 identifies participants by address, a node's forward addr record links the name to an address. resolveAgent reads addr via a low-level call that forwards only 50,000 gas to the resolver, and returns the zero address if the resolver reverts, returns fewer than 32 bytes, or the upper 96 bits of the first word are nonzero; it must not revert because of the resolver. Off-chain resolvers (CCIP-Read) cannot be used for on-chain verification, so an agent seeking to pass an on-chain gate must publish an on-chain addr record that responds within the gas limit. validateParticipantAddress also checks whether the path's end node resolves to the participant address and whether that node has a controller.
Nonce rules, interface identifiers, and proposal status
Nonces increment per truster, and a new attestation's nonce must be greater than the current nonce; jumping by more than 2**32 is rejected with NonceJumpTooLarge. Revocation alone does not invalidate an attestation that has already been signed but not yet submitted; that is handled by invalidateNonces. Interfaces are detected via ERC-165, and ITrustRegistry's identifier is 0x94f0ee34. The earlier draft identifiers 0x42b46ef5 and 0x31f35e83 must not return true, and the earlier draft's ITrustRegistryExtended (0x93e686a3) is not defined in this version. This proposal is currently in Review status, so its content may still change.