🎛️ Options for hosting metadata for tokens made with Croak

We provide you 2 options for hosting your metadata

  1. Hosted on croak : We will host the token metadata for you. To do this, you can provide the metadata in the Create Token Data API ↗️. We then provide APIs for you to Update Metadata ↗️. Example : Token metadata ↗️

👍

Updating Metadata

When can you update metadata - anytime after the token is created on Croak. You can use the Update Token Data API ↗️ to do that.

Allowing you to update metadata anytime enables use cases such as Evolving NFTs, Late reveals... which can help you make engaging experiences

  1. Self-hosted API Server: You are welcome to deploy your own metadata API server. When self hosting the metadata AI, you just need to ensure that while creating the token you submit a URL in the field below

This URL entered here should resolves to something that follows the JSON Schema attached below on https://www.jsonschemavalidator.net/. While the schema contains standard fields like name, description, attributes, your JSON may have as many fields as you want to attach even richer context to your token. Find the JSON Schema here ↗️. What each of the fields mean, you can look up from the image under Point 1

To get you started, here are sample API servers in both Python and NodeJS:

If you choose to go with this option, updating the metadata is your choice and on your end.

⚠️

Asset file hosting - Jpeg,Mp4...

From the APIs above you can see that we do not provide functioanlity to upload your asset files - Images, Videos... You will need to use a service or host it on your own and only provide the URLs of such assets in the the metadata.

Services that can host such files for you are S3, Firebase, ...

🔭 About Metadata

Each token created allows for for adding asset metadata which essentially is rich data for digital assets to easily display them in-app. Digital assets on a given smart contract are typically represented solely by a unique identifier (e.g., the token_id in ERC721), so metadata allows these assets to have additional properties, such as a name, description, and image/video and whatever set of fields desired. A few examples from the wild

The url essentially returns a JSON blob which looks something like this

{
  "name": "Magic Wand",
  "description": "A simple wand used to channel magic energies, it is favored by apprentice wizards and great warlocks alike.", 
  "external_url": "https://dota2.fandom.com/wiki/Magic_Wand", 
  "image": "https://static.wikia.nocookie.net/dota2_gamepedia/images/7/74/Magic_Wand_icon.png", 
  "attributes": [ 
    {
      "trait_type": "Cost", 
      "value": "450",
      "display_type": "number"
    }, 
    {
      "trait_type": "Sell Value", 
      "value": "225",
      "display_type": "number"
    }, 
    {
      "trait_type": "Strength Bonus", 
      "value": 3,
    }, 
    {
      "trait_type": "Agility Bonus", 
      "value": 3
    }, 
    {
      "trait_type": "Shareable", 
      "value": "No"
    }, 
    {
      "trait_type": "Disassemble", 
      "value": "No"
    },
     {
      "trait_type": "Usage Alert",
      "value": "No"
    }
  ]
}

We follow the "ERC721 Metadata JSON Schema" ↗️ which is the following 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."
        }
    }
}

You may add whatever extra fields you would like on top of the ones in the schema.

More on Token Metadata Attributes in the following Guide on Metadata Attributes ↗️

📌 Queries

For any support or guidance, join https://croak.discord.com or write to [email protected]