Open skilesare opened 2 months ago
Updated in response to the 20240521 Working Group meeting:
To provide a standardized approach to handling metadata for NFTs within the Internet Computer ecosystem, the ICRC-76 metadata standard has been designed. This standard facilitates a bi-modal for specifying and verifying metadata, accommodating diverse NFT use cases, and ensuring interoperability with existing standards. The initial standards are purposely simple and MAY be extended through additional ICRC Extensions to target specific systems, standards, and protocols. Below is a comprehensive description of the ICRC-76 metadata standard's specifications:
The ICRCX standard supports two methods for associating metadata with NFTs. Each method caters to different storage preferences and application requirements:
URI-based Metadata (IcrcX:metadata:uri
):
#Text
containing the URI.#Text(data:text/plain,Hello%20World
)#Text(ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi/dir/file.json
)#Text("data:application/json,{'name':'example','value':'data'}")
#Text("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...")
#Text(icdata://2222s-4iaaa-aaaaf-ax2uq-cai/item/64/data.json
) - An IC canister can retrieve this data in a trusted manner using http_request without having to resort to http-outcalls.#Text("https://foo.com/id/64/data.json")
- When a URL is encountered, the metadata should be loaded from this URL.Direct Value Metadata (icrcX:metadata:value
):
Value
type to support complex structures.Value
type, typically a map containing key-value pairs.//todo: Some outstanding questions on what to do about data in metadata that is Text, a URI, but NOT supposed to be traversed and included in the metadata. (Choice one is to have a specific tag in a map for this type of data ie icrc76:no_follow or two to have a tag for followable links ie icrc76:metadata:follow).
Locations that hold data on the IC that are both addressable from the IC and from https can use the IC-URI specification as follows:
ic-http://{canister_id}/{path}?[__icrc76hash={hash}&__icrc76mime={mimetype}
where
To ensure the integrity and authenticity of the metadata, especially when it is stored externally, a hash can optionally be provided:
Metadata Hash (icrcX:metadata:hash
):
#Blob
containing the sha256 hash value.Query String Paramater (__icrc76hash
):
icrcX:metadata:value
and/or JSON structure.ICRC-76 does not specifically specify these structures but encourages the extension of ICRC-76 via other ICRC proposals that will allow for standardization of data useful for parsing and interoperating with other systems.
Examples:
This standardized approach ensures flexibility in how metadata is stored and accessed while promoting consistency in its structure and verification. It supports both on-chain and off-chain storage strategies, caters to different levels of complexity in metadata content, and facilitates interoperability with existing blockchain ecosystems through compliance with popular standards like ERC-721 and ERC-1155.
This is already in a great shape, please find some comments in the forum to further improve it.
ICRC-3 extension that defines a value that is a record that points to external json metadata:
Map {
icrc123_url: Text; // Path to external json
hash?: '8o3vfuaowrgva' // Optional SHA-256 hash of external json UTF-8 string
path?: 'a.c.[2].d' // Optional path to json value within above json
}
The following url format:
ic-http://{canister_id}/{path}
Details like mime etc are not included since main purpose is to have urls that point to IC http urls without relying on a gateway in the url.
To provide a standardized approach to handling metadata for NFTs within the Internet Computer ecosystem, the ICRCX metadata standard has been designed. This standard facilitates multiple methods for specifying and verifying metadata, accommodating diverse NFT use cases and ensuring interoperability with existing standards. Below is a comprehensive description of the ICRCX metadata standard's specifications:
ICRCX Metadata Standard Specification
Metadata Retrieval Methods
The ICRCX standard supports several methods for associating metadata with NFTs. Each method caters to different storage preferences and application requirements:
URI-based Metadata (
IcrcX:metadata:uri
):#Text
containing the URI.Embedded JSON Metadata (
icrcX:metadata:json
):#Text
containing JSON data.Direct Value Metadata (
icrcX:metadata:value
):Value
type to support complex structures.Value
type, typically a map containing key-value pairs.Image Only Metadata (
icrcX:metadata:image
):#Text
containing the image URL.Canister-based Metadata (
icrcX:metadata:canister
):#Text(canisterID)
and#Text(path)
and an optional#Text(path)
format which shuld be json or candid.Optional Verification via Hash
To ensure the integrity and authenticity of the metadata, especially when it is stored externally, a hash can optionally be provided:
icrcX:metadata:hash
):#Blob
containing the hash value.Standard Items for
icrcX:metadata:value
When using the direct value method for metadata (
icrcX:metadata:value
), the following standard items are recommended within the metadata map:icrcX:name
: Text — Name of the NFT.icrcX:description
: Text — Description of the NFT.icrcX:image
: Text — URL or data URL pointing to an image representing the NFT.icrcX:preview
: Text — URL or data URL pointing to a thumbnail image of the NFT.icrcX:experience
: Text — URL or data URL pointing to a dapp for interacting with the NFT.icrcX:attributes
: Array of Maps — Each attribute is a map containing properties like trait type, value, and display type.JSON Format Compliance
When metadata is represented in JSON format (either embedded or via URI), it should adhere to widely accepted standards such as those established for ERC-721 or ERC-1155:
icrcX:metadata:format
, may be used to specify the metadata standard or version being followed (e.g., "erc721", "enjin", "opensea").Summary
This standardized approach ensures flexibility in how metadata is stored and accessed while promoting consistency in its structure and verification. It supports both on-chain and off-chain storage strategies, caters to different levels of complexity in metadata content, and facilitates interoperability with existing blockchain ecosystems through compliance with popular standards like ERC-721 and ERC-1155.