← Docs
Decentralized updated July 3, 2026

IPFS and content-addressed storage

Learn how IPFS uses content hashes to address files, ensuring location-independence and tamper-evidence.


IPFS (InterPlanetary File System) is a decentralized system that addresses content by its hash rather than by location. This means the same file will always have the same address, making it easy to verify and distribute.

What is IPFS?

The core idea of IPFS is to use content-addressed storage. Instead of traditional web addresses (URLs) which point to a specific server and path, IPFS uses hashes of the content itself as its addressing mechanism. This ensures that the same file will always have the same address, regardless of where it's hosted.

How Does IPFS Work?

  1. Content Hashing: When you upload a file to IPFS, it is hashed using a cryptographic algorithm (like SHA-256). The resulting hash is unique and serves as the content identifier (CID).

  2. Distributed Hash Table (DHT): Nodes in the network use a DHT to store and look up these hashes. Unlike traditional servers, IPFS nodes can find and share content directly with each other.

  3. Pinning: To ensure that content remains available, you need to "pin" it—keep it stored on your node. Otherwise, the content may be garbage collected if no one is holding onto it.

Key Features

  • Location Independence: The same file will always have the same address, making it easy to share and access.

  • Tamper Evidence: Since files are identified by their hash, any change in the content will result in a different hash. This makes it easy to detect tampering or corruption.

Challenges

  1. Mutability: Changing content means changing its address, which can break links. To handle this, IPFS has additional layers like IPNS (InterPlanetary Name System) and DNSLink that allow for mutable names pointing to the latest CID.

  2. Storage: IPFS is not a free permanent storage solution. Content lives only as long as it is pinned by at least one node. Pinning services or your own always-on node are necessary for reliable storage.

Use Cases

  • NFT Metadata and DApp Frontends: The crypto ecosystem often uses IPFS to store metadata and frontend assets.

  • Distributed Datasets/Models: Mirrors can help distribute large datasets or models more efficiently.

  • Censorship-Resistant Mirrors: IPFS can be used to create censorship-resistant mirrors of content, such as Wikipedia snapshots.

Homelab Angle

Running an IPFS node is straightforward. You can set up a Kubo node (the reference daemon) in just an afternoon using Docker. Here's how:

  1. Set Up the Node:

    • Install Docker.
    • Run Kubo in a Docker container: docker run --name ipfs --mount type=bind,src=<path_to_storage>,dst=/ipfs/ipfs-data --publish 4001:4001 --detach ipfs/go-ipfs:v0.5.0.
  2. Pin Your Own Files:

    • Use the IPFS command-line tool to pin your files: ipfs add <file_path>.
  3. Fetch Popular Content:

    • You can fetch popular content using the IPFS gateway: ipfs get Qm<hash>.

This setup will help you understand how content addressing works in practice, and you'll see that the concept is similar to other systems like Git or Docker layers, where verification by hash plays a crucial role.

Was this useful?

This doc is maintained by the humans who run BreadLab. Spotted an error? Tell us — we fix docs, not just typos.