NFT Metadata Storage Best Practices: On-Chain vs Off-Chain vs IPFS
Where you store NFT metadata determines permanence, cost, and trust. A practical breakdown of on-chain, IPFS, Arweave, and centralized storage trade-offs.
Your NFT is only as permanent as its metadata. The image, the name, the attributes — all of it lives somewhere, and "somewhere" is a decision that determines whether your token has value in five years or returns a 404. Most projects do not think carefully about this until something breaks.
What NFT Metadata Is
Every ERC-721 and ERC-1155 token has a tokenURI — a URI that points to a JSON file following the metadata standard. That JSON file typically contains:
{
"name": "Token #1",
"description": "Description here",
"image": "https://... or ipfs://...",
"attributes": [...]
}
The smart contract stores the tokenURI. Everything it points to is external. If that external location disappears, your NFT still exists on-chain — but it has no image, no name, and no attributes. It becomes an empty record.
Option 1: Centralized Storage (HTTPS)
Storing metadata on a traditional web server or CDN is the fastest path from zero to launch. Your tokenURI returns something like https://api.yourproject.com/metadata/1.
Advantages:
- Trivial to update or fix errors before reveal
- Easy to implement dynamic metadata (evolving traits, game states)
- Fast load times for marketplaces
Disadvantages:
- Single point of failure — if your server goes down or your company closes, metadata disappears
- Trust assumption — the project controls the metadata and can change it at any time
- Marketplaces and users who care about permanence will flag this
Centralized storage is acceptable during pre-reveal, for dynamic NFTs where mutability is a feature, or in enterprise/B2B contexts where the counterparty understands the trade-offs. It is not acceptable as the final state for any collection where permanence is a selling point.
Option 2: IPFS
IPFS (InterPlanetary File System) is a content-addressed storage protocol. Files are identified by a hash of their content — the CID (Content Identifier). If the content changes, the CID changes. This means a URI like ipfs://QmXxx... is immutable by construction.
Advantages:
- Content addressing guarantees integrity — what you see is what was committed
- No single server controls the content
- Wide tooling support — Pinata, NFT.Storage, web3.storage, Cloudflare IPFS gateway
Disadvantages:
- Persistence is not automatic. Files are only available as long as at least one node is pinning them.
- If all pinning services stop hosting your CIDs, the content becomes unreachable
- Retrieval can be slow without a gateway, and gateways introduce centralization
Best practice for IPFS: Pin your metadata and images with at least two independent pinning services. Use the native ipfs:// URI in your contract (not a gateway URL), and maintain a gateway fallback for frontends that cannot resolve native IPFS URIs.
Option 3: Arweave
Arweave is a blockchain-based permanent storage network. You pay once to store data, and the protocol is designed to keep it available indefinitely through an endowment model.
Advantages:
- One-time payment for permanent storage
- Stronger permanence guarantees than IPFS pinning arrangements
- Increasingly well-supported by NFT tooling (Bundlr/Irys is a common upload layer)
Disadvantages:
- Higher upfront cost than IPFS pinning for large collections
- Less tooling breadth than IPFS, though the gap has narrowed
- The Arweave protocol itself is a trust assumption — it could change over time
Arweave is a defensible choice for projects where permanence is a genuine differentiator and the team wants to avoid ongoing pinning management.
Option 4: Fully On-Chain Metadata
Storing metadata entirely on-chain — encoded in the contract itself — is the gold standard for permanence. No external dependency. The token exists as long as Ethereum exists.
Advantages:
- No external storage risk whatsoever
- Composability — other contracts can read attributes directly
- Maximally trustless
Disadvantages:
- Expensive at scale. Storing image data on-chain is only practical for SVG-based generative art, not raster images.
- Complex to implement correctly
- Large contracts can approach Ethereum's contract size limit
On-chain metadata is common in generative art projects where traits are computed and rendered as SVG dynamically. It is not practical for photographic or high-resolution art collections.
Recommended Architecture for Most Projects
For a standard PFP or collectible collection:
- Pre-reveal: Use a centralized URI returning a placeholder JSON. Fast, cheap, easy to update.
- Post-reveal: Upload all metadata JSON files and images to IPFS, pinned with two services. Update
baseURIin your contract to the IPFS CID directory. - Lock the URI: Call a
lockMetadata()function (if you built one) to make the base URI permanently immutable. This is a strong signal to collectors. - Consider Arweave as a backup pin for images, especially for high-value or art-focused collections.
Metadata Checklist
- Images and JSON files both have stable, content-addressed URIs before reveal
tokenURIreturns a well-formed JSON following the ERC-721 metadata standard- Attributes use consistent naming and value types across the collection
- At least two independent pinning sources are active
- The contract has an optional
lockBaseURIfunction for post-reveal immutability - Frontends handle
ipfs://URIs gracefully via gateway fallback
Getting metadata storage right is unglamorous work that protects your project's long-term value. If you are building a collection and want the storage architecture designed correctly from the start, the Clixo team handles this as part of every NFT build.