Back

Blog details

Why IPFS Used to Give You Different CIDs for the Same File

AIOZ Network
5 min readOctober 14, 2026
aioz-pin
AIOZ Pin cover titled "Same File, Different CID?" beside a green iridescent liquid shape and floating hexagon tiles

IPFS gave the same file different CIDs because a CID hashes the DAG a tool builds from the file, not the raw bytes, and tools built it differently. Since March 2026, tools that share an IPIP-0499 profile return the same CID for the same file.

TL;DR:

  • A 3 MiB test file, numbers.txt, gets three CIDs from three settings: 12 chunks under the legacy profile, 3 under the new one, and a third CID for CIDv1 with 256 KiB chunks.
  • unixfs-v1-2025 (CIDv1, 1 MiB chunks, 1,024 links, raw leaves) is the profile every conforming tool must support.
  • Old CIDs do not change, and Kubo still defaults to CIDv0, so apply the profile before you compare.

Updated Nov 30, 2026: added a test file with CIDs computed under both profiles, a mismatch checklist and Kubo's default; cut one unverifiable line.

The Problem: A CID Hashes Structure, Not Just Bytes

A SHA-256 checksum hashes a file's bytes. A CID hashes the root node of the file's Merkle DAG. Building that DAG takes choices: CID version, chunk size, raw or dag-pb leaves, links per node and, for directories, the HAMT threshold. Change one and the CID changes, even for a byte-for-byte identical file.

Take numbers.txt, the first 3,145,728 bytes (3 MiB) of seq 1000000, which you can rebuild yourself. With 256 KiB chunks, 3,145,728 / 262,144 = 12 leaves sit under one root. With 1 MiB chunks, 3,145,728 / 1,048,576 = 3 leaves do. The bytes match, the trees differ, and so do the root CIDs.

Before 2026, those choices were not standardized across IPFS implementations. Kubo, Helia and Singularity each shipped their own defaults. The comparison table in IPIP-0499 shows chunk sizes of 256 KiB and 1 MiB, and DAG widths of 174 and 1,024, all in common use.

IPIP-0499: Two Named Profiles Instead of Per-Tool Defaults

IPIP-0499, merged into the IPFS specifications in March 2026, replaces those per-tool defaults with two complete, named profiles.

  • unixfs-v1-2025: CIDv1, 1 MiB chunks, 1,024 links per node, raw leaves. Every implementation that follows the IPIP must support it.
  • unixfs-v0-2015: CIDv0, 256 KiB chunks, 174 links, dag-pb leaves, matching Kubo through version 0.39. Support is optional.

You can see both on numbers.txt in this run from Nov 30, 2026. It used ipfs-unixfs-importer 17.1.1, the importer behind Helia, since this machine has no IPFS binary. Its last two lines reproduce the hello world reference CIDs from the IPIP, which checks the settings.

$ seq 1000000 | head -c 3145728 > numbers.txt
$ sha256sum numbers.txt
c2177f5b43f8ba83aaaafe309c7e0c96fea2b305fcfe88d0b3ab4f5b6df47604  numbers.txt
$ node cids.mjs
unixfs-v0-2015  QmZATE7y7KN7osgtXv53VEUTB4cstndeKM7oUh2JQXA39a  13 blocks
unixfs-v1-2025  bafybeifacowhaaj5o34j7nzry2ln66c4izc2z5dlqfhfptxp7lzltmmm4e  4 blocks
CIDv1, 256 KiB  bafybeiel5c2twt364z4yenv3o2ccqm3f2zgismjxhuyvyrwrmeu3jiwjra  13 blocks
check: "hello world" v0 Qmf412jQZiuVUtdgnB36FXFX7xg5V6KEbSJ4dpQuhkLyfD  1 blocks
check: "hello world" v1 bafkreifzjut3te2nhyekklss27nh3k72ysco7y32koao5eei66wof36n5e  1 blocks

Each block count is leaves plus a root: 12 + 1 = 13, then 3 + 1 = 4. The third line keeps CIDv1 and raw leaves but uses 256 KiB chunks, the default for Kubo's ipfs add --cid-version=1 (Kubo was not run here). You get one file and three CIDs, and none of them is wrong.

The New Default Is Also Faster

unixfs-v1-2025 also makes large files shallower. A 1 TiB file becomes 1,048,576 leaves of 1 MiB under 1,024 parents and one root, which is 3 levels. With 256 KiB chunks and 174 links, it is 4,194,304 leaves in 4 levels, about 4.2 million nodes against 1.05 million. Fewer levels mean fewer round trips when you seek into a large video. They also mean fewer CIDs to announce to the Amino DHT when the file is provided.

Why This Matters for Verification at Scale

Deterministic CIDs make verification cheap. Without a shared profile, a mismatch could mean different content or only different settings, so you had to fetch both files and rebuild their DAGs to decide. With both sides on one profile, you compare two strings. That changes the CID recompute-and-compare check: when your CID and someone else's differ, ask first whether both used the same profile, then whether the content changed.

Common Mistakes When Comparing CIDs

  • Assuming Kubo now uses the new profile. Kubo's `Import.CidVersion` still defaults to 0 with 256 KiB chunks, so a plain ipfs add of numbers.txt gives the legacy CID. Run ipfs config profile apply unixfs-v1-2025 first if you want the bafy one.
  • Comparing a CIDv0 with a CIDv1 as text. A Qm string never equals a bafy string. Converting the CID version helps only when the DAG is the same, and the two profiles also differ in leaves and chunk size.
  • Matching the profile but not the import options. Wrapping a file in a directory, hidden files, empty directories and symlinks also change a root CID, so set them the same way on both sides.
  • Expecting a profile to cover every layout. Singularity's balanced-packed layout puts the last leaf at a different depth, so files over 1 GiB can still mismatch when every other setting is equal.

Keeping the CID You Computed When You Pin

The takeaway: a CID identifies content only together with the settings that built it, so record the profile next to every CID you publish.

If you need your exact CID on a pinning service, pin it by CID rather than uploading the file again, because a new upload is chunked with the service's own settings. On AIOZ Pin, the pinByHash endpoint takes your CID as hash_to_pin, and pinning existing content by CID covers when that fits. The CID must already be reachable on IPFS. This is the docs request with the numbers.txt CID filled in (not run here, no credentials on this machine).

curl --location --request POST 'https://api.aiozpin.network/api/pinning/pinByHash' \
--header 'pinning_api_key: KEY' \
--header 'pinning_secret_key: SECRET' \
--header 'Content-Type: application/json' \
--data-raw '{
    "hash_to_pin": "bafybeifacowhaaj5o34j7nzry2ln66c4izc2z5dlqfhfptxp7lzltmmm4e",
    "metadata": {
        "name": "numbers.txt"
    }
}'

Frequently Asked Questions

Why did the same file get different CIDs on different IPFS tools? Because a CID hashes the file's Merkle DAG, not its raw bytes, and tools built that DAG with different settings.

What is IPIP-0499? An IPFS specification change, merged in March 2026, that defines two named UnixFS profiles. Tools on the same profile produce identical CIDs for identical input.

Does this change CIDs I already have? No. Existing CIDs stay exactly as they are. The new profile only affects how new content gets chunked and hashed going forward.

Is the new default just about consistency, or is it faster too? Both. With 1 MiB chunks and 1,024 links in each node, a 1 TiB file needs 3 DAG levels instead of 4 and about 4x fewer nodes.

Which implementations support IPIP-0499 today? On the Go side: Kubo 0.40+, boxo 0.37+, go-ipfs-cmds 0.16+. On the JS side: helia/unixfs 7.0.3+ and ipfs-unixfs-importer 16.1.1+.

If two CIDs for what should be the same file don't match, what should I check first? Check whether both tools used the same UnixFS profile and import options, before you assume the content differs.

References

We only send updates when meaningful changes ship, and you can unsubscribe anytime

Related Content

blog thumbnail

ENS IPFS Contenthash: Point an .eth Name at a Website

An ENS IPFS contenthash points your .eth name at a site on IPFS. See the byte format, a real encoding, ipfs vs ipns records, gas used, and common mistakes.

7 min readDecember 04, 2026
blog thumbnail

ERC-721 Metadata JSON: Fields, Images and ipfs:// URIs

ERC-721 metadata JSON explained: the three fields EIP-721 defines, OpenSea attributes and animation_url, ipfs:// image links, and folder CIDs for collections.

8 min readDecember 02, 2026
blog thumbnail

Merkle DAG vs Merkle Tree: What IPFS Changes and Why

Merkle DAG vs Merkle tree explained: a tree gives each node one parent and short proofs, while the DAG IPFS uses shares blocks, carries data and links by CID.

8 min readNovember 30, 2026
blog thumbnail

What Is IPNI? How the IPFS Network Indexer Finds Providers

IPNI is the IPFS network indexer behind cid.contact. See how index providers publish signed advertisement chains and how one HTTP query finds providers.

8 min readNovember 27, 2026
blog thumbnail

On-Chain vs Off-Chain NFT Metadata: Where the Data Lives

On-chain vs off-chain NFT metadata: what the contract stores, what lives on IPFS or a web server, what each costs in gas, and how to check any token yourself.

6 min readNovember 25, 2026
blog thumbnail

What Is a Kademlia DHT? The Routing Algorithm Behind IPFS

A Kademlia DHT finds peers by XOR distance. See how k-buckets, k = 20 and iterative lookups let IPFS locate who holds a CID, and how to watch it on Kubo.

6 min readNovember 23, 2026