---
eip: 8257
label: ERC-8257
title: Agent Tool Registry
status: Draft
type: Standards Track
category: ERC
created: 2026-04-17
requires: 150, 165, 712, 1967
official: https://eips.ethereum.org/EIPS/eip-8257
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8257.md
canonical: https://eips.huatuo.xyz/eip-8257/
lang: en
tldr: "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."
tags: [ai-agents, registry, tools, access-control, discovery]
---

# ERC-8257: Agent Tool Registry

> Minimal onchain registry for AI agent tools with extensible predicate-based access control

**TL;DR:** 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 permanent `creator`, and tools get sequential IDs starting at 1. `manifestHash` is `keccak256` of 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 irreversible `deregisterTool`.
- **Access checks.** `hasAccess(toolId, account, data)` calls the predicate with `staticcall`; `address(0)` means open access. `tryHasAccess` also returns whether the predicate answered properly, so "denied" can be told apart from "predicate broken". Predicates implement `hasAccess`, `name` and `getRequirements`, 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-Schema `inputs` / `outputs`, and `creatorAddress`. Optional fields include `pricing` (amount, CAIP-19 asset, CAIP-10 recipient, and an opaque payment `protocol` string), `access` hints, `tags`, and `verifiability` (self-attested, TEE-attested, or reproducible-build claims).
- **Anti-impersonation.** The manifest must be served at `<origin>/.well-known/ai-tool/<slug>.json` on the same origin as its `endpoint` (origin binding), and its `creatorAddress` must equal the on-chain `creator` (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:

```solidity
// 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):

```ts
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.
- `account` passed to `hasAccess` is 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](/eip-8004/) and agent registries such as [ERC-8122](/eip-8122/): those describe agents, this describes tools.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8257
