---
eip: 8217
label: ERC-8217
title: Agent NFT Identity Bindings
status: Draft
type: Standards Track
category: ERC
created: 2026-04-05
requires: 8004
official: https://eips.ethereum.org/EIPS/eip-8217
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-8217.md
canonical: https://eips.huatuo.xyz/eip-8217/
lang: en
tldr: "Lets an existing NFT (the \"master NFT\") control an ERC-8004 agent identity through an immutable binding recorded by a per-chain singleton contract, so control of the agent follows the NFT when it is transferred."
tags: [erc, ai-agents, identity, nft, metadata]
---

# ERC-8217: Agent NFT Identity Bindings

> A per-chain singleton protocol that binds ERC-8004 agents to external NFT or token controllers.

**TL;DR:** Lets an existing NFT (the "master NFT") control an ERC-8004 agent identity through an immutable binding recorded by a per-chain singleton contract, so control of the agent follows the NFT when it is transferred.

## What problem does it solve?

[ERC-8004](/eip-8004/) gives AI agents an on-chain identity, and each registration is itself an NFT. Projects often want an *existing* NFT, such as a character, collection item or project token, to own that agent identity, so that whoever holds the NFT controls the agent and control moves when the NFT is sold.

Without a standard, each project would invent its own adapter, and wallets, marketplaces and indexers would have no consistent way to discover that an agent is controlled through some external token. ERC-8217 defines one metadata key, one tiny encoding and one read function for this. Agents bound this way may use the nickname **8004A**.

## How it works

- **A canonical binding contract per chain.** Each chain is expected to have a single binding contract that records which token controls which agent id. Multiple competing binding contracts on one chain are discouraged.
- **Metadata pointer.** In the ERC-8004 registry, the agent's metadata key `agent-binding` holds exactly 20 bytes: the binding contract's address (`abi.encodePacked(bindingContract)`). Nothing else is duplicated there.
- **Read interface.** The binding contract exposes `bindingOf(agentId)`, returning the token standard (ERC-721, ERC-1155 or ERC-6909), token contract and token id, and emits `AgentBound` when a binding is first written.
- **Immutable.** Once written, neither the metadata pointer nor the `Binding` may change, even across contract upgrades, so clients can verify once and cache.
- **Authorization is out of scope.** The binding contract decides what "control" means (for example ERC-721 ownership, or holding a balance of an ERC-1155 / [ERC-6909](/eip-6909/) id).

**Verification flow:** read `agent-binding` from the registry, check it is 20 bytes, call `bindingOf(agentId)` on that address. If any step fails, treat the binding as unverified.

## Sample code

Required interface and a client-side check (ethers v6):

```solidity
interface IERCAgentBindings {
    enum TokenStandard { ERC721, ERC1155, ERC6909 }
    struct Binding { TokenStandard standard; address tokenContract; uint256 tokenId; }

    event AgentBound(uint256 indexed agentId, TokenStandard indexed standard,
                     address indexed tokenContract, uint256 tokenId, address registeredBy);

    function bindingOf(uint256 agentId) external view returns (Binding memory);
}
```

```ts
import { Contract, JsonRpcProvider, dataLength, getAddress } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const registry = new Contract(process.env.IDENTITY_REGISTRY!, [
  "function getMetadata(uint256 agentId, string metadataKey) view returns (bytes)",
], provider);

const raw: string = await registry.getMetadata(agentId, "agent-binding");
if (dataLength(raw) !== 20) throw new Error("binding unverified");

const binder = new Contract(getAddress(raw), [
  "function bindingOf(uint256) view returns (tuple(uint8 standard, address tokenContract, uint256 tokenId))",
], provider);
const { standard, tokenContract, tokenId } = await binder.bindingOf(agentId);
```

## Things to know

- Status: **Draft**. Interface names and details may still change.
- The metadata only tells you *which* contract to ask; trust rests entirely on that binding contract's code. Clients should assess it (audits, upgradeability) before relying on it.
- The format is EVM-address based and does not encode chain context; non-EVM bindings are not covered.
- ERC-8004 registries are not required to support the `agent-binding` key, but those that do should reserve it so untrusted callers cannot overwrite it.


---

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