NFT metadata and assets live somewhere. On-chain (in the blockchain itself) is expensive and limited to small files. Off-chain (external storage) is cheaper but fragile: if the server goes down, the NFT points to a dead link.
IPFS (InterPlanetary File System) addresses this by replacing location-based addressing with content-based addressing: instead of asking "what's at this URL," IPFS asks "who has this content hash." The distinction matters. If the file exists anywhere on the network, a client can retrieve it. If no node is hosting it, it's gone.
How IPFS content addressing works
Every file gets a cryptographic hash, a unique fingerprint derived from the file's contents. The hash is deterministic: the same file always hashes to the same value. Change one byte, the hash changes completely.
When you add a file to IPFS, you get back a CID (Content Identifier, typically a 46-character hash like QmX...). To retrieve the file, you ask the IPFS network "who has the content for CID QmX?" Nodes respond with their addresses, and your client fetches from one of them.
This solves the NFT problem: you can store the asset (an image, JSON metadata) on IPFS and reference it by CID in the NFT contract. If the original uploader's node goes offline, the file persists on any other node that pinned a copy. No single point of failure for the asset.
The pinning problem: assets vanish if nobody keeps them
Here's the catch: IPFS is garbage-collected. A node stores content on disk. Over time, as new content is added, old content gets deleted to free space. Unless a node explicitly pins a file (marking it for permanent storage), it will eventually be purged.
This means that adding a file to IPFS doesn't guarantee permanence. If every node that downloaded it later deletes it, the file is gone. To prevent this, creators use pinning services (Pinata, Nft.storage, Web3.storage) that run dedicated IPFS nodes and contractually promise to keep files pinned.
The trade-offs:
- Self-pinning - you run your own IPFS node and pin your NFT assets. Cost: hardware, bandwidth, DevOps overhead. Control: total. Risk: you're responsible if your node fails.
- Third-party pinning - Pinata or Nft.storage pins the files for you. Cost: monthly or per-GB fees. Control: you're trusting a business that could shut down. Risk: the service could disappear, taking your pins with it.
Some projects hedge by pinning to multiple services. Others accept that old, forgotten NFTs will eventually become inaccessible (a feature of the intended immutability model). There is no "set and forget." Persistence requires commitment.
IPFS directories for metadata-asset linking
An NFT typically references two things: metadata (JSON describing the asset) and the asset itself (image, video, etc.). Both can live on IPFS, but they must be linked correctly.
IPFS directories allow you to group files and reference them by relative path. Instead of pinning QmHash-for-image and QmHash-for-metadata separately (and hardcoding both in the contract), you can pin a directory QmDir/ that contains /metadata.json and /image.png. Then the contract references only the directory hash, and the metadata JSON references image as ./image.png.
This is cleaner but adds complexity: the metadata must point to the correct relative path, and clients must resolve it. Some projects flatten this and just use absolute CIDs for both, accepting the redundancy.
Persistence guarantees don't exist
IPFS has no built-in lease or time-locked guarantee. You pin content, and it stays pinned until you explicitly unpin it or the service shuts down. There's no "keep this file for 100 years" mechanism. Arweave (an alternative) offers a different model: you pay a one-time fee, and the service commits to storing the data for 200+ years. That guarantee is enforced by economics and incentives, not by the protocol.
If you use IPFS, your pinning arrangement is only as durable as the entity doing the pinning. Pinning services go out of business. Nodes fail. Projects must account for this: either run your own infra, or maintain a list of backup pinning services and migrate if your primary provider fails.
Retrieval speed and latency
IPFS retrieves content based on proximity and peer health. If a node near you has pinned the file, retrieval is fast. If the nearest node is on another continent, retrieval is slow. For NFT metadata (JSON, typically small), this is acceptable. For large assets (high-res images, videos), latency can degrade the user experience.
CDNs (content delivery networks) solve this by caching IPFS content at multiple geographic locations. Services like Cloudflare have IPFS gateways that fetch from IPFS but serve from edge nodes, reducing latency. The trade-off: you're using centralized infrastructure to access decentralized storage, reintroducing the single point of failure you were trying to avoid.
Practical implementation: when to use IPFS for NFTs
IPFS is a good fit when:
- Assets are small (<10 MB). Latency and bandwidth are tolerable.
- You can commit to pinning via a service or dedicated node for as long as the NFT matters.
- You can tolerate eventual inconsistency (the file might be inaccessible for hours if the nearest pinned copy is offline).
IPFS is a poor fit when:
- You need guaranteed retrieval latency (trading cards, gaming assets where speed matters).
- You need contractual permanence guarantees beyond the pinning service's SLA.
- Assets are large and you can't pay for global CDN acceleration.
Many projects use a hybrid: metadata and small images on IPFS (via Nft.storage with free tier), large media on a CDN or centralized host. This trades decentralization for usability and cost.
You’d typically upload your NFT’s data to a decentralized platform and update its metadata to reference the new location.
Transaction speed depends on the network’s efficiency, but decentralized storage aims to maintain or improve current rates.
Some networks charge for storage space and access, while others might use a token-based system to offset costs.
The distributed nature means there’s no single point of failure, so network issues are less impactful than centralized storage.
Access depends on interoperability between the blockchain and the decentralized storage solution.

