Learn how Base URIs work and how to set up metadata for your NFT collection.
A Base URI is the root URL where your NFT metadata files are stored. When someone views your NFT, wallets and marketplaces fetch the metadata from this location to display the name, description, image, and attributes of each token.
# Example Base URI:
ipfs://QmYourIPFSHash/
# How it works:
Token #1 → ipfs://QmYourIPFSHash/1
Token #2 → ipfs://QmYourIPFSHash/2
Token #42 → ipfs://QmYourIPFSHash/42
Each token needs a JSON file with this structure
{
"name": "Epic Sword #1",
"description": "A legendary sword forged in dragon fire",
"image": "ipfs://QmImageHash/1.png",
"attributes": [
{
"trait_type": "Rarity",
"value": "Legendary"
},
{
"trait_type": "Damage",
"value": 150
},
{
"trait_type": "Element",
"value": "Fire"
}
]
}The image field should point to where your actual image is stored (usually IPFS).
How to organize your files before uploading
my-nft-collection/
├── metadata/
│ ├── 1 (no extension)
│ ├── 2
│ ├── 3
│ └── ...
└── images/
├── 1.png
├── 2.png
├── 3.png
└── ...Important: Metadata files should NOT have a .json extension. They should be named just 1, 2, etc.
Popular services to host your NFT metadata
ipfs://QmYourCID/No worries! You can create your NFT collection first and set the Base URI later. Many projects launch their collection and then reveal the metadata after minting is complete.
Leave Base URI empty for now
You can update it anytime through the contract owner functions after deploying your collection.