ERC-5625: NFT Metadata JSON Schema dStorage Extension
Add a dStorage property to non-fungible tokens (NFTs) metadata JSON schema to provide decentralized storage information of NFT assets
Abstract
This EIP extends the NFT metadata JSON schema defined in EIP-721 and EIP-1155, adding a dStorage
key that provides information about how the NFT data is stored.
Motivation
As highly valuable crypto properties, NFT assets intrinsically demand guaranteed storage to assure their immutability, reliability, and durability. NFT ownership is tracked by EIP-721 or EIP-1155 smart contracts, hence persisted in blockchain, which is not a problem. But how about the mime-type assets that NFT tokens represent? Ideally, they should also be stored in some reliable and verifiable decentralized storage system that is designed to store larger amounts of data than the blockchain itself. As an effort to promote decentralized storage adoption in NFT world, we propose to add additional dStorage information into NFT metadata JSON schema.
As a refresher, let's review existing NFT metadata JSON schema standards. EIP-721 defines a standard contract method tokenURI
to return a given NFT's metadata JSON file, conforming to the EIP-721 Metadata JSON Schema, which defines three properties: name
, description
and image
.
Similarly, EIP-1155 also defines a standard contract method uri
to return NFT metadata JSON files conforming to the EIP-1155 Metadata JSON Schema, which defines properties like name
, decimals
, description
, image
, properties
, localization
, etc.
Besides, as the world's largest NFT marketplace nowadays, OpenSea defines their own Metadata Standards, including a few more properties like image_data
, external_url
, attributes
, background_color
, animation_url
, youtube_url
, etc. This standard is de facto respected and followed by other NFT marketplaces like LooksRare.
None of these standards conveys storage information about the mime-type asset that the NFT token represents. This proposal is an effort to fill the missing part.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
In addition to the existing properties, the Metadata JSON file returned by EIP-721 and EIP-1155 smart contracts (via tokenURI
and uri
methods, respectively), should OPTIONALLY contains one more dStorage
property.
For EIP-721 smart contracts, the Metadata JSON file schema is:
For EIP-1155 smart contracts, the Metadata JSON file schema is:
Rationale
Choice between Interface and JSON Schema Extension
An extension of the EIP-721 or EIP-1155 contract interfaces would unnecessarily require additional code to implement, and would not be available for use by NFT projects that already have their NFT smart contracts finalized and deployed. An optional JSON schema extension is noninvasive, and more easily adopted.
Backwards Compatibility
This EIP is backward compatible with EIP-721 and EIP-1155.
Security Considerations
Needs discussion.
Copyright
Copyright and related rights waived via CC0.