ERC-7644 ERC-721 Name Registration Extension (ERC-721 Name Registry Extension)

Draft · Names & metadata · created 2024-03-01

An extension standard that assigns each ERC-721 token a unique name with an expiry date, and lets callers look up a token by name or look up a token's name.

Why it is needed

ERC-721 tokens are distinguished only by numeric token IDs. Numeric IDs are hard for humans to recognize at a glance and make it difficult to intuitively identify who holds which token. Even if you want to give tokens nicknames like usernames, without a common standard each contract does it differently, so wallets and apps cannot read names consistently. Also, if claiming a name once means monopolizing it forever, unused names get locked up and good names can be hoarded. This standard aims to solve these problems by defining a common interface that prevents name collisions within the same NFT contract and gives names a validity period so that expired names become available again.

What to implement

In depth

Interface composition

Implementers MUST provide all functions in the specification. nameOf(tokenId) returns the unexpired name, or an empty bytes32 if none exists or it has expired. tokenIdOf(_name) returns the token ID linked to the name, or 0 if none exists or it has expired. setName(tokenId, _name, duration) lets the token owner set or renew a name, where duration is the validity period in seconds counted from the time of the call. nameInfo(_name) returns the token ID together with the expiry date (expiryDate). When a name changes, a NameChanged(tokenId, oldName, newName, expiryDate) event is emitted. All name types are bytes32.

Why names have an expiry date

Giving name registrations an expiry period keeps the ecosystem healthy by freeing up unused or stale names again. It encourages turnover of names, preventing long-term hoarding, and gives users an incentive to renew names they value and release ones they no longer need. The source text explains that this creates a fair environment where name resources are used efficiently and refreshed to match changing demand.

Name uniqueness

Within the same NFT contract, a name must be unique until it expires. Unique names prevent confusion, support clear and intuitive identification, improve searchability, and build trust in trading and social interactions. Uniqueness is guaranteed within the scope of this contract, and the specification currently requires uniqueness within the NFT contract.

The role of the registration system

The name registration system is designed to prevent abuse and ensure fair access to name resources. The reservation feature gives everyone a fair chance to claim a desired name, preventing hoarding and speculation, while the renewal feature encourages active participation and investment in the ecosystem. Who holds the authority to set a name depends on the specific use case applying this extension.

Safeguards in the reference implementation

The reference implementation checks in setName that ownerOf(tokenId) matches the caller, so only the token owner can change the name. It caps the validity period at MAX_DURATION = 10 * 365 days and sets a minimum re-registration interval of MIN_SET_NAME_INTERVAL = 1 days, to prevent spam from consecutive registrations and indefinite monopolization. Names are managed with two mappings, _tokenNames (token ID to name) and _nameRegistrations (name to token ID and expiry date), and a name already in use can only be reset by the token that currently holds it. This standard is fully compatible with ERC-721.

A Proposal in Draft Stage

The status of this document is Draft. Since it is still an under-review draft and the specification may change, it is advisable to check for the latest status before implementing or depending on it.

Things to watch out for

Original ERC · ← ERCs