How to create a token URI

Creating an NFT using the ERC721 standard means that the token created also needs a token URI

Things you’ll need. This list is not extensive and will depend on how much metadata you want your token to have

  1. The image file
  2. The image name
  3. The image description
  4. An IPFS path for the image e.g. ipfs://QmVDae8m3X6HZf9v2Jnyqe53Xpj64vEvQDUci1NpX1Krcs

The first thing you’ll need to do is upload the image to an IPFS node. You can create a pinata account to do this. Once the image is uploaded and pinned on Pinata you will get a CID that looks like this ‘QmVDae8m3X6HZf9v2Jnyqe53Xpj64vEvQDUci1NpX1Krcs’

Then create the json file that will contain the metadata. e.g. the metadata defined below only has three fields - name, description and image.

sample metadata
sample metadata

Upload the json file to a folder on an IPFS node as well, you will also have a CID for the file. Once this is done your token URI will be in the format https://ipfs.io/ipfs/folderCID/metadata.json . This URI can now be used to mint your token

Minted Token
Minted Token
Subscribe to KozukiOden
Receive the latest updates directly to your inbox.
Verification
This entry has been permanently stored onchain and signed by its creator.