Skip to content

Content Identifiers (CIDs)

The unique fingerprint every IPFS file receives.

What is a CID?

A Content Identifier (CID) is a self-describing label that uniquely identifies a piece of data on IPFS. It's derived from the cryptographic hash of the file's content, combined with metadata about the hashing algorithm and encoding format used.

QmXk7VRz4qoG5Dg8sFL4bYWHpKe4F

CIDs that start with Qm use CIDv0 (base58-encoded SHA-256). Newer CIDv1 identifiers start with bafy and support multiple hash functions and encodings.

Key properties

  • Deterministic — The same file always produces the same CID. Upload the same image twice and you get the same identifier.
  • Unique — Even a one-byte change produces a completely different CID. This makes CIDs tamper-evident.
  • Self-verifying — Anyone who receives a file can recompute the hash and confirm it matches the CID they requested.
  • Immutable — A CID always points to the same content. You can't change what a CID resolves to.

CIDs in IPFS.NINJA

Every file you upload returns a CID in the API response. Use it to:

  • Access the file via gateway: ipfs.ninja/ipfs/<CID>
  • Retrieve file metadata: GET /file/<CID>
  • Reference content on-chain (NFTs, smart contracts)
  • Share with anyone — they can verify the content matches

CIDv0 vs CIDv1

PropertyCIDv0CIDv1
PrefixQm...bafy...
Hash functionSHA-256 onlyMultiple (SHA-256, Blake2b, etc.)
EncodingBase58Multibase (base32, base58, etc.)
Self-describingNoYes (includes codec + hash info)