ERC-6551: Non-fungible Token Bound Accounts
ERC-6551 gives every ERC-721 NFT a deterministic, smart-contract wallet — a "token bound account" (TBA). The NFT becomes the owner of its own account; the account can hold tokens, sign messages, and execute arbitrary calls, and control of the account follows the NFT through any transfer. This is the foundation of NFT-as-character-inventory systems, NFT-as-DAO-membership, and composable on-chain identities.
Architecture
ERC-6551 has two components:
Registry (
ERC6551Registry) — a singleton at a known address that computes the deterministic account address for any(implementation, chainId, tokenContract, tokenId, salt)tuple via CREATE2, and deploys the account on first use.Account implementation (
IERC6551Account) — a minimal proxy clone (often using ERC-1167) of an account contract. The account exposes:
function token() external view returns (uint256 chainId, address tokenContract, uint256 tokenId);
function owner() external view returns (address); // resolves NFT owner via tokenContract.ownerOf(tokenId)
function isValidSigner(address signer, bytes calldata context) external view returns (bytes4);
function execute(address to, uint256 value, bytes calldata data, uint8 operation) external payable returns (bytes memory);
function state() external view returns (uint256); // monotonic — increments on every state-changing callCombined with ERC-1271 (smart-contract signatures) the TBA can sign messages on behalf of the NFT holder, enabling NFT-as-identity for authentication flows.
Neo Equivalent: Registry + Per-NFT Contract Account
Neo doesn't have CREATE2 with the same address-computation semantics, but the TBA pattern adapts cleanly using a registry contract that mints (or looks up) a per-NFT account. Two viable patterns:
A. Deterministic-mapping registry — the registry stores (NFT contract, tokenId) -> account contract hash, and on first access it deploys a parameterized account contract via ContractManagement.Deploy(...). The account stores the (NFT contract, tokenId) tuple in its storage and resolves ownership via Nep11Token.OwnerOf(tokenId) on every authorization check.
B. Single shared account, scoped storage — one shared account contract holds all TBA state in a (NFT contract, tokenId) -> KV namespaced storage prefix. Cheaper (no per-NFT deploy) but loses the ERC-6551 "every TBA has a distinct address" property. Most production TBA systems use pattern A.
| ERC-6551 (Ethereum) | Neo Equivalent | Notes |
|---|---|---|
ERC6551Registry.account(impl, chainId, tokenContract, tokenId, salt) | TBARegistry.AccountFor(nftContract, tokenId) | Deterministic lookup, deploy on first use |
| CREATE2 + ERC-1167 minimal proxy | ContractManagement.Deploy with a parameterised manifest, or shared-account + scoped storage | No CREATE2, but ContractManagement.GetContractById provides deterministic addressing post-deploy |
IERC6551Account.execute(to, value, data, op) | Contract.Call(target, method, callFlags, args) | Neo callflags replace ERC-6551's operation enum |
IERC6551Account.owner() → IERC721.ownerOf(tokenId) | Nep11Token.OwnerOf(tokenId) | Both resolve owner on every check |
isValidSigner(signer, context) | Runtime.CheckWitness(owner) | Direct equivalent — Neo bakes signer auth in |
state() (monotonic) | TBA-side counter incremented on each Execute call | Same pattern, no native helper |
| ERC-1271 signature path | Verify(...) (NEP-30) | The TBA's Verify returns true iff the NFT holder signed the witness |
Why It's Almost Free on Neo
Two pieces that ERC-6551 has to reimplement on Ethereum are already first-class on Neo:
- Smart-contract signers are native (via NEP-30
Verify) — no ERC-1271 shim required. - Authorization scoping is part of the witness model — the TBA's
Executedoesn't need to forward gas, value, or operation flags; it just calls the target contract and the runtime enforces witness rules.
The Ethereum-side need for CREATE2 deterministic addressing is the only genuine impedance mismatch. The registry-with-mapping pattern recovers deterministic lookup without changing any caller-facing behavior.
