Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ERC-7632 proposes a mechanism for associating numeric token IDs with string names, allowing applications to refer to tokens using human-readable identifiers.
This article translates, summarizes, and expands on the following proposal.
More EIP, BIP, SLIP, CAIP, ENSIP, RFC, and ACP explainers:
Overview
ERC-7632 extends the conventional uint256 tokenId model with a string-based tokenName.
Most NFT standards identify tokens through numeric IDs. These identifiers are useful for contract operations but do not necessarily convey what an asset represents to a human reader.
The proposed design retains numeric IDs while introducing human-readable names:
- Internal token identifiers remain uint256 values.
- Applications can additionally use string-based names for presentation and operations.
- A contract implementing the bidirectional mapping interface associates token IDs with names and allows either representation to be resolved to the other.
The default hash-based naming approach discussed below is distinct from an explicitly reversible mapping: hashing a name does not allow the original string to be recovered from the hash alone.
This design aims to improve readability while retaining compatibility with existing token interfaces.
Motivation
NFTs are used in marketplaces, block explorers, wallets, DeFi protocols, and decentralized applications.
These services may benefit from referring to an asset through a meaningful name rather than a numeric identifier alone.
Current approaches can create several integration difficulties:
- Numeric IDs do not necessarily indicate what an NFT represents.
- Contracts use different naming conventions and retrieval mechanisms.
- Wallets and marketplaces may need project-specific name-resolution logic.
ERC-7632 proposes common interfaces to address these issues:
- Human-readable token names can improve asset identification.
- Wallets and marketplaces can retrieve names using consistent operations.
- DeFi protocols and applications can expose name-based operations, making integrations more readable.
These benefits depend on support for the extension and on meaningful, consistently managed names.
Specification
The proposal retains uint256 token IDs while providing mechanisms for working with string names.
Where an explicit mapping is used, the association between names and IDs must remain consistent in both directions.
Requirements for compatible contracts
The proposal describes two approaches to associating token names with numeric IDs.
Method 1a: Implementing IERC_NamedTokenCore (recommended)
IERC_NamedTokenCore interface
interface IERC_NamedTokenCore {
function idToName(uint256 _tokenId) external view returns (string);
function nameToId(string memory _tokenName) external returns (uint256);
}The interface provides two operations:
- Retrieve a token name from its numeric ID.
- Retrieve a token ID from its name.
Together, these operations support bidirectional resolution.
The historical interface excerpt is reproduced unchanged. In modern Solidity, dynamically sized return values require an appropriate data-location declaration, and implementers should verify the actual ABI and mutability requirements against the specification.
Event for new names
The following event is recommended when a new token name is introduced:
event newName(uint256 indexed tokenId, string tokenName);The event allows indexers, marketplaces, and explorers to discover newly introduced names.
Mapping consistency
For an explicit bidirectional mapping, token IDs and token names must have a one-to-one relationship.
- Each mapped token ID has a corresponding name.
- Each mapped name has a corresponding token ID.
- Both round-trip identities must hold:
tokenId = nameToId(idToName(tokenId))
tokenName = idToName(nameToId(tokenName))Neither conversion should introduce ambiguity or change the original identifier.
Method 1b: Default mapping rule
The proposal also describes a default rule that can be used without implementing IERC_NamedTokenCore.
Default conversion
uint256 tokenId = uint256(keccak256(tokenName));The numeric identifier is obtained by hashing the token name with Keccak-256 and interpreting the resulting 32-byte value as a uint256.
This approach has several characteristics:
- Computing the ID does not require a stored name-to-ID mapping.
- The same input string deterministically produces the same ID.
- Name normalization and uniqueness remain implementation concerns.
Keccak-256 is not reversible. If an application also needs to recover the original name from an ID, it must retain or discover that name through another mechanism, such as stored metadata or indexed naming events. In Solidity, the string must be converted or encoded into bytes as required by the hash function.
Providing name-based methods
The proposal recommends providing name-based variants of existing token-ID-based methods.
The intended convention is to retain the original behavior, replace the uint256 token identifier argument with a string token name, and append ByName to the method's name.
Example
function transferFrom(address from, address to, uint256 tokenId) external;
function transferFromByName(address from, address to, string memory tokenName) external;The two operations should have equivalent behavior when the supplied name resolves to the specified ID. In particular, name-based operations must enforce the same authorization and transfer requirements as their numeric counterparts.
Additional interfaces
The proposal also defines optional extensions for more advanced name management.
IERC_NamedTokenExtension interface
interface IERC_NamedTokenExtension {
function isValidTokenName(string memory _tokenName) external view returns (string);
function normalizeTokenName(string memory _tokenName) external view returns (string memory);
}isValidTokenName
Checks whether a supplied token name satisfies the implementation's naming policy.
Possible checks include:
- Disallowed characters.
- Length restrictions.
- Reserved or prohibited names.
The string return type allows an implementation to convey validation information rather than merely returning a Boolean. Clients should follow the specified return-value convention.
normalizeTokenName
Converts a token name into its normalized representation.
Possible normalization rules include:
- Consistent letter casing.
- Removal of unnecessary whitespace.
- Handling equivalent Unicode representations.
Consistent normalization can prevent different representations of an intended name from being treated as separate tokens.
Rationale
ERC-7632 aims to balance ease of implementation with flexibility. It does not require every contract to implement the association between names and IDs using the same internal mechanism.
The default hash-based rule provides a straightforward deterministic name-to-ID conversion without a dedicated mapping.
A custom mapping may be more appropriate when:
- Names must correspond to sequential numeric IDs.
- Existing numeric identifiers must be associated with a new naming system.
- Name validation or management requires additional rules.
The IERC_NamedTokenCore interface provides a common way to expose such custom mappings. This lets implementations accommodate different naming requirements while offering consistent external operations.
Compatibility
ERC-7632 preserves the numeric token identifier used by existing token standards.
- The underlying token ID remains a uint256.
- The token name is an additional representation rather than a replacement for the numeric identifier.
Consequently, contracts implementing the extension can retain existing ERC-721 and ERC-1155 interfaces:
- Existing token IDs can continue to be used.
- Existing functions and events need not be replaced.
- Applications unaware of the extension can continue interacting through the original interfaces.
For ERC-721, see the following article.
ERC-721: A guide from first principles
For ERC-1155, see the following article.
ERC-1155: A guide from first principles
The extension adds naming functionality without requiring existing integrations to abandon numeric identifiers. Previously deployed contracts do not automatically acquire the new interface.
Security
ERC-7632 relies on unambiguous token identifiers and name associations.
Uniqueness
Within the relevant contract and mapping domain:
- A mapped token ID corresponds to one canonical token name.
- A mapped token name corresponds to one token ID.
If these relationships are not maintained, resolving a name can become ambiguous and cause incorrect token operations.
Risks of non-normalized names
Different strings can look nearly identical to users while representing distinct tokens.
Examples include:
- Differences in letter casing, such as TokenA and tokena.
- Full-width and half-width character variations.
- Visually similar Unicode characters.
Such differences can lead to impersonation or accidental operations.
Responsibilities when allowing non-normalized names
Implementers must clearly define their naming rules when permitting non-normalized or visually similar strings.
The optional IERC_NamedTokenExtension interface provides mechanisms for communicating those rules:
- normalizeTokenName exposes the normalization operation.
- isValidTokenName exposes name validation.
Wallets and marketplaces can use this information to present appropriate warnings and interpret token names consistently.
Normalization does not eliminate all visually confusable names. Applications should also identify the relevant chain, token contract, and numeric token ID when verifying an asset.
Citation
Zainan Victor Zhou (@xinbenlv), "ERC-7632: Interfaces for Named Token [DRAFT]," Ethereum Improvement Proposals, no. 7632, February 2024. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7632.
Conclusion
ERC-7632 proposes standard interfaces for named tokens, including bidirectional name mappings, a default deterministic ID derivation rule, and optional name validation and normalization.
Questions are welcome via Twitter @cardene777.
Other publications:



