
ERC-8004 Identity Adapter
for ERC-721, ERC-1155, and ERC-6909 tokens
Bind any external token to an ERC-8004 identity record. Upgradeable, admin-managed, ERC-8004 semantics preserved.
┌────────────────────┐ ┌────────────────────┐ ┌────────────────────┐
│ │ │ │ │ │
│ External Token │ ───▶ │ Adapter8004.sol │ ───▶ │ ERC-8004 │
│ ERC-721 / 1155 / │ │ Agent bindings │ │ Identity │
│ ERC-6909 │ │ │ │ Registry │
│ │ │ │ │ │
└────────────────────┘ └────────────────────┘ └────────────────────┘
controls via forwards to holds agentId
ownerOf / balanceOf 8004 registry (adapter is owner)The adapter registers the ERC-8004 identity itself, keeps permanent custody of that ERC-8004 token, and binds the resulting agentId to one external token. Whoever controls the external token controls the identity. On registration, canonical binding metadata is written under the agent-binding key per ERC-8217 — exactly 20 bytes, the binding contract address.
ERC-721
Single-owner semantics. Control belongs to ownerOf(tokenId). Transferring the token moves control atomically.
ERC-1155
Any balanceOf(account, tokenId) > 0.
ERC-6909
Any balanceOf(account, tokenId) > 0.
Wrapper Contract
Adapter8004.sol wraps the ERC-8004 identity token. The adapter registers on the registry, takes permanent custody of the NFT, and forwards all writes on behalf of the bound token’s controller.
agent-binding
Canonical binding metadata is written on every register: exactly 20 bytes — the binding contract address. Token standard, token contract, and token id are read only from bindingOf.
bindingOf(agentId)
ERC-8217 required verification surface. Returns the canonical Binding { standard, tokenContract, tokenId } for any agent registered through this adapter.
ERC-8217 (PR #1648)
Implements ERC-8217: Agent NFT Identity Bindings. Reserved metadata key, 20-byte payload, IERCAgentBindings interface for canonical lookup.
Interoperable
Standard verification flow: read agent-binding (20 bytes), decode as binding contract address, call bindingOf(agentId) on that address for the canonical token record.
isController
Adapter-specific convenience view. Returns whether an account currently controls a given agentId via the bound token.
Upgradeable (UUPS)
The adapter owner can upgrade the implementation via upgradeToAndCall. Gated by _authorizeUpgrade → onlyOwner.
Registry Swap
Admin can call setIdentityRegistry to track future ERC-8004 changes, including registry proxy upgrades or migrations to a new registry address.
# clone git clone https://github.com/nxt3d/adapter.git cd adapter # build + test forge build forge test # deploy (Base example) cp .env.example .env # fill in values script/deploy.sh base
See the full quickstart guide for registering your first binding.
Adapter Proxies
ERC-8004 IdentityRegistry
Users and integrators should interact with the proxy addresses, not the implementation addresses.