From 67cfed941c33d1998f2a04d3eb2ad93bf211ddb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Wed, 20 Oct 2021 14:57:14 +0200 Subject: [PATCH 01/31] [WIP] initial draft --- sips/sip-x/sip-x-nft-metadata.md | 163 +++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 sips/sip-x/sip-x-nft-metadata.md diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md new file mode 100644 index 000000000..e8b371476 --- /dev/null +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -0,0 +1,163 @@ +# Preamble + +SIP Number: X + +Title: Schema Definition for Metadata for Non-Fungible Tokens + +Author: Friedger Müffke (mail@friedger.de) + +Consideration: Technical + +Type: Standard + +Status: Draft + +Created: 20 October 2021 + +License: CC0-1.0 + +Sign-off: + +# Abstract + +Non-fungible tokens or NFTs for short are digital assets registered on blockchain with unique identifiers and properties that distinguish them from each other. SIP-009 defines the trait how ownership of an NFT is managed. This SIP aims to provide a flexible standard to attach meta data to NFTs, like descriptions or urls to digital files. + +# License and Copyright + +This SIP is made available under the terms of the Creative Commons CC0 1.0 Universal license, available at https://creativecommons.org/publicdomain/zero/1.0/ +This SIP’s copyright is held by the Stacks Open Internet Foundation. + +# Introduction + +Tokens are digital assets registered on blockchain through a smart contract. A non-fungible token (NFT) is a token that is globally unique and can be identified through its unique identifier. In blockchains with smart contracts, including the Stacks blockchain, developers and users can use smart contracts to register and interact with non-fungible tokens. + +Some use cases of NFTs are name registration, digital art, certification, media and enternainment, real-estate. They all require that users associate certain content with an NFT. In general, it is helpful for the users to have a name, sound, image that represents this content. + +# Specification + +Every SIP-X compliant smart contract in Stacks blockchain must be SIP-009 compliant and must meet the following requirements for the return value of function `get-token-uri`: + +## Return Value of `get-token-uri` + +The return value must be a `some` value if and only if the provided parameter `id` is the key of an NFT that was minted and not burnt, otherwise the value must be `none`. + +For minted and not burnt NFTs, the inner value of the return value must be a string representing a resolvable URI. For string containing `{id}`, the `{id}` part must be replaced by the id in decimal format given in the function call. + +The resolved data must be a JSON blob. + +## JSON scheme of Metadata + +The JSON blob resolved through the token uri must follow the following JSON schema. If the string `{id}` exists in any JSON value, it MUST be replaced with the actual token id in decimal format, by all client software that follows this standard. + +``` +{ + "title": "Token Metadata", + "type": "object", + "required": [], + "properties": { + "name": { + "type": "string", + "description": "Identifies the asset to which this token represents" + }, + "description": { + "type": "string", + "description": "Describes the asset to which this token represents" + }, + "image": { + "type": "string", + "description": "A URI pointing to a resource with mime type image/* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive." + }, + "attributes": { + "type": "array", + "description": "Arbitrary NFT attributes. Values may be strings, numbers, object or arrays." + "items: { + "type": "object", + "properties": { + "display_type": "string", + "trait_type": "string", + "value": {"not": {"type": "object"}}, + } + } + }, + "properties": { + "type": "object", + "description": "Arbitrary properties. Values may be strings, numbers, object or arrays." + }, + "localization": { + "type": "object", + "required": ["uri", "default", "locales"], + "properties": { + "uri": { + "type": "string", + "description": "The URI pattern to fetch localized data from. This URI should contain the substring `{locale}` which will be replaced with the appropriate locale value before sending the request." + }, + "default": { + "type": "string", + "description": "The locale of the default data within the base JSON" + }, + "locales": { + "type": "array", + "description": "The list of locales for which data is available. These locales should conform to those defined in the Unicode Common Locale Data Repository (http://cldr.unicode.org/)." + } + } + } + } +} +``` + +### Examples + +# Using NFTs in applications + +Before presenting metadata to users, application developers should verify whether the metadata is compliant with the applications guidelines. + +We remind implementation authors that the empty string for the token uri is a valid response. We also remind everyone that any smart contract can use the same metadata as other NFT contracts. It is out of the scope of this standard to define how a client may determine which smart contracts are is the original, well-known, canonical one. + +Furthermore, accessiblity of content is not covered by the standard. + +Note, that metadata might change over time. + +# Related Work + +NFTs are an established asset class on blockchains. Read for example [here](https://www.ledger.com/academy/what-are-nft). + +## BNS + +The Blockchain Naming System uses native non-fungible tokens. It does define metadata for a name through attachements. The schema for names owned by a person follows the definition of (schema.org/Person)[https://schema.org/Person]. This could be an alternative to token URIs. + +## EIP 721 and 1155 + +Metadata for NFTs on Ethereum are defined in [EIP 721](https://eips.ethereum.org/EIPS/eip-721) and [EIP 1155](https://eips.ethereum.org/EIPS/eip-1155). The JSON schema for SIP-X has adopted the EIP 1155 schema with the following differences: + +* substitution of `{id}` strings must use the decimal format not the hexdecimal, zero-padded format. + +# Backwards Compatibility + +## Meta data functions + +Some contracts have dedicated functions to provide metadata. + +### Boom + +The [NFT contract for Boom](https://explorer.stacks.co/txid/0x423d113e14791f5d60f5efbee19bbb05cf5e68d84bcec4e611f2c783b08d05aa?chain=mainnet) implements a variation of this trait using similar naming, but returning other types than response types. + +The function signatures for metadata are: + +- `(get-boom-meta () {uri: (string-ascii 35), name: (string-ascii 16), mime-type: (string-ascii 9)})` and +- `(get-meta? uint {series-id: uint, number: uint, name: (string-utf8 80), uri: (string-ascii 2048), mime-type: (string-ascii 129), hash: (buff 64)})` + +### Badges + +The [badges contract](https://explorer.stacks.co/txid/0xb874ddbb4a602c22bb5647c7a2f8bfcafbbca7c0c663a175f2270ef3665f33de?chain=mainnet) defines metadata for nfts. + +The function signatures for metadata are: + +- `(get-badge-meta () {uri: (string-ascii 78111)})` and +- `(get-meta? (uint) (optional {user: principal}))` + +### Beeple + + +# Activation + +This SIP is activated if 5 contracts are deployed that use the same trait that follows this specification. This must happen before Bitcoin tip #750,000. From e0317e14f68e925849405e2ff2b3371a270dd437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sat, 23 Oct 2021 13:32:35 +0200 Subject: [PATCH 02/31] fix metadata spelling, add $schema, require 'version', 'name', 'image' --- sips/sip-x/sip-x-nft-metadata.md | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index e8b371476..29bbdffed 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -20,7 +20,7 @@ Sign-off: # Abstract -Non-fungible tokens or NFTs for short are digital assets registered on blockchain with unique identifiers and properties that distinguish them from each other. SIP-009 defines the trait how ownership of an NFT is managed. This SIP aims to provide a flexible standard to attach meta data to NFTs, like descriptions or urls to digital files. +Non-fungible tokens or NFTs for short are digital assets registered on blockchain with unique identifiers and properties that distinguish them from each other. SIP-009 defines the trait for how ownership of an NFT is managed. This SIP aims to provide a flexible standard to attach metadata to NFTs, like descriptions or urls to digital files. # License and Copyright @@ -51,10 +51,15 @@ The JSON blob resolved through the token uri must follow the following JSON sche ``` { + "$schema": "http://json-schema.org/draft-07/schema#", "title": "Token Metadata", "type": "object", - "required": [], + "required": ["version", "name", "image"], "properties": { + "version": { + "type": number, + "description": "Version of the JSON schema for NFT metadata. For this SIP, the version number must be `1`." + }, "name": { "type": "string", "description": "Identifies the asset to which this token represents" @@ -75,7 +80,7 @@ The JSON blob resolved through the token uri must follow the following JSON sche "properties": { "display_type": "string", "trait_type": "string", - "value": {"not": {"type": "object"}}, + "value": {"oneOf": [{"type": "object"}, {"type": "string"},{"type: "array"}}, } } }, @@ -107,15 +112,16 @@ The JSON blob resolved through the token uri must follow the following JSON sche ### Examples -# Using NFTs in applications +# Using NFT metadata in applications -Before presenting metadata to users, application developers should verify whether the metadata is compliant with the applications guidelines. +Before presenting metadata to users, application developers should verify whether the metadata is compliant with the application's guidelines. We remind implementation authors that the empty string for the token uri is a valid response. We also remind everyone that any smart contract can use the same metadata as other NFT contracts. It is out of the scope of this standard to define how a client may determine which smart contracts are is the original, well-known, canonical one. -Furthermore, accessiblity of content is not covered by the standard. +# Out of Scope +Accessiblity of content is not covered by the standard. -Note, that metadata might change over time. +Properties other than resolvability of the token uri are out of scope. This implies that metadata might change over time (stability). # Related Work @@ -129,7 +135,7 @@ The Blockchain Naming System uses native non-fungible tokens. It does define met Metadata for NFTs on Ethereum are defined in [EIP 721](https://eips.ethereum.org/EIPS/eip-721) and [EIP 1155](https://eips.ethereum.org/EIPS/eip-1155). The JSON schema for SIP-X has adopted the EIP 1155 schema with the following differences: -* substitution of `{id}` strings must use the decimal format not the hexdecimal, zero-padded format. +- substitution of `{id}` strings must use the decimal format not the hexdecimal, zero-padded format. # Backwards Compatibility @@ -157,7 +163,6 @@ The function signatures for metadata are: ### Beeple - # Activation This SIP is activated if 5 contracts are deployed that use the same trait that follows this specification. This must happen before Bitcoin tip #750,000. From 680f17518c05938d664ac13690f8bb43797aaa05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sat, 23 Oct 2021 16:02:29 +0200 Subject: [PATCH 03/31] add comment about length of string values --- sips/sip-x/sip-x-nft-metadata.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index 29bbdffed..08276a134 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -110,6 +110,8 @@ The JSON blob resolved through the token uri must follow the following JSON sche } ``` +The lengths of string values is not restricted. Nowadays, clients should be smart enough to deal with values of different lengths. + ### Examples # Using NFT metadata in applications @@ -119,6 +121,7 @@ Before presenting metadata to users, application developers should verify whethe We remind implementation authors that the empty string for the token uri is a valid response. We also remind everyone that any smart contract can use the same metadata as other NFT contracts. It is out of the scope of this standard to define how a client may determine which smart contracts are is the original, well-known, canonical one. # Out of Scope + Accessiblity of content is not covered by the standard. Properties other than resolvability of the token uri are out of scope. This implies that metadata might change over time (stability). From 1cd310c92c17b339cade87b93bd28af427d4b2b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sat, 23 Oct 2021 16:38:26 +0200 Subject: [PATCH 04/31] generalize for any metadata function --- sips/sip-x/sip-x-nft-metadata.md | 45 ++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index 08276a134..0ec79c6a6 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -35,19 +35,25 @@ Some use cases of NFTs are name registration, digital art, certification, media # Specification -Every SIP-X compliant smart contract in Stacks blockchain must be SIP-009 compliant and must meet the following requirements for the return value of function `get-token-uri`: +Every SIP-X compliant smart contract in Stacks blockchain must implement one or more functions that return a resolvable/retrievable uri referencing metadata. The metadata provide information for displaying a digital asset to users. This type of function is named "metadata uri functions". -## Return Value of `get-token-uri` +Appendix A contains a list of trait functions that must meet the following requirements for the return value. The appendix can be extended without changing the ratification status of this SIP. -The return value must be a `some` value if and only if the provided parameter `id` is the key of an NFT that was minted and not burnt, otherwise the value must be `none`. +## Return Value of Metadata URI Functions -For minted and not burnt NFTs, the inner value of the return value must be a string representing a resolvable URI. For string containing `{id}`, the `{id}` part must be replaced by the id in decimal format given in the function call. +The return value must be a `some` value if and only if the metadata reference an existing token, otherwise the value must be `none`. Appendix A specifies the exact meaning of "existingt" for each function. -The resolved data must be a JSON blob. +For existing tokens, the inner value of the return value must be a string representing a resolvable URI. + +If a metadata uri function expects a parameter of type `uint` that identifies a token and the resulting strings contains `{id}`, then the `{id}` part must be replaced by the identifier in decimal format given in the function call. + +The resolved data of the URI must be a JSON blob. ## JSON scheme of Metadata -The JSON blob resolved through the token uri must follow the following JSON schema. If the string `{id}` exists in any JSON value, it MUST be replaced with the actual token id in decimal format, by all client software that follows this standard. +The JSON blob resolved through the uri must follow the following JSON schema. + +If metadata were retrieved by a function call containing a token identifier and the string `{id}` exists in any JSON value, it MUST be replaced with the actual token id in decimal format, by all client software that follows this standard. ``` { @@ -58,15 +64,15 @@ The JSON blob resolved through the token uri must follow the following JSON sche "properties": { "version": { "type": number, - "description": "Version of the JSON schema for NFT metadata. For this SIP, the version number must be `1`." + "description": "Version of the JSON schema for metadata. For this SIP, the version number must be `1`." }, "name": { "type": "string", - "description": "Identifies the asset to which this token represents" + "description": "Identifies the asset which this token represents" }, "description": { "type": "string", - "description": "Describes the asset to which this token represents" + "description": "Describes the asset which this token represents" }, "image": { "type": "string", @@ -74,7 +80,7 @@ The JSON blob resolved through the token uri must follow the following JSON sche }, "attributes": { "type": "array", - "description": "Arbitrary NFT attributes. Values may be strings, numbers, object or arrays." + "description": "Arbitrary attributes. Values may be strings, numbers, object or arrays." "items: { "type": "object", "properties": { @@ -114,7 +120,7 @@ The lengths of string values is not restricted. Nowadays, clients should be smar ### Examples -# Using NFT metadata in applications +# Using metadata in applications Before presenting metadata to users, application developers should verify whether the metadata is compliant with the application's guidelines. @@ -142,7 +148,7 @@ Metadata for NFTs on Ethereum are defined in [EIP 721](https://eips.ethereum.org # Backwards Compatibility -## Meta data functions +## Metadata functions Some contracts have dedicated functions to provide metadata. @@ -164,8 +170,19 @@ The function signatures for metadata are: - `(get-badge-meta () {uri: (string-ascii 78111)})` and - `(get-meta? (uint) (optional {user: principal}))` -### Beeple - # Activation This SIP is activated if 5 contracts are deployed that use the same trait that follows this specification. This must happen before Bitcoin tip #750,000. + +# Appendix A + +List of trait function define in SIPs and specifications specific to these functions + +|-----------------------------|-------------------------|--------------------| +| SIP and Trait Function Name | Definition of "existing"| Additional specification for properties| identifier parameter| +|-----------------------------|-------------------------|--------------------|-----| +| SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | | 1st | +| SIP-X get-contract-uri | contract must be deployed| | X | +| SIP-010 ft-trait.get-token-uri | contract must be deployed| | X | +| SIP-013 sip013-semi-fungible-token-trait.get-token-uri | token must be minted and not burnt, no requirements on the number of fungible part of the token| | 1st | +|--------------------------------|-----------------------|-------------------|------| \ No newline at end of file From 88114b297ba5d96d215d4f04a58b104433c181b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sat, 23 Oct 2021 16:44:26 +0200 Subject: [PATCH 05/31] clarify activation rule, fix table --- sips/sip-x/sip-x-nft-metadata.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index 0ec79c6a6..790a4f800 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -172,17 +172,16 @@ The function signatures for metadata are: # Activation -This SIP is activated if 5 contracts are deployed that use the same trait that follows this specification. This must happen before Bitcoin tip #750,000. +This SIP is activated if 5 contracts are deployed that follows this specification. This must happen before Bitcoin tip #750,000. # Appendix A List of trait function define in SIPs and specifications specific to these functions -|-----------------------------|-------------------------|--------------------| -| SIP and Trait Function Name | Definition of "existing"| Additional specification for properties| identifier parameter| + +| SIP and Trait Function Name | Definition of "existing"| Additional Specification for Properties| Identifier Parameter| |-----------------------------|-------------------------|--------------------|-----| -| SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | | 1st | -| SIP-X get-contract-uri | contract must be deployed| | X | -| SIP-010 ft-trait.get-token-uri | contract must be deployed| | X | +| SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | NFTs belonging to a group of tokens should use property "properties.collection" for the collection name. | 1st | +| SIP-X get-contract-uri | always | | X | +| SIP-010 ft-trait.get-token-uri | always| | X | | SIP-013 sip013-semi-fungible-token-trait.get-token-uri | token must be minted and not burnt, no requirements on the number of fungible part of the token| | 1st | -|--------------------------------|-----------------------|-------------------|------| \ No newline at end of file From ab2cb4629e4d5e4c23ea08b1357174f2ab08332e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sat, 23 Oct 2021 16:50:53 +0200 Subject: [PATCH 06/31] add properties.id --- sips/sip-x/sip-x-nft-metadata.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index 790a4f800..aae67d030 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -182,6 +182,7 @@ List of trait function define in SIPs and specifications specific to these funct | SIP and Trait Function Name | Definition of "existing"| Additional Specification for Properties| Identifier Parameter| |-----------------------------|-------------------------|--------------------|-----| | SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | NFTs belonging to a group of tokens should use property "properties.collection" for the collection name. | 1st | + | | Optional property "properties.id" describes the identifier of the token | | | SIP-X get-contract-uri | always | | X | | SIP-010 ft-trait.get-token-uri | always| | X | | SIP-013 sip013-semi-fungible-token-trait.get-token-uri | token must be minted and not burnt, no requirements on the number of fungible part of the token| | 1st | From 7fcd7ea740d97a00d3100ff36450734a09f8171c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sat, 23 Oct 2021 16:53:30 +0200 Subject: [PATCH 07/31] fix table --- sips/sip-x/sip-x-nft-metadata.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index aae67d030..e4e1bfb03 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -181,8 +181,7 @@ List of trait function define in SIPs and specifications specific to these funct | SIP and Trait Function Name | Definition of "existing"| Additional Specification for Properties| Identifier Parameter| |-----------------------------|-------------------------|--------------------|-----| -| SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | NFTs belonging to a group of tokens should use property "properties.collection" for the collection name. | 1st | - | | Optional property "properties.id" describes the identifier of the token | | +| SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | NFTs belonging to a group of tokens should use property "properties.collection" for the collection name.
Optional property "properties.id" describes the identifier of the token. | 1st | | SIP-X get-contract-uri | always | | X | | SIP-010 ft-trait.get-token-uri | always| | X | | SIP-013 sip013-semi-fungible-token-trait.get-token-uri | token must be minted and not burnt, no requirements on the number of fungible part of the token| | 1st | From 5baa404e004b107b4012299e02b3f815a0eed380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sat, 23 Oct 2021 17:30:05 +0200 Subject: [PATCH 08/31] improve attributes --- sips/sip-x/sip-x-nft-metadata.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index e4e1bfb03..ad46326b4 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -83,10 +83,11 @@ If metadata were retrieved by a function call containing a token identifier and "description": "Arbitrary attributes. Values may be strings, numbers, object or arrays." "items: { "type": "object", + "required": ["value"], "properties": { "display_type": "string", "trait_type": "string", - "value": {"oneOf": [{"type": "object"}, {"type": "string"},{"type: "array"}}, + "value": {"oneOf": [{"type": "object"}, {"type": "string"}, {"type": "number"}, {"type: "array"}}, } } }, @@ -120,6 +121,15 @@ The lengths of string values is not restricted. Nowadays, clients should be smar ### Examples +### Attributes +Attributes describe addition elements of tokens that are "observable", usually represented in the image of the token. + +In contrast, properties describe elements of tokens that are more abstract. + +An attribute consists of a `trait_type` defining the name of the trait, `value` is the value of the trait, and `display_type` is a field indicating how you would like it to be displayed. + +Appendix B describes type of attributes + # Using metadata in applications Before presenting metadata to users, application developers should verify whether the metadata is compliant with the application's guidelines. @@ -181,7 +191,18 @@ List of trait function define in SIPs and specifications specific to these funct | SIP and Trait Function Name | Definition of "existing"| Additional Specification for Properties| Identifier Parameter| |-----------------------------|-------------------------|--------------------|-----| -| SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | NFTs belonging to a group of tokens should use property "properties.collection" for the collection name.
Optional property "properties.id" describes the identifier of the token. | 1st | +| SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | NFTs belonging to a group of tokens should use property `properties.collection` of type `string` for the collection name.
Optional property `properties.id` of type `integer` describes the identifier of the token. | 1st | | SIP-X get-contract-uri | always | | X | -| SIP-010 ft-trait.get-token-uri | always| | X | +| SIP-010 ft-trait.get-token-uri | always| The required property `decimals` of type `integer` must be the same number as `get-decimals`. | X | | SIP-013 sip013-semi-fungible-token-trait.get-token-uri | token must be minted and not burnt, no requirements on the number of fungible part of the token| | 1st | + + +# Appendix B + +Attribute types + +| Type | Display types | Additional Properties | +|------|-------------|-----------------------| +| Numeric | `number`, `boost_percentage`, `boost_number` | `max_value`| +| Date | `date` | | +| String | empty | | \ No newline at end of file From 011592709254b60651d71dee74d19b177d67e9b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sat, 23 Oct 2021 18:37:36 +0200 Subject: [PATCH 09/31] add properties section --- sips/sip-x/sip-x-nft-metadata.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index ad46326b4..1743ac6f3 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -121,6 +121,8 @@ The lengths of string values is not restricted. Nowadays, clients should be smar ### Examples +### Properties +Commone properties are `created` of type `integer` defining the creation date of the token. ### Attributes Attributes describe addition elements of tokens that are "observable", usually represented in the image of the token. @@ -192,7 +194,7 @@ List of trait function define in SIPs and specifications specific to these funct | SIP and Trait Function Name | Definition of "existing"| Additional Specification for Properties| Identifier Parameter| |-----------------------------|-------------------------|--------------------|-----| | SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | NFTs belonging to a group of tokens should use property `properties.collection` of type `string` for the collection name.
Optional property `properties.id` of type `integer` describes the identifier of the token. | 1st | -| SIP-X get-contract-uri | always | | X | +| SIP-X get-contract-uri | always | `properties.items` of type array can be used to provide the metadata of all tokens belonging to the collection | X | | SIP-010 ft-trait.get-token-uri | always| The required property `decimals` of type `integer` must be the same number as `get-decimals`. | X | | SIP-013 sip013-semi-fungible-token-trait.get-token-uri | token must be minted and not burnt, no requirements on the number of fungible part of the token| | 1st | @@ -201,8 +203,8 @@ List of trait function define in SIPs and specifications specific to these funct Attribute types -| Type | Display types | Additional Properties | +| Type | Display types | Additional Properties | Comment | |------|-------------|-----------------------| -| Numeric | `number`, `boost_percentage`, `boost_number` | `max_value`| -| Date | `date` | | -| String | empty | | \ No newline at end of file +| Numeric | `number`, `boost_percentage`, `boost_number` | `max_value`| | +| Date | `date` | | As unix timestamp in UTC | +| String | empty | | | \ No newline at end of file From c53ec7bacefbbc5625c71ae582f5dd813e9b0459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sun, 7 Nov 2021 15:49:17 +0100 Subject: [PATCH 10/31] Update sip-x-nft-metadata.md --- sips/sip-x/sip-x-nft-metadata.md | 99 +++++++++++++++++++++++++++++--- 1 file changed, 92 insertions(+), 7 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index 1743ac6f3..e727f5688 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -12,7 +12,7 @@ Type: Standard Status: Draft -Created: 20 October 2021 +Created: 7 November 2021 License: CC0-1.0 @@ -101,7 +101,7 @@ If metadata were retrieved by a function call containing a token identifier and "properties": { "uri": { "type": "string", - "description": "The URI pattern to fetch localized data from. This URI should contain the substring `{locale}` which will be replaced with the appropriate locale value before sending the request." + "description": "The URI pattern to fetch localized data from. This URI should contain the substring `{locale}` which will be replaced with the appropriate locale value before sending the request. See section about localization for more rules" }, "default": { "type": "string", @@ -119,10 +119,86 @@ If metadata were retrieved by a function call containing a token identifier and The lengths of string values is not restricted. Nowadays, clients should be smart enough to deal with values of different lengths. -### Examples +### Example +token101.json +``` +{ + "version": 1, + "name": "Foo #101", + "image": "ipfs://somerandomecid", + "attributes": [ + { + "trait_type": "hair", + "value": "red", + }, + { + "trait_type": "strength", + "display_type": "number", + "value": 99, + }, + ], + "properties": { + { + "collection": "Foo Collection", + "collection_size": "10000" + }, + }, + "localization": { + "uri": "ipfs://somerandomcid/{locale}.json", + "default": "en", + "locales": ["en", "pt-BR", "de"] + } +} +``` + +de.json +``` +{ + "version": 1, + "attritbutes: [ + { + "trait_type": "Haare", + "value": "rot", + }, + { + "trait_type": "Stärke", + "display_type": "number", + "value": 99, + }, + ] +} +``` + + +pt-BR.json +``` +{ + "version": 1, + "attritbutes: [ + { + "trait_type": "cabelos", + "value": "vermelho", + }, + { + "trait_type": "amido", + "display_type": "number", + "value": 99, + }, + ] +} +``` ### Properties -Commone properties are `created` of type `integer` defining the creation date of the token. +Common properties are + +| Name | Type | Description | +|------|------|-------------| +| `collection` | `string` | collection name the token belongs to. See also Appendix A. | +| `decimals` | `integer` | number of decimals. See also Appendix A. | +| `id` | `integer` | identifier for NFTs. See also Appendix A. | +| `created` | `integer` | creation date of the token in unix timestamp | +| `symbol` | `string` | token symbol | + ### Attributes Attributes describe addition elements of tokens that are "observable", usually represented in the image of the token. @@ -132,6 +208,15 @@ An attribute consists of a `trait_type` defining the name of the trait, `value` Appendix B describes type of attributes +## Localization +The localized data follow the same JSON schema with property `version` as required and all other properties as optional. + +The localized data overwrite data provided in the default meta data JSON. The localized data can provide only partial data. + +An array of localized `attributes` overwrites the whole list of default `attributes`. + +A localized properties with partial data overwrites only the provided properties, the remaining default properties remain as default values. + # Using metadata in applications Before presenting metadata to users, application developers should verify whether the metadata is compliant with the application's guidelines. @@ -204,7 +289,7 @@ List of trait function define in SIPs and specifications specific to these funct Attribute types | Type | Display types | Additional Properties | Comment | -|------|-------------|-----------------------| +|------|---------------|-----------------------|---------| | Numeric | `number`, `boost_percentage`, `boost_number` | `max_value`| | -| Date | `date` | | As unix timestamp in UTC | -| String | empty | | | \ No newline at end of file +| Date | `date` | | As unix timestamp in UTC | +| String | empty | | | From 661ba2a073b48aa4a45e30251182adff9a2f4057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Mon, 8 Nov 2021 10:26:24 +0100 Subject: [PATCH 11/31] Update sip-x-nft-metadata.md --- sips/sip-x/sip-x-nft-metadata.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index e727f5688..9c285266d 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -31,7 +31,7 @@ This SIP’s copyright is held by the Stacks Open Internet Foundation. Tokens are digital assets registered on blockchain through a smart contract. A non-fungible token (NFT) is a token that is globally unique and can be identified through its unique identifier. In blockchains with smart contracts, including the Stacks blockchain, developers and users can use smart contracts to register and interact with non-fungible tokens. -Some use cases of NFTs are name registration, digital art, certification, media and enternainment, real-estate. They all require that users associate certain content with an NFT. In general, it is helpful for the users to have a name, sound, image that represents this content. +Some use cases of NFTs are name registration, digital art, certification, media and entertainment, real-estate. They all require that users associate certain content with an NFT. In general, it is helpful for the users to have a name, sound, image that represents this content. # Specification @@ -41,7 +41,7 @@ Appendix A contains a list of trait functions that must meet the following requi ## Return Value of Metadata URI Functions -The return value must be a `some` value if and only if the metadata reference an existing token, otherwise the value must be `none`. Appendix A specifies the exact meaning of "existingt" for each function. +The return value must be a `some` value if and only if the metadata reference an existing token, otherwise the value must be `none`. Appendix A specifies the exact meaning of "existing" for each function. For existing tokens, the inner value of the return value must be a string representing a resolvable URI. @@ -137,12 +137,10 @@ token101.json "value": 99, }, ], - "properties": { - { + "properties": { "collection": "Foo Collection", "collection_size": "10000" - }, - }, + }, "localization": { "uri": "ipfs://somerandomcid/{locale}.json", "default": "en", From 5c82e0084399090ef42163c9d8cbed8d2f73ce07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Mon, 8 Nov 2021 10:39:34 +0100 Subject: [PATCH 12/31] add ip_document_uri as property --- sips/sip-x/sip-x-nft-metadata.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index 9c285266d..dcc77820c 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -196,6 +196,7 @@ Common properties are | `id` | `integer` | identifier for NFTs. See also Appendix A. | | `created` | `integer` | creation date of the token in unix timestamp | | `symbol` | `string` | token symbol | +| `ip_document_uri` | `string` | link to document about intellectual property (IP) rights | ### Attributes Attributes describe addition elements of tokens that are "observable", usually represented in the image of the token. From bc2ba1e3a0c07564fff60c03c3ec28dc5eceea42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Mon, 15 Nov 2021 16:24:54 +0100 Subject: [PATCH 13/31] add raw_media_file properties --- sips/sip-x/sip-x-nft-metadata.md | 67 +++++++++++++++++++++++++++----- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index dcc77820c..7d3c41fdc 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -76,7 +76,7 @@ If metadata were retrieved by a function call containing a token identifier and }, "image": { "type": "string", - "description": "A URI pointing to a resource with mime type image/* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive." + "description": "A URI pointing to a resource with mime type image/* representing the asset to which this token represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive. If the token represents a media file of different mime-type or of higher quality defined in property 'raw_media_file_uri', then this image should be used as preview image like a cover for music, or an low-res image." }, "attributes": { "type": "array", @@ -187,16 +187,42 @@ pt-BR.json ``` ### Properties -Common properties are +Common properties are described in Appendic C. -| Name | Type | Description | -|------|------|-------------| -| `collection` | `string` | collection name the token belongs to. See also Appendix A. | -| `decimals` | `integer` | number of decimals. See also Appendix A. | -| `id` | `integer` | identifier for NFTs. See also Appendix A. | -| `created` | `integer` | creation date of the token in unix timestamp | -| `symbol` | `string` | token symbol | -| `ip_document_uri` | `string` | link to document about intellectual property (IP) rights | +### Properties +Common properties are described in appendix C. Properties of type object are usually described using the following schema: +``` +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Token Metadata Property", + "type": "object", + "required": ["value"], + "properties": { + "type": { + "type": "string", + "description": "type of the property" + }, + "description": { + "type": "string", + "description": "description of the property" + }, + "value": { + "type": any, + "description": "value of the property" + } + } +} +``` + +Example: + +``` +{ + "type": "string", + "description": "Address of custodian key holder", + "value": "Casa Inc., P.O. Box 20575, Charleston, S.C. 29413, United States." +} +``` ### Attributes Attributes describe addition elements of tokens that are "observable", usually represented in the image of the token. @@ -242,6 +268,8 @@ Metadata for NFTs on Ethereum are defined in [EIP 721](https://eips.ethereum.org - substitution of `{id}` strings must use the decimal format not the hexdecimal, zero-padded format. +- properties of type object should use property `value` for the value, not property `description` as used by some EIP-1155 NFTs. + # Backwards Compatibility ## Metadata functions @@ -292,3 +320,22 @@ Attribute types | Numeric | `number`, `boost_percentage`, `boost_number` | `max_value`| | | Date | `date` | | As unix timestamp in UTC | | String | empty | | | + +# Appendic C + +Common Properties with predefined types. + +| Name | Type | Description | +|------|------|-------------| +| `collection` | `string` | collection name the token belongs to. See also Appendix A. | +| `decimals` | `integer` | number of decimals. See also Appendix A. | +| `id` | `integer` | identifier for NFTs. See also Appendix A. | +| `created` | `integer` | creation date of the token in unix timestamp | +| `symbol` | `string` | token symbol | +| `total_supply`| `integer` | number of total supply, e.g. minted tokens | +| `ip_document_uri` | `string` | link to document about intellectual property (IP) rights | +| `external_url` | `string` | url that will view the token on an external site | +| `raw_media_file_uri` | `string` | uri of the media represented by the token | +| `raw_media_file_type` | `string` | mime-type of the media represented by the token | +| `raw_media_file_signature` | `string` | signature of the media file represented by the token | +| `raw_media_file_signature_type` | `string` | signature type of the media represented by the token, e.g. SHA-256 | From 02e85fbfe6f5d3b0a761aaefa4d1862a0a010ad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Fri, 19 Nov 2021 15:31:09 +0100 Subject: [PATCH 14/31] add valid uri schema, more properties, remove requirement for image, and properties.value. --- sips/sip-x/sip-x-nft-metadata.md | 190 +++++++++++++++++++------------ 1 file changed, 117 insertions(+), 73 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index 7d3c41fdc..e6fa9dd04 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -35,7 +35,7 @@ Some use cases of NFTs are name registration, digital art, certification, media # Specification -Every SIP-X compliant smart contract in Stacks blockchain must implement one or more functions that return a resolvable/retrievable uri referencing metadata. The metadata provide information for displaying a digital asset to users. This type of function is named "metadata uri functions". +Every SIP-X compliant smart contract in Stacks blockchain must implement one or more functions that return a resolvable/retrievable uri referencing metadata. The metadata provide information e.g. for displaying a digital asset to users. This type of function is named "metadata uri functions". Appendix A contains a list of trait functions that must meet the following requirements for the return value. The appendix can be extended without changing the ratification status of this SIP. @@ -43,7 +43,9 @@ Appendix A contains a list of trait functions that must meet the following requi The return value must be a `some` value if and only if the metadata reference an existing token, otherwise the value must be `none`. Appendix A specifies the exact meaning of "existing" for each function. -For existing tokens, the inner value of the return value must be a string representing a resolvable URI. +For existing tokens, the inner value of the return value must be a string representing a resolvable URI. + +The schema of the resolvable URI is not specified and should be a well-known schema like `https`, `ar`, `ipfs`, `sia`. A `data` URI is also valid, however, the length is limited by this SIP. If a metadata uri function expects a parameter of type `uint` that identifies a token and the resulting strings contains `{id}`, then the `{id}` part must be replaced by the identifier in decimal format given in the function call. @@ -51,7 +53,7 @@ The resolved data of the URI must be a JSON blob. ## JSON scheme of Metadata -The JSON blob resolved through the uri must follow the following JSON schema. +The JSON blob resolved through the uri must follow the following JSON schema. If metadata were retrieved by a function call containing a token identifier and the string `{id}` exists in any JSON value, it MUST be replaced with the actual token id in decimal format, by all client software that follows this standard. @@ -60,7 +62,7 @@ If metadata were retrieved by a function call containing a token identifier and "$schema": "http://json-schema.org/draft-07/schema#", "title": "Token Metadata", "type": "object", - "required": ["version", "name", "image"], + "required": ["version", "name"], "properties": { "version": { "type": number, @@ -87,7 +89,7 @@ If metadata were retrieved by a function call containing a token identifier and "properties": { "display_type": "string", "trait_type": "string", - "value": {"oneOf": [{"type": "object"}, {"type": "string"}, {"type": "number"}, {"type: "array"}}, + "value": {"oneOf": [{"type": "object"}, {"type": "string"}, {"type": "number"}, {"type": "integer"}, {"type": "boolean"} {"type: "array"}}, } } }, @@ -112,7 +114,19 @@ If metadata were retrieved by a function call containing a token identifier and "description": "The list of locales for which data is available. These locales should conform to those defined in the Unicode Common Locale Data Repository (http://cldr.unicode.org/)." } } - } + }, + "image_data": { + "type": "string", + "description": "Raw SVG image data. Deprecated. Use `properties.image_data`." + }, + "external_url": { + "type": "string", + "description": "Url to view the item on a 3rd party web site. Deprecated. Use `properties.external_url`." + }, + "animation_url": { + "type": "string", + "description": "URL to a multi-media attachment for the item. Deprecated. Use `properties.animation_url`." + }, } } ``` @@ -120,27 +134,29 @@ If metadata were retrieved by a function call containing a token identifier and The lengths of string values is not restricted. Nowadays, clients should be smart enough to deal with values of different lengths. ### Example + token101.json + ``` { "version": 1, "name": "Foo #101", "image": "ipfs://somerandomecid", "attributes": [ - { - "trait_type": "hair", + { + "trait_type": "hair", "value": "red", }, { "trait_type": "strength", "display_type": "number", "value": 99, - }, + }, ], - "properties": { + "properties": { "collection": "Foo Collection", - "collection_size": "10000" - }, + "collection_size": "10000" + }, "localization": { "uri": "ipfs://somerandomcid/{locale}.json", "default": "en", @@ -150,16 +166,17 @@ token101.json ``` de.json + ``` { "version": 1, "attritbutes: [ - { - "trait_type": "Haare", + { + "trait_type": "Haare", "value": "rot", }, - { - "trait_type": "Stärke", + { + "trait_type": "Stärke", "display_type": "number", "value": 99, }, @@ -167,18 +184,18 @@ de.json } ``` - pt-BR.json + ``` { "version": 1, "attritbutes: [ - { - "trait_type": "cabelos", + { + "trait_type": "cabelos", "value": "vermelho", }, - { - "trait_type": "amido", + { + "trait_type": "amido", "display_type": "number", "value": 99, }, @@ -187,16 +204,15 @@ pt-BR.json ``` ### Properties -Common properties are described in Appendic C. -### Properties Common properties are described in appendix C. Properties of type object are usually described using the following schema: + ``` { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Token Metadata Property", "type": "object", - "required": ["value"], + "required": [], "properties": { "type": { "type": "string", @@ -207,7 +223,7 @@ Common properties are described in appendix C. Properties of type object are usu "description": "description of the property" }, "value": { - "type": any, + "type": {"oneOf": [{"type": "object"}, {"type": "string"}, {"type": "number"}, {"type": "integer"}, {"type": "boolean"} {"type: "array"}}, "description": "value of the property" } } @@ -218,23 +234,25 @@ Example: ``` { - "type": "string", - "description": "Address of custodian key holder", + "type": "string", + "description": "Address of custodian key holder", "value": "Casa Inc., P.O. Box 20575, Charleston, S.C. 29413, United States." } ``` ### Attributes + Attributes describe addition elements of tokens that are "observable", usually represented in the image of the token. In contrast, properties describe elements of tokens that are more abstract. -An attribute consists of a `trait_type` defining the name of the trait, `value` is the value of the trait, and `display_type` is a field indicating how you would like it to be displayed. +An attribute consists of a `trait_type` defining the name of the trait, `value` is the value of the trait, and `display_type` is a field indicating how you would like it to be displayed. Appendix B describes type of attributes ## Localization -The localized data follow the same JSON schema with property `version` as required and all other properties as optional. + +The localized data follow the same JSON schema with property `version` as required and all other properties as optional. The localized data overwrite data provided in the default meta data JSON. The localized data can provide only partial data. @@ -248,33 +266,32 @@ Before presenting metadata to users, application developers should verify whethe We remind implementation authors that the empty string for the token uri is a valid response. We also remind everyone that any smart contract can use the same metadata as other NFT contracts. It is out of the scope of this standard to define how a client may determine which smart contracts are is the original, well-known, canonical one. -# Out of Scope +## Graphical representation -Accessiblity of content is not covered by the standard. +The metadata of a token contain several properties that can be used to visually represent the token. It is recommended to use the first defined property of the following list: -Properties other than resolvability of the token uri are out of scope. This implies that metadata might change over time (stability). +1. `image` +2. `properties.image_data` +3. `image_data` -# Related Work +Rich representation should use ther first defined property of the following list: -NFTs are an established asset class on blockchains. Read for example [here](https://www.ledger.com/academy/what-are-nft). - -## BNS +1. `properties.animation_url` +2. `animation_url` -The Blockchain Naming System uses native non-fungible tokens. It does define metadata for a name through attachements. The schema for names owned by a person follows the definition of (schema.org/Person)[https://schema.org/Person]. This could be an alternative to token URIs. - -## EIP 721 and 1155 +# Out of Scope -Metadata for NFTs on Ethereum are defined in [EIP 721](https://eips.ethereum.org/EIPS/eip-721) and [EIP 1155](https://eips.ethereum.org/EIPS/eip-1155). The JSON schema for SIP-X has adopted the EIP 1155 schema with the following differences: +Accessiblity of content is not covered by the standard. -- substitution of `{id}` strings must use the decimal format not the hexdecimal, zero-padded format. +Properties other than resolvability of the token uri are out of scope. This implies that metadata might change over time (stability). -- properties of type object should use property `value` for the value, not property `description` as used by some EIP-1155 NFTs. +# Metadata functions -# Backwards Compatibility +Some contracts have dedicated functions to provide metadata directly from the contract. This SIP does not define these functions. -## Metadata functions +## Existing Examples -Some contracts have dedicated functions to provide metadata. +Some early deployed contracts have metadata functions. ### Boom @@ -294,48 +311,75 @@ The function signatures for metadata are: - `(get-badge-meta () {uri: (string-ascii 78111)})` and - `(get-meta? (uint) (optional {user: principal}))` +# Backwards Compatibility + +This SIP defines meta data so that metadata for existing NFTs on other blockchains like Ethereum, Solana or WAX can be re-used for NFTs on the Stacks blockchain. + +# Related Work + +NFTs are an established asset class on blockchains. Read for example [here](https://www.ledger.com/academy/what-are-nft). + +## BNS + +The Blockchain Naming System uses native non-fungible tokens. It does define metadata for a name through attachements. The schema for names owned by a person follows the definition of (schema.org/Person)[https://schema.org/Person]. This could be an alternative to token URIs. + +## EIP 721 and 1155 + +Metadata for NFTs on Ethereum are defined in [EIP 721](https://eips.ethereum.org/EIPS/eip-721) and [EIP 1155](https://eips.ethereum.org/EIPS/eip-1155). The JSON schema for SIP-X has adopted the EIP 1155 schema with the following differences: + +- substitution of `{id}` strings must use the decimal format not the hexdecimal, zero-padded format. + +- properties of type object should use property `value` for the value, not property `description` as used by some EIP-1155 NFTs. + +## Metaplex + +The tool suite Metaplex for NFTs on Solana defines a [JSON schema](https://docs.metaplex.com/nft-standard#uri-json-schema). The properties `category` and `files` in Appendic C were inspired by that schema. + # Activation -This SIP is activated if 5 contracts are deployed that follows this specification. This must happen before Bitcoin tip #750,000. +This SIP is activated if 10 contracts are deployed that follows this specification. This must happen before Bitcoin tip #750,000. # Appendix A List of trait function define in SIPs and specifications specific to these functions - -| SIP and Trait Function Name | Definition of "existing"| Additional Specification for Properties| Identifier Parameter| -|-----------------------------|-------------------------|--------------------|-----| -| SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | NFTs belonging to a group of tokens should use property `properties.collection` of type `string` for the collection name.
Optional property `properties.id` of type `integer` describes the identifier of the token. | 1st | -| SIP-X get-contract-uri | always | `properties.items` of type array can be used to provide the metadata of all tokens belonging to the collection | X | -| SIP-010 ft-trait.get-token-uri | always| The required property `decimals` of type `integer` must be the same number as `get-decimals`. | X | -| SIP-013 sip013-semi-fungible-token-trait.get-token-uri | token must be minted and not burnt, no requirements on the number of fungible part of the token| | 1st | - +| SIP and Trait Function Name | Definition of "existing" | Additional Specification for Properties | Identifier Parameter | +| ------------------------------------------------------ | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | +| SIP-009 nft-trait.get-token-uri | token must be minted and not burnt | NFTs belonging to a group of tokens should use property `properties.collection` of type `string` for the collection name.
Optional property `properties.id` of type `integer` describes the identifier of the token. | 1st | +| SIP-X get-contract-uri | always | `properties.items` of type array can be used to provide the metadata of all tokens belonging to the collection | X | +| SIP-010 ft-trait.get-token-uri | always | The required property `decimals` of type `integer` must be the same number as `get-decimals`. | X | +| SIP-013 sip013-semi-fungible-token-trait.get-token-uri | token must be minted and not burnt, no requirements on the number of fungible part of the token | | 1st | # Appendix B Attribute types -| Type | Display types | Additional Properties | Comment | -|------|---------------|-----------------------|---------| -| Numeric | `number`, `boost_percentage`, `boost_number` | `max_value`| | -| Date | `date` | | As unix timestamp in UTC | -| String | empty | | | +| Type | Display types | Additional Properties | Comment | +| ------- | -------------------------------------------- | --------------------- | ------------------------ | +| Numeric | `number`, `boost_percentage`, `boost_number` | `max_value` | | +| Date | `date` | | As unix timestamp in UTC | +| String | empty | | | # Appendic C Common Properties with predefined types. -| Name | Type | Description | -|------|------|-------------| -| `collection` | `string` | collection name the token belongs to. See also Appendix A. | -| `decimals` | `integer` | number of decimals. See also Appendix A. | -| `id` | `integer` | identifier for NFTs. See also Appendix A. | -| `created` | `integer` | creation date of the token in unix timestamp | -| `symbol` | `string` | token symbol | -| `total_supply`| `integer` | number of total supply, e.g. minted tokens | -| `ip_document_uri` | `string` | link to document about intellectual property (IP) rights | -| `external_url` | `string` | url that will view the token on an external site | -| `raw_media_file_uri` | `string` | uri of the media represented by the token | -| `raw_media_file_type` | `string` | mime-type of the media represented by the token | -| `raw_media_file_signature` | `string` | signature of the media file represented by the token | -| `raw_media_file_signature_type` | `string` | signature type of the media represented by the token, e.g. SHA-256 | +| Name | Type | Description | +| ------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `collection` | `string` | collection name the token belongs to. See also Appendix A. | +| `decimals` | `integer` | number of decimals. See also Appendix A. | +| `id` | `integer` | identifier for NFTs. See also Appendix A. | +| `created` | `integer` | creation date of the token in unix timestamp | +| `symbol` | `string` | token symbol | +| `total_supply` | `integer` | number of total supply, e.g. minted tokens | +| `ip_document_uri` | `string` | link to document about intellectual property (IP) rights | +| `external_url` | `string` | url that will view the token on an external site | +| `raw_media_file_uri` | `string` | uri of the media represented by the token | +| `raw_media_file_type` | `string` | mime-type of the media represented by the token | +| `raw_media_file_signature` | `string` | signature of the media file represented by the token | +| `raw_media_file_signature_type` | `string` | signature type of the media represented by the token, e.g. SHA-256 | +| `animation_url` | `string` | url to a multi-media attachment for the item. Application might use this to display the token in a richer way than the image of the `image` property. Application might support media types like GLTF, GLB, WEBM, MP4, M4V, OGV, and OGG, MP3, WAV, and OGA as well as HTML. The query `?ext={file_extension}` can be used to provide information on the file type. | +| `image_data` | `string` | raw SVG image data. | +| `category` | `string` | category of the associated media file, e.g. `image`, `video`, `audio`, `vr`, `html`. | +| `files` | `array` | list of all associated files, represented as `{uri: string, type: string, signature: string, signature_type: string}`. | +| `creators` | `array` | list of creators and their shares, represented as `{address: string, share: number}`. | From fff7f9a14da0839dcc70e2b5f813797f7fb2e228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Fri, 19 Nov 2021 15:37:29 +0100 Subject: [PATCH 15/31] add more related work --- sips/sip-x/sip-x-nft-metadata.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index e6fa9dd04..0b0dc1107 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -335,6 +335,10 @@ Metadata for NFTs on Ethereum are defined in [EIP 721](https://eips.ethereum.org The tool suite Metaplex for NFTs on Solana defines a [JSON schema](https://docs.metaplex.com/nft-standard#uri-json-schema). The properties `category` and `files` in Appendic C were inspired by that schema. +## Hedera + +Hedera follows the same schema defined in [H-10](https://github.com/hashgraph/hedera-improvement-proposal/blob/master/HIP/hip-10.md). + # Activation This SIP is activated if 10 contracts are deployed that follows this specification. This must happen before Bitcoin tip #750,000. From 2bc81e987b43de79a4c91c16272947849e0d142c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Fri, 19 Nov 2021 22:27:51 +0100 Subject: [PATCH 16/31] fix typo --- sips/sip-x/sip-x-nft-metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index 0b0dc1107..a52f17949 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -170,7 +170,7 @@ de.json ``` { "version": 1, - "attritbutes: [ + "attributes: [ { "trait_type": "Haare", "value": "rot", From b7abadad09e6af995e0f85a9cb183792901baeab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Mon, 22 Nov 2021 17:54:44 +0100 Subject: [PATCH 17/31] add seed, remove collection_size --- sips/sip-x/sip-x-nft-metadata.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index a52f17949..d1c48c216 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -155,7 +155,7 @@ token101.json ], "properties": { "collection": "Foo Collection", - "collection_size": "10000" + "total_supply": "10000" }, "localization": { "uri": "ipfs://somerandomcid/{locale}.json", @@ -386,4 +386,5 @@ Common Properties with predefined types. | `image_data` | `string` | raw SVG image data. | | `category` | `string` | category of the associated media file, e.g. `image`, `video`, `audio`, `vr`, `html`. | | `files` | `array` | list of all associated files, represented as `{uri: string, type: string, signature: string, signature_type: string}`. | -| `creators` | `array` | list of creators and their shares, represented as `{address: string, share: number}`. | +| `creators` | `array` | list of creators and their shares, represented as `{address: string, share: integer}`. Shares are represented as percentage. The sum of shares of all creators must add up to 100. Shares can be used to define royalties. | +| `seed` | `string` | hex string represented the DNA of the NFT. The seed is usually stored on-chain, it might be contained in the metadata for convenience. | From 9194130ff36959ceeb641a25c5a9ab6047993a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Thu, 2 Dec 2021 09:31:08 +0100 Subject: [PATCH 18/31] Update sip-x-nft-metadata.md --- sips/sip-x/sip-x-nft-metadata.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-x/sip-x-nft-metadata.md index d1c48c216..06dbc1b10 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-x/sip-x-nft-metadata.md @@ -4,13 +4,13 @@ SIP Number: X Title: Schema Definition for Metadata for Non-Fungible Tokens -Author: Friedger Müffke (mail@friedger.de) +Author: Friedger Müffke (mail@friedger.de), Dan Trevino Consideration: Technical Type: Standard -Status: Draft +Status: Accepted Created: 7 November 2021 @@ -18,9 +18,11 @@ License: CC0-1.0 Sign-off: +Layer: Traits + # Abstract -Non-fungible tokens or NFTs for short are digital assets registered on blockchain with unique identifiers and properties that distinguish them from each other. SIP-009 defines the trait for how ownership of an NFT is managed. This SIP aims to provide a flexible standard to attach metadata to NFTs, like descriptions or urls to digital files. +Non-fungible tokens - NFTs for short - are digital assets registered on blockchain with unique identifiers and properties that distinguish them from each other. SIP-009 defines the trait for how ownership of an NFT is managed. Fungible tokens - FTs for short - are digital assets where each token can be replaced by another token (see SIP-010). Semi-fungible tokens are digital assets where each token has a unique identifier and is dividable into fungible parts (see SIP-013). This SIP aims to provide a flexible standard to attach metadata to NFTs, like descriptions or urls to digital files. The same standard is applicable to fungible tokens. # License and Copyright From 96662efa5334b3af571731cdb07c0add9120473f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Mon, 6 Dec 2021 10:55:59 +0100 Subject: [PATCH 19/31] set sip number to 16 --- .../sip-016-token-metadata.md} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename sips/{sip-x/sip-x-nft-metadata.md => sip-16/sip-016-token-metadata.md} (99%) diff --git a/sips/sip-x/sip-x-nft-metadata.md b/sips/sip-16/sip-016-token-metadata.md similarity index 99% rename from sips/sip-x/sip-x-nft-metadata.md rename to sips/sip-16/sip-016-token-metadata.md index 06dbc1b10..d4d834e76 100644 --- a/sips/sip-x/sip-x-nft-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -1,10 +1,10 @@ # Preamble -SIP Number: X +SIP Number: 016 -Title: Schema Definition for Metadata for Non-Fungible Tokens +Title: Schema Definition for Metadata for Digital Assets -Author: Friedger Müffke (mail@friedger.de), Dan Trevino +Author: Friedger Müffke (mail@friedger.de) Consideration: Technical From 37116cdad76bcf5177442a53161be154332a7ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Sun, 12 Dec 2021 10:26:59 +0100 Subject: [PATCH 20/31] Update sip-016-token-metadata.md --- sips/sip-16/sip-016-token-metadata.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index d4d834e76..2aa919892 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -373,6 +373,7 @@ Common Properties with predefined types. | Name | Type | Description | | ------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `collection` | `string` | collection name the token belongs to. See also Appendix A. | +| `collection_image` | `string` | url to an image representing the collection. | | `decimals` | `integer` | number of decimals. See also Appendix A. | | `id` | `integer` | identifier for NFTs. See also Appendix A. | | `created` | `integer` | creation date of the token in unix timestamp | @@ -389,4 +390,5 @@ Common Properties with predefined types. | `category` | `string` | category of the associated media file, e.g. `image`, `video`, `audio`, `vr`, `html`. | | `files` | `array` | list of all associated files, represented as `{uri: string, type: string, signature: string, signature_type: string}`. | | `creators` | `array` | list of creators and their shares, represented as `{address: string, share: integer}`. Shares are represented as percentage. The sum of shares of all creators must add up to 100. Shares can be used to define royalties. | +| `artist_name` | `string` | name of the artist, mainly used as attribution. | | `seed` | `string` | hex string represented the DNA of the NFT. The seed is usually stored on-chain, it might be contained in the metadata for convenience. | From a6e086a3d83804740729c706f21272ccd606bbe9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Tue, 11 Jan 2022 09:13:46 +0100 Subject: [PATCH 21/31] add dant as author, fix formatting --- sips/sip-16/sip-016-token-metadata.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index 2aa919892..4e0450896 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -4,7 +4,7 @@ SIP Number: 016 Title: Schema Definition for Metadata for Digital Assets -Author: Friedger Müffke (mail@friedger.de) +Author: Friedger Müffke (mail@friedger.de), Dan Trevino (dantrevino@gmail.com) Consideration: Technical @@ -390,5 +390,5 @@ Common Properties with predefined types. | `category` | `string` | category of the associated media file, e.g. `image`, `video`, `audio`, `vr`, `html`. | | `files` | `array` | list of all associated files, represented as `{uri: string, type: string, signature: string, signature_type: string}`. | | `creators` | `array` | list of creators and their shares, represented as `{address: string, share: integer}`. Shares are represented as percentage. The sum of shares of all creators must add up to 100. Shares can be used to define royalties. | -| `artist_name` | `string` | name of the artist, mainly used as attribution. | +| `artist_name` | `string` | name of the artist, mainly used as attribution. | | `seed` | `string` | hex string represented the DNA of the NFT. The seed is usually stored on-chain, it might be contained in the metadata for convenience. | From f3905f8810d76cb9ca418741b0a0a3b46d2c379b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Wed, 2 Feb 2022 11:11:15 +0100 Subject: [PATCH 22/31] fix typos, replace `version` with `sip` --- sips/sip-16/sip-016-token-metadata.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index 4e0450896..5d9a3058d 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -64,11 +64,11 @@ If metadata were retrieved by a function call containing a token identifier and "$schema": "http://json-schema.org/draft-07/schema#", "title": "Token Metadata", "type": "object", - "required": ["version", "name"], + "required": ["sip", "name"], "properties": { - "version": { + "sip": { "type": number, - "description": "Version of the JSON schema for metadata. For this SIP, the version number must be `1`." + "description": "SIP number that defines the JSON schema for metadata. For this SIP, the sip number must be `16`." }, "name": { "type": "string", @@ -141,7 +141,7 @@ token101.json ``` { - "version": 1, + "sip": 16, "name": "Foo #101", "image": "ipfs://somerandomecid", "attributes": [ @@ -171,7 +171,7 @@ de.json ``` { - "version": 1, + "sip": 16, "attributes: [ { "trait_type": "Haare", @@ -190,8 +190,8 @@ pt-BR.json ``` { - "version": 1, - "attritbutes: [ + "sip": 16, + "attributes: [ { "trait_type": "cabelos", "value": "vermelho", @@ -254,7 +254,7 @@ Appendix B describes type of attributes ## Localization -The localized data follow the same JSON schema with property `version` as required and all other properties as optional. +The localized data follow the same JSON schema with property `sip` as required and all other properties as optional. The localized data overwrite data provided in the default meta data JSON. The localized data can provide only partial data. @@ -266,7 +266,7 @@ A localized properties with partial data overwrites only the provided properties Before presenting metadata to users, application developers should verify whether the metadata is compliant with the application's guidelines. -We remind implementation authors that the empty string for the token uri is a valid response. We also remind everyone that any smart contract can use the same metadata as other NFT contracts. It is out of the scope of this standard to define how a client may determine which smart contracts are is the original, well-known, canonical one. +We remind implementation authors that the empty string for the token uri is a valid response. We also remind everyone that any smart contract can use the same metadata as other NFT contracts. It is out of the scope of this standard to define how a client may determine which smart contracts are the original, well-known, canonical ones. ## Graphical representation From c27bd72c4e7933d840b1c61d3885fdff99875418 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Mon, 7 Mar 2022 22:58:21 +0100 Subject: [PATCH 23/31] rewrap at col 80 --- sips/sip-16/sip-016-token-metadata.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index 4e0450896..e30772b44 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -22,7 +22,15 @@ Layer: Traits # Abstract -Non-fungible tokens - NFTs for short - are digital assets registered on blockchain with unique identifiers and properties that distinguish them from each other. SIP-009 defines the trait for how ownership of an NFT is managed. Fungible tokens - FTs for short - are digital assets where each token can be replaced by another token (see SIP-010). Semi-fungible tokens are digital assets where each token has a unique identifier and is dividable into fungible parts (see SIP-013). This SIP aims to provide a flexible standard to attach metadata to NFTs, like descriptions or urls to digital files. The same standard is applicable to fungible tokens. +Non-fungible tokens - NFTs for short - are digital assets registered on +blockchain with unique identifiers and properties that distinguish them from +each other. SIP-009 defines the trait for how ownership of an NFT is managed. +Fungible tokens - FTs for short - are digital assets where each token can be +replaced by another token (see SIP-010). Semi-fungible tokens are digital assets +where each token has a unique identifier and is dividable into fungible parts +(see SIP-013). This SIP aims to provide a flexible standard to attach metadata +to NFTs, like descriptions or urls to digital files. The same standard is +applicable to fungible tokens. # License and Copyright @@ -37,7 +45,7 @@ Some use cases of NFTs are name registration, digital art, certification, media # Specification -Every SIP-X compliant smart contract in Stacks blockchain must implement one or more functions that return a resolvable/retrievable uri referencing metadata. The metadata provide information e.g. for displaying a digital asset to users. This type of function is named "metadata uri functions". +Every SIP-X compliant smart contract in Stacks blockchain must implement one or more functions that return a resolvable/retrievable URI referencing metadata. The metadata provide information e.g. for displaying a digital asset to users. This type of function is named "metadata URI functions". Appendix A contains a list of trait functions that must meet the following requirements for the return value. The appendix can be extended without changing the ratification status of this SIP. @@ -49,13 +57,13 @@ For existing tokens, the inner value of the return value must be a string repres The schema of the resolvable URI is not specified and should be a well-known schema like `https`, `ar`, `ipfs`, `sia`. A `data` URI is also valid, however, the length is limited by this SIP. -If a metadata uri function expects a parameter of type `uint` that identifies a token and the resulting strings contains `{id}`, then the `{id}` part must be replaced by the identifier in decimal format given in the function call. +If a metadata URI function expects a parameter of type `uint` that identifies a token and the resulting strings contains `{id}`, then the `{id}` part must be replaced by the identifier in decimal format given in the function call. The resolved data of the URI must be a JSON blob. ## JSON scheme of Metadata -The JSON blob resolved through the uri must follow the following JSON schema. +The JSON blob resolved through the URI must follow the following JSON schema. If metadata were retrieved by a function call containing a token identifier and the string `{id}` exists in any JSON value, it MUST be replaced with the actual token id in decimal format, by all client software that follows this standard. @@ -266,7 +274,7 @@ A localized properties with partial data overwrites only the provided properties Before presenting metadata to users, application developers should verify whether the metadata is compliant with the application's guidelines. -We remind implementation authors that the empty string for the token uri is a valid response. We also remind everyone that any smart contract can use the same metadata as other NFT contracts. It is out of the scope of this standard to define how a client may determine which smart contracts are is the original, well-known, canonical one. +We remind implementation authors that the empty string for the token URI is a valid response. We also remind everyone that any smart contract can use the same metadata as other NFT contracts. It is out of the scope of this standard to define how a client may determine which smart contracts are is the original, well-known, canonical one. ## Graphical representation @@ -285,7 +293,7 @@ Rich representation should use ther first defined property of the following list Accessiblity of content is not covered by the standard. -Properties other than resolvability of the token uri are out of scope. This implies that metadata might change over time (stability). +Properties other than resolvability of the token URI are out of scope. This implies that metadata might change over time (stability). # Metadata functions From 9b243cd8a9628f90354860431ff12bc2ae7751ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Thu, 10 Mar 2022 13:31:16 +0100 Subject: [PATCH 24/31] clarify required properties of attributes --- sips/sip-16/sip-016-token-metadata.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index 74295beb2..a3d5c3aa2 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -119,7 +119,7 @@ token id in decimal format, by all client software that follows this standard. "description": "Additional attributes of the token that are \"observable\". See section below. Values may be strings, numbers, object or arrays." "items: { "type": "object", - "required": ["value"], + "required": ["trait_type", "value"], "properties": { "display_type": "string", "trait_type": "string", @@ -293,7 +293,8 @@ that could define the rarity of the NFT. An `attribute` consists of a `trait_type` defining the name of the trait, e.g. "hair". The `value` is the value of the trait, e.g. "red". The `display_type` is a field indicating how the trait value should be displayed, e.g. on a -marketplace. +marketplace. If `display_type` is omitted, then `string` is used as default +display type. Appendix B describes the possible types and display types of attributes. @@ -365,8 +366,10 @@ types than response types. The function signatures for metadata are: -- `(get-boom-meta () {uri: (string-ascii 35), name: (string-ascii 16), mime-type: (string-ascii 9)})` and -- `(get-meta? uint {series-id: uint, number: uint, name: (string-utf8 80), uri: (string-ascii 2048), mime-type: (string-ascii 129), hash: (buff 64)})` +- `(get-boom-meta () {uri: (string-ascii 35), name: (string-ascii 16), + mime-type: (string-ascii 9)})` and +- `(get-meta? uint {series-id: uint, number: uint, name: (string-utf8 80), uri: + (string-ascii 2048), mime-type: (string-ascii 129), hash: (buff 64)})` **Badges** From e36a46fac9c2203d02cf9e0e4eae431ccdc24d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Mon, 21 Mar 2022 13:37:45 +0100 Subject: [PATCH 25/31] fix translation --- sips/sip-16/sip-016-token-metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index a3d5c3aa2..e498b7ecb 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -232,7 +232,7 @@ pt-BR.json "value": "vermelho", }, { - "trait_type": "amido", + "trait_type": "força", "display_type": "number", "value": 99, }, From c10e9a32566e90a60e2fd1776b8970590b2e37ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Mon, 21 Mar 2022 13:37:57 +0100 Subject: [PATCH 26/31] add sign-off by Jude --- sips/sip-16/sip-016-token-metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index e498b7ecb..ead37f7be 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -16,7 +16,7 @@ Created: 7 November 2021 License: CC0-1.0 -Sign-off: +Sign-off: Jude Nelson (jude@stacks.org) Layer: Traits From 642c0ed6f5a890846d567ae403f79015337fdf34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Fri, 22 Apr 2022 15:03:55 +0200 Subject: [PATCH 27/31] Update sip-016-token-metadata.md --- sips/sip-16/sip-016-token-metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index ead37f7be..f40680e56 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -474,6 +474,6 @@ Common Properties with predefined types. | `raw_media_file_signature_type` | `string` | signature type of the media represented by the token, e.g. SHA-256 | | `raw_media_file_type` | `string` | MIME type of the media represented by the token | | `raw_media_file_uri` | `string` | uri of the media represented by the token | -| `seed` | `string` | hex string represented the DNA of the NFT. The seed is usually stored on-chain, it might be contained in the metadata for convenience. | +| `seed` | `string` | a string representing a unique string of the NFT, like a DNA. The seed is usually stored on-chain, it might be contained in the metadata for convenience. | | `symbol` | `string` | token symbol | | `total_supply` | `integer` | number of total supply, e.g. minted tokens | From 2c2214890a00a952c48a3010678e295cbd5a6d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Fri, 22 Apr 2022 15:07:29 +0200 Subject: [PATCH 28/31] Update sip-016-token-metadata.md --- sips/sip-16/sip-016-token-metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index f40680e56..b7401c537 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -474,6 +474,6 @@ Common Properties with predefined types. | `raw_media_file_signature_type` | `string` | signature type of the media represented by the token, e.g. SHA-256 | | `raw_media_file_type` | `string` | MIME type of the media represented by the token | | `raw_media_file_uri` | `string` | uri of the media represented by the token | -| `seed` | `string` | a string representing a unique string of the NFT, like a DNA. The seed is usually stored on-chain, it might be contained in the metadata for convenience. | +| `seed` | `string` | a string representing of the uniqueness of the NFT, like a DNA. The seed is usually stored on-chain, but it might be contained in this metadata for convenience. | | `symbol` | `string` | token symbol | | `total_supply` | `integer` | number of total supply, e.g. minted tokens | From 347ad573309e650e1aea6b3f14dbe11f688d56bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Fri, 22 Apr 2022 15:42:39 +0200 Subject: [PATCH 29/31] Update sip-016-token-metadata.md --- sips/sip-16/sip-016-token-metadata.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index b7401c537..94aec6c0a 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -116,14 +116,14 @@ token id in decimal format, by all client software that follows this standard. }, "attributes": { "type": "array", - "description": "Additional attributes of the token that are \"observable\". See section below. Values may be strings, numbers, object or arrays." - "items: { + "description": "Additional attributes of the token that are \"observable\". See section below. Values may be strings, numbers, object or arrays.", + "items": { "type": "object", "required": ["trait_type", "value"], "properties": { - "display_type": "string", - "trait_type": "string", - "value": {"oneOf": [{"type": "object"}, {"type": "string"}, {"type": "number"}, {"type": "integer"}, {"type": "boolean"} {"type: "array"}}, + "display_type": {"type": "string"}, + "trait_type": {"type": "string"}, + "value": {"anyOf": [{"type": "object"}, {"type": "string"}, {"type": "number"}, {"type": "integer"}, {"type": "boolean"}, {"type": "array"}]} } } }, @@ -160,7 +160,7 @@ token id in decimal format, by all client software that follows this standard. "animation_url": { "type": "string", "description": "URL to a multi-media attachment for the item. Deprecated. Use `properties.animation_url`." - }, + } } } ``` From 7941a3c815079aad7509aa89bd6be46ecc06925e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Thu, 9 Jun 2022 22:49:43 +0200 Subject: [PATCH 30/31] Change status to Activation-in-Progress --- sips/sip-16/sip-016-token-metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index 94aec6c0a..dbcf0b8bd 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -10,7 +10,7 @@ Consideration: Technical Type: Standard -Status: Accepted +Status: Activation-in-Progress Created: 7 November 2021 From 92b652622c5d974688ba7466e0dae47e97b8a40a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Friedger=20M=C3=BCffke?= Date: Fri, 26 Aug 2022 21:25:57 +0200 Subject: [PATCH 31/31] Move to Ratified --- sips/sip-16/sip-016-token-metadata.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sips/sip-16/sip-016-token-metadata.md b/sips/sip-16/sip-016-token-metadata.md index dbcf0b8bd..0c4d6cf7b 100644 --- a/sips/sip-16/sip-016-token-metadata.md +++ b/sips/sip-16/sip-016-token-metadata.md @@ -10,7 +10,7 @@ Consideration: Technical Type: Standard -Status: Activation-in-Progress +Status: Ratified Created: 7 November 2021