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-7510 proposes a way to manage hierarchical relationships between NFTs across different contracts, including the creation of derivative NFTs and support for multiple parent tokens.
This article translates, summarizes, and expands on the proposal below as discussed in the original March 2024 article.
I also cover other Ethereum improvement proposals here.
Overview
ERC-721 is the standard for representing unique assets (non-fungible tokens, or NFTs) on Ethereum. Tokens created under this standard each have a unique identifier within their collection and are used for applications such as digital art and in-game items.
For more on ERC-721, see the following article.
ERC-7510 extends ERC-721 by proposing a way to establish hierarchical relationships between tokens in different contracts. Specifically, it lets NFTs record parent-child relationships.
This extension offers two main benefits.
Representing hierarchies
For example, an NFT might represent an album, with child tokens representing individual photographs in that album. This makes it possible to represent complex ownership structures and relationships.
Querying relationships
The standard includes an interface for querying the parent tokens of an NFT and checking whether two NFTs have a parent-child relationship. Applications can use these operations to inspect and work with relationships between tokens.
The extension broadens the potential uses of NFTs in more complex applications and games. For example, a game might use an NFT to represent land, with child tokens representing buildings or decorations on that land, allowing the game world to be represented in greater detail.
Motivation
The proposal focuses on derivative NFTs as an evolution of non-fungible tokens: new NFTs created from existing ones, in a new form or representation. The standard is intended to manage and record the hierarchical relationships between such NFTs.
Two examples illustrate the intended use cases.
-
Creating derivative NFTs
- A two-dimensional image NFT might be used as the basis for issuing a three-dimensional model NFT.
- The derivative gives the original NFT a new form of expression.
-
Deriving NFTs from multiple parents
- An NFT can combine characteristics or elements from different NFTs.
- For example, a film NFT might be composed of several character NFTs.
- This is a common kind of scenario in intellectual property (IP) licensing.
The existing ERC-6150 standard also introduces token hierarchies, but its scope is limited to tokens in the same smart contract. In practice, derivative NFTs often need to be created in a separate contract as a new collection, and some derivatives have more than one parent. ERC-7510 is proposed to accommodate both requirements.
For more on ERC-6150, see the following article.
ERC-6150: Giving NFTs a Hierarchy Like a Linux Filesystem
The proposed standard aims to make the NFT ecosystem more flexible and expressive by supporting hierarchical relationships across contracts and between tokens derived from multiple parent NFTs.
Specification
The IERC7510.sol interface
/// @notice The struct used to reference a token in an NFT contract
struct Token {
address collection;
uint256 id;
}
interface IERC7510 {
/// @notice Emitted when the parent tokens for an NFT is updated
event UpdateParentTokens(uint256 indexed tokenId);
/// @notice Get the parent tokens of an NFT
/// @param tokenId The NFT to get the parent tokens for
/// @return An array of parent tokens for this NFT
function parentTokensOf(uint256 tokenId) external view returns (Token[] memory);
/// @notice Check if another token is a parent of an NFT
/// @param tokenId The NFT to check its parent for
/// @param otherToken Another token to check as a parent or not
/// @return Whether `otherToken` is a parent of `tokenId`
function isParentToken(uint256 tokenId, Token memory otherToken) external view returns (bool);
/// @notice Set the parent tokens for an NFT
/// @param tokenId The NFT to set the parent tokens for
/// @param parentTokens The parent tokens to set
function setParentTokens(uint256 tokenId, Token[] memory parentTokens) external;
}UpdateParentTokens
event UpdateParentTokens(uint256 indexed tokenId);Overview
An event emitted when an NFT's parent tokens are updated.
Details
The event is emitted when the set of parent tokens associated with an NFT changes. Applications and users can use it to monitor updates to a particular NFT's parents. Because events are recorded on the blockchain, these changes can be tracked afterward.
Parameters
tokenId- The ID of the NFT whose parent tokens were updated.
- This ID is indexed, allowing it to be used when filtering events.
parentTokensOf
function parentTokensOf(uint256 tokenId) external view returns (Token[] memory);Overview
Retrieves the parent tokens of an NFT.
Details
The function returns an array of parent tokens for the specified NFT.
An NFT can have multiple parents, so the result is an array of Token structs.
Each Token struct contains the address of the ERC-721 contract where the token resides and its token ID within that contract.
Arguments
tokenId- The ID of the NFT being queried.
Return value
Token[] memory- The array of parent tokens for the specified NFT.
isParentToken
function isParentToken(uint256 tokenId, Token memory otherToken) external view returns (bool);Overview
Checks whether another token is a parent of the specified NFT.
Details
The function determines whether otherToken is a parent of tokenId.
It returns a Boolean: true if otherToken is a parent, and false otherwise.
This provides a direct way to check whether two tokens have a parent-child relationship.
Arguments
tokenId- The ID of the NFT whose parent is being checked.
otherToken- The other token to check as a possible parent.
Return value
bool- Whether
otherTokenis a parent oftokenId, expressed as abool.
- Whether
setParentTokens
function setParentTokens(uint256 tokenId, Token[] memory parentTokens) external;Overview
Sets the parent tokens of an NFT.
Details
This function lets callers set one or more parents for a particular NFT. The parentTokens argument specifies an array of the tokens to be assigned as parents.
It can be used to manage hierarchical relationships between NFTs dynamically.
Arguments
tokenId- The ID of the NFT whose parent tokens are being set.
parentTokens- The array of parent tokens to set.
Rationale
The proposed standard differs from ERC-6150 in two main respects: it supports references to tokens in different contracts and allows multiple parent tokens. The naming conventions are nevertheless kept consistent where possible.
The interface also deliberately omits child-token relationships. When a derivative NFT is created, the original NFTs already exist, so the creator knows which parents to include. When an original NFT is minted, however, its future children are not yet known. Recording child relationships would require updating the original NFT whenever a derivative is minted. If the two NFTs belong to different contracts, the updates require distinct write permissions, so under the permission model discussed in the proposal, the two operations cannot be combined in one transaction. For this reason, the interface records only parent relationships from the derivative NFT.
This design simplifies management of NFT hierarchies. Explicit parent relationships make it easier to trace the origin of an NFT and how it was derived. Tracking children is more difficult because of the cross-contract operations and permissions involved, so the approach does not include that functionality.
Compatibility
No compatibility issues have been identified.
Implementation
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "./IERC7510.sol";
contract ERC7510 is ERC721, IERC7510 {
mapping(uint256 => Token[]) private _parentTokens;
mapping(uint256 => mapping(address => mapping(uint256 => bool))) private _isParentToken;
constructor(
string memory name, string memory symbol
) ERC721(name, symbol) {}
function supportsInterface(
bytes4 interfaceId
) public view virtual override returns (bool) {
return interfaceId == type(IERC7510).interfaceId || super.supportsInterface(interfaceId);
}
function parentTokensOf(
uint256 tokenId
) public view virtual override returns (Token[] memory) {
require(_exists(tokenId), "ERC7510: query for nonexistent token");
return _parentTokens[tokenId];
}
function isParentToken(
uint256 tokenId, Token memory otherToken
) public view virtual override returns (bool) {
require(_exists(tokenId), "ERC7510: query for nonexistent token");
return _isParentToken[tokenId][otherToken.collection][otherToken.id];
}
function setParentTokens(
uint256 tokenId, Token[] memory parentTokens
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC7510: caller is not owner or approved");
_clear(tokenId);
for (uint256 i = 0; i < parentTokens.length; i++) {
_parentTokens[tokenId].push(parentTokens[i]);
_isParentToken[tokenId][parentTokens[i].collection][parentTokens[i].id] = true;
}
emit UpdateParentTokens(tokenId);
}
function _burn(
uint256 tokenId
) internal virtual override {
super._burn(tokenId);
_clear(tokenId);
}
function _clear(
uint256 tokenId
) private {
Token[] storage parentTokens = _parentTokens[tokenId];
for (uint256 i = 0; i < parentTokens.length; i++) {
delete _isParentToken[tokenId][parentTokens[i].collection][parentTokens[i].id];
}
delete _parentTokens[tokenId];
}
}Security
An NFT's parent-token references may point to invalid data for two main reasons.
Parent tokens may be burned later
A token designated as a parent of an NFT may later be subject to a burn.
A burn deliberately removes a token from circulation and makes it unusable.
After this operation, the token no longer exists as a valid NFT, leaving its parent reference invalid.
The parentTokens argument may not be validated
A contract with a function for setting parent tokens (setParentTokens) might not verify that the supplied parent tokens are valid.
This makes it possible to designate invalid or nonexistent tokens as parents.
For security reasons, applications retrieving an NFT's parent tokens should therefore verify that those references resolve to valid, existing tokens. In other words, applications should not merely accept the parent-token data but take the additional step of checking whether the referenced tokens exist and are valid. Doing so reduces the risk of processing invalid data and helps maintain a more secure NFT ecosystem.
Citation
Ming Jiang (@minkyn), Zheng Han (@hanbsd), Fan Yang (@fayang), "ERC-7510: Cross-Contract Hierarchical NFT [DRAFT]," Ethereum Improvement Proposals, no. 7510, August 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7510.
Conclusion
ERC-7510 proposes a mechanism for managing hierarchical relationships between NFTs across different contracts, including the creation of derivative NFTs and support for multiple parent tokens.
If you have questions, feel free to send me a direct message on Twitter.
I also publish technical content on the following platforms.



