ERC-7510: Cross-Contract Hierarchical NFT
An extension of ERC-721 to maintain hierarchical relationship between tokens from different contracts.
Abstract
This standard is an extension of ERC-721. It proposes a way to maintain hierarchical relationship between tokens from different contracts. This standard provides an interface to query the parent tokens of an NFT or whether the parent relation exists between two NFTs.
Motivation
Some NFTs want to generate derivative assets as new NFTs. For example, a 2D NFT image would like to publish its 3D model as a new derivative NFT. An NFT may also be derived from multiple parent NFTs. Such cases include a movie NFT featuring multiple characters from other NFTs. This standard is proposed to record such hierarchical relationship between derivative NFTs.
Existing ERC-6150 introduces a similar feature, but it only builds hierarchy between tokens within the same contract. More than often we need to create a new NFT collection with the derivative tokens, which requires cross-contract relationship establishment. In addition, deriving from multiple parents is very common in the scenario of IP licensing, but the existing standard doesn't support that either.
Specification
Solidity interface available at IERC7510.sol
:
Rationale
This standard differs from ERC-6150 in mainly two aspects: supporting cross-contract token reference, and allowing multiple parents. But we try to keep the naming consistent overall.
In addition, we didn't include child
relation in the interface. An original NFT exists before its derivative NFTs. Therefore we know what parent tokens to include when minting derivative NFTs, but we wouldn't know the children tokens when minting the original NFT. If we have to record the children, that means whenever we mint a derivative NFT, we need to call on its original NFT to add it as a child. However, those two NFTs may belong to different contracts and thus require different write permissions, making it impossible to combine the two operations into a single transaction in practice. As a result, we decide to only record the parent
relation from the derivative NFTs.
Backwards Compatibility
No backwards compatibility issues found.
Test Cases
Test cases available at: ERC7510.test.ts
:
Reference Implementation
Reference implementation available at: ERC7510.sol
:
Security Considerations
Parent tokens of an NFT may point to invalid data for two reasons. First, parent tokens could be burned later. Second, a contract implementing setParentTokens
might not check the validity of parentTokens
arguments. For security consideration, applications that retrieve parent tokens of an NFT need to verify they exist as valid tokens.
Copyright
Copyright and related rights waived via CC0.