Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NFT metadata extension tag #343

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions CIP-0025/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ This is the registered `transaction_metadatum_label` value

The structure allows for multiple token mints, also with different policies, in a single transaction.

```
```json
{
"721": {
"<policy_id>": {
Expand All @@ -61,10 +61,11 @@ The structure allows for multiple token mints, also with different policies, in
<other_properties>
}],

<other properties>
<other properties> // overwritten by "ext" if defined
}
},
"version": <version_id>
"ext": <array>
}
}
```
Expand All @@ -84,17 +85,19 @@ The structure allows for multiple token mints, also with different policies, in

- The **`mediaType`** and **`files`** properties are optional.<br /> **`mediaType`** is however required inside **`files`**. The **`src`** property inside **`files`** is an URI pointing to a resource of this mime type. If the mime type is `image/*`, **`mediaType`** points to the same image, like the on in the **`image`** property, but in an higher resolution.

- The **`version`** property is also optional. If not specified the version is `1`. It will become mandatory in future versions if needed.
- The **`ext`** property is optional. It is used to extend known metadata properties.

- The **`version`** property is optional. If not specified the version is `1`. It will become mandatory in future versions if needed.

- This structure really just defines the basis. New properties and standards can be defined later on for varies uses cases. That's why there is an "other properties" tag.
- This structure really just defines the basis. New properties and standards can be defined later on for varies uses cases. That's why there is an "other properties" tag. Note "other properties" are always overwritten by properties defined by "ext".

- The retrieval of the metadata should be the same for all however.

Optional fields allow to save space in the blockchain. Consequently the minimal structure for a single token is:

#### Version 1

```
```json
{
"721": {
"<policy_id>": {
Expand All @@ -109,7 +112,7 @@ Optional fields allow to save space in the blockchain. Consequently the minimal

#### Version 2

```
```json
{
"721": {
"<policy_id>": {
Expand Down Expand Up @@ -139,7 +142,7 @@ Using the latest mint transaction with the label 721 as valid metadata for a tok

## Backward Compatibility

To keep NFT metadata compatible with changes coming up in the future, we use the **`version`** property.
To keep NFT metadata compatible with changes coming up in the future, we use the **`version`** and **`ext`** properties.
A future version will introduce [schema.org](https://schema.org).

## References
Expand Down
58 changes: 58 additions & 0 deletions NFT-EXT-PROPERTY/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
CIP: To be confirmed?
Title: 721 Metatdatum extension property
Authors: Jack ([9000] pool, https://forum.cardano.org/u/jack7e/, @ada9000_ twitter)
Comments-URI: https://github.com/cardano-foundation/CIPs/pull/249
Status: Draft
Type: Informational
Created: 2022-09-28
---

# Abstract

This standard proposes a method to define optional extensions the 721 metadatum standard. Allowing users to know what to expect in the metadata.

# Motivation

- Cardano NFT Metadata parsing is becoming complex due to optional metadata json tags.
- If Cardano NFT's want to develop we need to define what's inside the metadata to avoid conflicts with custom optional tags and tags defined in new CIPs.

# Specification

- The `ext` tag is added within the `"721"` metadatum tag
- The `ext` tag should be lowercase. When parsing nft metadata the developer will use a to lowercase function on all elements in the `ext` array

```json
{
"721":{
"ext": <array>
"<policy_id>":{
"<asset_name>": {
"name": <string>,
"image": <uri | array>
}
}
}
}
```

# Example usage

The theoretical cipX in this example defines a script tag that must be present. To implement this CIP in our 721 metadatum JSON we simply add CIPX to the `"ext"` array.

```json
{
"721":{
"ext": ["cipX"]
"<policy_id>":{
"script":"<script_policy_id>"
"<asset_name>": {
"name": <string>,
"image": <uri | array>
}
}
}
}
```

Where cipX defines some property for the **JSON**. In this particular example cipX is a fictional CIP that requires the nft to contain a `"script"` tag with a `"<script_policy_id>"`.