Application
IPFS Content IDs
IPFS names every piece of content by a Content ID (CID) derived from its hash. The multihash format wraps the digest with its algorithm code and length, so the IPFS network is hash-agnostic (SHA-256 today, BLAKE3 tomorrow).
12 bytes. We treat the input as raw bytes ("raw" codec 0x55 in CIDv1).
How a CID is built
- Hash the content with SHA-256 (or any other supported hash).
- Build the multihash:
0x12(hash fn code) ‖0x20(digest length) ‖ digest. - CIDv0: base58btc-encode the multihash. Always 46 chars starting with
Qm. - CIDv1:
0x01(version) ‖ codec ‖ multihash, then multibase-encode (typically base32 lowercase, prefixb). Starts withbafkfor the raw codec.