πŸ–ΌοΈ NFT Metadata: IPFS, Images & JSON

Store NFT images and attributes using decentralized storage

πŸ“¦ NFT Metadata & Storage

NFT smart contracts only store the owner and token ID on-chain. The actual image, name, and properties live off-chain in JSON metadata files.

Why Not Store Everything On-Chain?

πŸ’Έ Cost

Storing 1KB costs ~640,000 gas (~$50). A 1MB image would cost $50,000+!

πŸ“ Size Limits

Ethereum blocks have gas limits. Large files simply cannot fit.

🐌 Speed

Reading large data from blockchain is slow and expensive.

πŸ—‚οΈ Interactive: Metadata Builder

Adjust the token ID to see how metadata is structured:

{
  "name": "Cool NFT #42",
  "description": "A unique digital collectible",
  "image": "ipfs://QmImage42",
  "attributes": [
    {
      "trait_type": "Background",
      "value": "Blue"
    },
    {
      "trait_type": "Rarity",
      "value": "Legendary"
    }
  ]
}
Smart Contract Stores:
  • βœ“Token ID: 42
  • βœ“Owner: 0x123...abc
  • βœ“Metadata URL
Metadata File Contains:
  • βœ“Name & Description
  • βœ“Image/Video URL
  • βœ“Traits/Attributes

☁️ Interactive: Storage Comparison

Compare different storage solutions for NFT metadata:

🌐

IPFS

Most NFT projects (CryptoPunks, Bored Apes)

Cost

Free

Permanence

Depends on pinning

Speed

Fast (distributed)

βœ… Pros:
  • +Decentralized
  • +Content-addressed
  • +Free to use
  • +Fast retrieval
❌ Cons:
  • -Needs pinning service
  • -Data can disappear if unpinned
  • -Relies on nodes

Example URL:

ipfs://QmXyz.../42.json
πŸ’‘

Industry Standard

Most NFT projects use IPFS + Pinning Service (like Pinata or NFT.Storage). This balances cost, decentralization, and reliability. High-value art collections use Arweave for guaranteed permanence.