
IPFS works by splitting a file into blocks, hashing each block, and linking them into a Merkle DAG whose root hash becomes the file's CID. A DHT tells other nodes who holds those blocks, Bitswap moves them, and every block is checked against its hash on arrival.
TL;DR:
Updated Nov 30, 2026: carried one 10 MiB video through every step, added a common-mistakes section, moved links onto nouns, tightened the ending.
Here is the full path a file takes, from your disk to someone else's screen, with one 10 MiB video as the example throughout. Each step links to its own post in this series.

A Merkle DAG is a directed acyclic graph where each node is named by a hash of its contents. In IPFS, a parent node's contents include the CIDs of its children, so a parent's hash depends on its children's hashes and the root hash depends on everything below it.
That chain is what makes the structure useful. Change one byte in the video and one leaf block gets a new CID, which changes its parent's list of links, and so on up to the root, while every other leaf keeps its CID. Two identical blocks always get the same CID, so a DAG can point at one stored copy from many places. Git uses the same idea for commits; IPFS applies it to any file or folder, and the Mutable File System rebuilds that chain on each edit.
The data model underneath is IPLD, which defines the codecs and the link format that every DAG node uses.
Before a file becomes a DAG, IPFS splits it into blocks, and Kubo's default chunker cuts fixed-size blocks of 262,144 bytes, which is 256 KiB. A small file fits in one block, while the 10 MiB video (10,485,760 bytes) becomes 10,485,760 / 262,144 = 40 leaf blocks, plus one parent that links them: 41 blocks in all.
Blocks give you two things: transfers can run in parallel and resume where they stopped, because each block is fetched and checked on its own. Storage can also be shared, because identical blocks in different files have the same CID and only need to be stored once.
How the split points are chosen matters when files get edited. Fixed-size chunks shift after an insert, while content-defined chunking keeps more blocks stable. Very large folders get one more structure, a HAMT, explained in how IPFS shards large directories.
A CID is a self-describing name for one block. It packs a version, a codec that says how to read the block, and a multihash: the hash function, the digest length, and the digest. Version 1 CIDs are usually shown in base32, which is why they start with b.
You can compute a CID for a single raw block with the Python standard library. We ran this on our machine, and the multiformats JavaScript library (9.9.0) gives the same CID for the same bytes:
$ python3 -c 'import base64,hashlib; d=hashlib.sha256(b"hello from aioz pin\n").digest(); print("b"+base64.b32encode(bytes([1,0x55,0x12,0x20])+d).decode().lower().rstrip("="))'
bafkreiciuqus57wedvnzisfyydrze2ffnymhsgqafkwqx7kfh7cz72izbqThe bafkrei prefix comes from the fixed header bytes: version 1, the raw codec, and sha2-256. A file larger than one block gets a dag-pb root instead, which starts with bafybei as a version 1 CID. Kubo still defaults to version 0 CIDs, which start with Qm.
Once your blocks exist, other nodes need a way to find you, and IPFS uses a Kademlia DHT for this. Peers and content share one address space built from SHA-256 hashes. A node that holds a block publishes a provider record on the 20 peers closest to that block's position. A node looking for the block walks toward the same position and reads the records.
Provider records expire, so Kubo re-announces content every 22 hours by default, the cycle explained in why provider records get renewed.
Bitswap does the transfer: your node sends want-have for the video's root CID to peers it is already connected to. Peers with the block answer have, and your node asks them for it with want-block, then repeats the exchange for the 40 leaves the root lists. If no connected peer has a block, Bitswap asks the DHT for providers and tries again with them. How fast this finishes depends on connection setup, routing and block transfer together, as the IPFS retrieval speed breakdown shows.
Every block that arrives is hashed and compared with the CID you asked for, and a bad block is rejected, so you can download from strangers safely. The full retrieval sequence and the hash check each have a post of their own. In JavaScript, you can run this check with the Helia JavaScript implementation and its verified-fetch module.
The takeaway: a CID names content and proves it on arrival, but the content stays reachable only while some node keeps the blocks and announces them. What AIOZ Pin adds, without changing the protocol, is a node that keeps holding your blocks: pinned content becomes available on the public IPFS network, and our public and premium gateways serve it over HTTP.
Step 5 is the weak point. A recursive pin on the video's root CID keeps all 41 blocks, and once nothing pins them, they disappear when the last holder runs garbage collection. Filecoin is a separate protocol that adds paid, proven storage on top of content addressing.
A pin moves through three statuses: Pinning, Pinned, and Failed. You can start from a file you have, as in the documented upload below (not run here, no credentials on this machine), or pin a CID that is already on IPFS.
curl --location --request POST 'https://api.aiozpin.network/api/pinning/' \
--header 'pinning_api_key: KEY' \
--header 'pinning_secret_key: SECRET' \
--form 'file=@"/test.png"'The response includes the cid for your file. To pin your first file step by step, follow the AIOZ Pin quick start.
How does IPFS work in one sentence? IPFS splits a file into hashed blocks linked into a Merkle DAG named by a CID, then uses a DHT to find who holds those blocks and Bitswap to move them.
Is IPFS's data structure a B-tree? No. The core structure is a Merkle DAG. Very large directories use a HAMT, which is a hash-based trie, not a B-tree.
Why does IPFS split files into blocks? Blocks can be fetched from several peers in parallel and checked one by one, and identical blocks are stored only once.
What is the default IPFS block size? Kubo's default chunker uses fixed 256 KiB (262,144-byte) blocks. You can choose another chunker when you add a file.
Why does changing one byte change the whole CID? The changed block gets a new hash, so its parent's list of child CIDs changes, and that change carries up to the root.
Does AIOZ Pin change how IPFS works? No. AIOZ Pin uses standard IPFS and keeps your blocks pinned, so the network always has a provider for your CID.

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.

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

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.

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

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.

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.