Questions regarding CNFT tags

Hi,

I wanted to make sure I’m adding the “tags” or attributes of each NFT correctly. To be specific, I want it to show the attributes like this in CNFT.io:

Where exactly in the metadata should I add it? I see two options of ‘other properties’:

{
      "721": {
        "<policy_id>": {
          "<asset_name>": {
            "name": <string>,
    
            "image": <uri | array>,
            "mediaType": "image/<mime_sub_type>",
    
            "description": <string | array>
    
            "files": [{
              "name": <string>,
              "mediaType": <mime_type>,
              "src": <uri | array>,
              <other_properties>
            }],
    
            <other properties>
          }
        }
        "version": "1.0"
      }
    }

Thanks in advanced!

Second position. You want additional properties of the whole asset, not of a single file belonging to it.

Thanks for the quick response! So it would be something like this, correct?

{
      "721": {
        "<policy_id>": {
          "<asset_name>": {
            "name": <string>,
    
            "image": <uri | array>,
            "mediaType": "image/<mime_sub_type>",
    
            "description": <string | array>
    
            "files": [{
              "name": <string>,
              "mediaType": <mime_type>,
              "src": <uri | array>,
            }],
            "EYES": "Pirate",
            "HAT": "Sprout"
          }
        }
        "version": "1.0"
      }
    }

Yes, looks correct to me. Remember to add a comma after the “description” string, when you enter it, and after the braces before “version”, and remove the comma after the last property (“src”) inside “files”. A lot of JSON parsers are rather strict regarding the commas. Perhaps, you want to use an editor that gives you syntax highlighting and marks such errors.

You can also look at existing NFTs. For example, the metadata for

can be found at its minting transaction:

This one is a bit special, because the contents are provided as “data:”-URIs, so that they are completely on the blockchain and the NFT does not depend on IPFS or websites being and staying available, but you can also see the additional properties you were asking for in the JSON object. They are placed before the “files” property, here. Order does not matter.

1 Like