ERC-8257 · Draft · ERC · 2026-04-17
ERC-8257: Agent Tool Registry
A permissionless on-chain directory of AI agent tools: each entry commits a manifest URI and hash, and access is delegated to a pluggable predicate contract.
What problem does it solve?
Tools that AI agents can call (APIs, oracles, analytics services) are listed in scattered, proprietary catalogs. An agent has no neutral, chain-native place to find a tool, check that its description has not been tampered with, see what it costs, and learn what it needs to qualify for access.
ERC-8257 defines a minimal registry contract for that. The registry stores only a pointer and a hash; details live in an off-chain JSON manifest, and access rules live in separate predicate contracts, so any gating model (NFT holding, subscription, allowlist, DAO vote) can be plugged in without changing the registry. The registry never handles payments.
How it works
- Registration.
registerTool(metadataURI, manifestHash, accessPredicate)is open to anyone. The caller becomes the permanentcreator, and tools get sequential IDs starting at 1.manifestHashiskeccak256of the manifest's canonical bytes (RFC 8785 JSON canonicalization, plus NFC strings, no BOM, lowercase hex). - Management (creator only).
updateToolMetadata,setAccessPredicate(set it to an always-deny predicate to pause a tool) and an irreversiblederegisterTool. - Access checks.
hasAccess(toolId, account, data)calls the predicate withstaticcall;address(0)means open access.tryHasAccessalso returns whether the predicate answered properly, so "denied" can be told apart from "predicate broken". Predicates implementhasAccess,nameandgetRequirements, which returns machine-readable requirements (for example "hold a token from collection X") so an agent can work out what it needs. - Manifest. Required fields:
type,name,description,endpoint, JSON-Schemainputs/outputs, andcreatorAddress. Optional fields includepricing(amount, CAIP-19 asset, CAIP-10 recipient, and an opaque paymentprotocolstring),accesshints,tags, andverifiability(self-attested, TEE-attested, or reproducible-build claims). - Anti-impersonation. The manifest must be served at
<origin>/.well-known/ai-tool/<slug>.jsonon the same origin as itsendpoint(origin binding), and itscreatorAddressmust equal the on-chaincreator(creator binding). Consumers must reject a tool if the URI, hash or creator check fails.
Sample code
A minimal predicate that only lets holders of an ERC-721 collection in:
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.24;
interface IERC721 { function balanceOf(address) external view returns (uint256); }
contract NftHolderPredicate {
IERC721 public immutable collection;
constructor(IERC721 c) { collection = c; }
function hasAccess(uint256, address account, bytes calldata) external view returns (bool) {
return collection.balanceOf(account) > 0;
}
function name() external pure returns (string memory) { return "NftHolderPredicate"; }
// getRequirements(...) and ERC-165 supportsInterface omitted for brevity
}
Checking a fetched manifest against the registry (ethers v6, using the canonicalize JCS package):
import { Contract, keccak256, toUtf8Bytes } from "ethers";
import canonicalize from "canonicalize";
const registry = new Contract(registryAddress, [
"function getToolConfig(uint256) view returns (tuple(address creator, string metadataURI, bytes32 manifestHash, address accessPredicate))",
], provider);
const cfg = await registry.getToolConfig(toolId);
const manifest = await (await fetch(cfg.metadataURI)).json();
const ok = keccak256(toUtf8Bytes(canonicalize(manifest)!)) === cfg.manifestHash
&& manifest.creatorAddress === cfg.creator.toLowerCase();
// Also verify the origin / well-known-path rule before trusting the tool.
Things to know
- Status: Draft. The manifest schema and validation rules are long and detailed; implement against the spec, not this summary.
- The registry is permissionless, so spam and look-alike entries are expected. Always run the origin, hash and creator checks.
accountpassed tohasAccessis advisory; the tool endpoint still has to authenticate who is calling it.- Pricing and verifiability fields are claims; the endpoint enforces payment, and TEE claims should be verified via attestation.
- It complements agent identity in ERC-8004 and agent registries such as ERC-8122: those describe agents, this describes tools.