NFT metadata

๐Ÿ‘

You should generate a URI before minting an NFT item.

It is recommended to generate URI for assets (images, videos, etc.) for the NFT item or metadata using IPFS, Pinata, or Data URI.

There are three concepts to define the assets that exist in NFT.

  • Asset: Asset to be NFTed
  • Metadata: Data that defines assets
  • URI: Identifier that identifies assets and metadata


Asset

Asset means the asset to be NFTed. Digital works such as pictures, videos, and music can be made into NFTs, regardless of the format.



Metadata

Metadata means data about data. Metadata for NFT is data in JSON format about the information about the asset to be made into a token or descriptions of NFTs.


ERC-721

Metadata is suggested to follow ERC-721 Metadata JSON Schema.

{
    "title": "Asset Metadata",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "Identifies the asset to which this NFT represents"
        },
        "description": {
            "type": "string",
            "description": "Describes the asset to which this NFT represents"
        },
        "image": {
            "type": "string",
            "description": "A URI pointing to a resource with mime type image/* representing the asset to which this NFT represents. Consider making any images at a width between 320 and 1080 pixels and aspect ratio between 1.91:1 and 4:5 inclusive."
        }
    }
}

ERC-1155

ERC-1155 is also based on ERC-721 Metadata JSON Schema.

{
    "title": "Token Metadata",
    "type": "object",
    "properties": {
        "name": {
            "type": "string",
            "description": "Identifies the asset to which this token represents"
        },
        "decimals": {
            "type": "integer",
            "description": "The number of decimal places that the token amount should display - e.g. 18, means to divide the token amount by 1000000000000000000 to get its user representation."
        },
        "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."
        },
        "properties": {
            "type": "object",
            "description": "Arbitrary properties. Values may be strings, numbers, object or arrays."
        }
    }
}

Opensea

To introduce the NFT on Opensea, the largest NFT marketplace, the following suggestions must be followed. If metadata in a different format is created, the thumbnail of the NFT may not be displayed on Opensea.

{
  "name": "Herbie Starbelly",
  "description": "Friendly OpenSea Creature that enjoys long swims in the ocean.",
  "image": "https://storage.googleapis.com/opensea-prod.appspot.com/creature/50.png",
  "attributes": [...]
}
PropertyDescription
nameNFT name
descriptionDescription of NFT
imageURI of the asset
attributesOther properties required to define the asset

Example

Here is an example from Octet.

{
  "name": "HEXLANT ISSUE REPORT VOL.15 - NFT:๋ฉ”ํƒ€๋ฒ„์Šค ์‹œ๋Œ€๋กœ ๊ฐ€๋Š” ์ฒซ๋ฒˆ์งธ ๋ฐœํŒ",
  "image": "ipfs://QmPrcWA6fp1UZpXcPWcAxYnzub2ryrNhnWyMbDyWPfGTww",
  "attributes": [
    {
      "trait_type": "Date",
      "value": "26 May 2021"
    },
    {
      "trait_type": "Issue",
      "value": "VOL.15"
    },
    {
      "trait_type": "Purpose",
      "value": "Market Insight"
    },
    {
      "trait_type": "report",
      "value": "ipfs://QmZyAJWSUfbyWrdGS6SX2TzqQw4qynVwYdfhnPdU6bYRNn"
    },
  ]
}


URI

Assets and metadata must have their integrity guaranteed. Therefore, IPFS is used in most cases, but Data URI can be used as well. In some cases, the storage path of NFTโ€™s assets and metadata stored in the servers such as Amazon S3 or Google Cloud can be used as URI. However, in this case, integrity and validity cannot be guaranteed, so this is not recommended.


Creating URI

When an asset or metadata is stored using IPFS, the path is ipfs://YOUR_CID.


๐Ÿšง

It is recommended to follow the ipfs:// format.

When a file is saved in IPFS using services such as Pinata, the saved fileโ€™s path should look like https://SOME_URL/ipfs/YOUR_CID. When that path is used for URI, it is impossible to manage in case the URL becomes unavailable in the future. Therefore, it is recommended to use URI, such as ipfs://YOUR_CID, to avoid that.


Using IPFS (example)

Most of the IPFS services issue a CID for the uploaded file. The CID is required to access the file in IPFS, so you must remember the CID.


NFT items are minted by the following process.

  1. Store the asset to be made to NFT.
  2. Define NFT metadata. For the assetโ€™s URI, enter the CID obtained in step 1 in the format of ipfs://CID.
  3. Save the NFT metadata defined in step 2 to IPFS.
  4. When minting an NFT, enter the CID obtained in step 3 in the format of ipfs://CID to the token URI.

1038

Screenshot of the example asset and metadata stored in IPFS