NFT Formatting

Each NFT is uniquely identified by its TokenID and Edition.

The TokenID is a record

TokenId {
    data1: u128,
    data2: u128,
}

Edition is a scalar

The TokenId is purposely left very generic as to accommodate any 32 bytes to uniquely identify the item.

The TokenID when combined with the BaseURI forms the information necessary for Front End UIs (like the Leo Wallet) to find the off-chain data associated with the NFT.

struct BaseURI {
    data0: u128,
    data1: u128,
    data2: u128,
    data3: u128
}

Currently only https urls are supported by the wallet.

When you Initialize the collection, set the BaseURI to the root url path of your collection. For the Privacy Pride Testnet3 Collection it is: aleo-public.s3.us-west-2.amazonaws.com/testnet3/

When you Add NFT, add the relative path from your BaseURI as the url: privacy-pride/1.json This will enable the Front-End as well as the Leo Wallet to find the json associated with your NFT at https:// + BaseURI + TokenID

You can find the code used to encode the strings to u128s here

Although you are welcome to use whatever JSON structure you want for your own application, to work with the existing codebase and Leo Wallet. You should implement the following properties at a minimum:

{
  "name": string,
  "image": string,
  "attributes": [
    {
      "trait_type": string,
      "value": string
    }
  ],
  "mintNumber": 1,
  "collectionLink": string,
  "collectionName": string,
  "collectionDescription": string,
  "sourceLink": string
}

Last updated