CIDs (Content Identifiers)
A CID is a self-describing content-addressed identifier used to address content in distributed systems like IPFS.
CID Versions
CIDv0
Legacy format, starts with Qm. Limited to DAG-PB codec:
QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6ucoCIDv1
Modern format with multicodec identifier. Supports multiple content types:
bafybeiemxf5abjwjbikoz4mc3a3dla6ual3jsgpdr4cjr3oz3evfyavhwqPinner CID Normalization
Pinner automatically normalizes all CIDs to v1 format. This ensures:
- Consistent identifier format across your content
- Better interoperability with modern IPFS tools and gateways
- Support for multiple content codecs (not just DAG-PB)
When you upload content, Pinner always returns the v1 CID format regardless of the input format.
How Pinner Uses CIDs
Pinner uses CIDs to uniquely identify your content. When you upload a file, Pinner returns the CID which can be used to:
- Retrieve your content from any IPFS gateway
- Share content with others
- Pin existing content by CID
Finding Your Content's CID
Basic Upload Pattern
import { Pinner } from "@lumeweb/pinner";
const pinner = new Pinner({ jwt: "YOUR_API_TOKEN" });
const file = new File(["Hello, Pinner!"], "hello.txt", { type: "text/plain" });
const result = await pinner.uploadAndWait(file);
console.log("CID:", result.cid);
console.log("Name:", result.name);
console.log("Size:", result.size, "bytes");