Back to Blog
Technical

The Content Addressing Revolution: How CIDs Are Transforming Data Integrity

Understanding content-addressed storage and why cryptographic hashing is the foundation of trustworthy research data infrastructure.

Suraj Kumar
December 8, 2025
15 min read

The Problem with Location-Based Addressing

For decades, we've identified data by where it lives: URLs, file paths, database IDs. This location-based addressing has a fundamental flaw-the address tells you nothing about the content.

Location-based (URL)Names a server and a pathContent can change silentlyBreaks when the host movesNo way to verify what you gotTrust the serverContent-based (CID)Names the bytes themselvesAny change produces a new CIDRetrievable from any nodeAnyone can verify the hashTrust the mathematics
Addressing a location versus addressing the content

How Content Identifiers (CIDs) Work

A CID is a self-describing, cryptographic hash of content. Let's break down its structure:

MultibasebVersionv1Multicodecdag-pb 0x70MultihashSHA-256 digest · 32 bytesbafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
Anatomy of a CIDv1

The Math Behind CIDs

typescript
import { CID } from 'multiformats/cid';
import { sha256 } from 'multiformats/hashes/sha2';
import * as dagPB from '@ipld/dag-pb';

async function createCID(data: Uint8Array): Promise<CID> {
  // 1. Hash the content
  const hash = await sha256.digest(data);
  
  // 2. Create CID with codec and hash
  const cid = CID.create(1, dagPB.code, hash);
  
  // 3. The CID is deterministic
  // Same content ALWAYS produces same CID
  return cid;
}

// Example
const data = new TextEncoder().encode("Hello, Research!");
const cid = await createCID(data);
console.log(cid.toString());
// Always: bafybeiff2hkdgjbhkmqfhb5nh5z5lz5nh5z5lz5nh5z5lz5nh5z5lz5nh5

Why Content Addressing Matters for Research

1. Immutable References

When you cite a dataset by its CID, you're citing exactly that data-not whatever happens to be at a URL today.

Cited by URL"Available at example.com/data.csv"Resolves to whatever is served today52% of URLs in papers breakwithin roughly ten yearsLink-rot risk: highCited by CID"Data: bafybeigdyrzt5sfp7…"Resolves to the reviewed bytesRetrievable from any nodeholding a copyLink-rot risk: none
Citing a URL versus citing a CID

2. Automatic Deduplication

Content addressing enables global deduplication:

Institution Agenome_data.fasta · 3.2 GBInstitution Bhuman_genome_v38.fasta · 3.2 GBSHA-256Identical bytes, identical digestOne CID, stored once3.2 GB saved
Identical bytes converge on a single CID

3. Tamper Evidence

Any modification to content changes its CID:

typescript
const original = "Temperature: 23.5°C";
const tampered = "Temperature: 25.5°C";  // Changed one digit

const cidOriginal = await createCID(original);
// bafybeiff2hkdgjbhkmqfhb5nh5z5lz5nh5z5lz5nh5z5lz5nh5z5lz5nh5

const cidTampered = await createCID(tampered);
// bafybeigxyz789abc123def456ghi789jkl012mno345pqr678stu901vwx
//          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
//          Completely different! Tampering is immediately detectable.

IPLD: The Data Model Behind CIDs

IPLD (InterPlanetary Linked Data) extends content addressing to structured data:

Root nodeCID bafybei…AMetadataCID …BDataCID …CSignatureCID …DChunk 1CID …EChunk 2CID …F
An IPLD DAG: every node is content-addressed

Practical Implementation

Uploading Research Data

typescript
import { EkayanaClient } from '@ekayana/sdk';

const client = new EkayanaClient({ apiKey: process.env.API_KEY });

// Upload returns a CID
const result = await client.content.upload({
  file: './experiment_results.csv',
  metadata: {
    title: 'Experiment Results 2025',
    authors: ['Dr. Smith', 'Dr. Jones'],
    methodology: 'Double-blind controlled trial'
  }
});

console.log('CID:', result.cid);
// bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi

// This CID is now a permanent, verifiable reference
// to EXACTLY this data with EXACTLY this metadata

Verifying Data Integrity

typescript
// Anyone can verify the data matches the CID
const isValid = await client.content.verify({
  cid: 'bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi',
  data: downloadedData
});

if (isValid) {
  console.log('Data integrity verified!');
} else {
  console.log('WARNING: Data has been modified!');
}

The Reproducibility Connection

Content addressing directly addresses the reproducibility crisis:

ProblemTraditionalContent-Addressed
"Data not available"52% of papers0% (CID is permanent)
"Data was modified"UndetectableImmediately detectable
"Wrong version used"CommonImpossible (CID = version)
"Can't verify integrity"Manual checksumsAutomatic verification

Conclusion

Content addressing isn't just a technical improvement-it's a paradigm shift in how we think about data identity. By making the content itself the identifier, we create a foundation for:

  • Trustworthy citations that can never break
  • Verifiable data that can't be silently modified
  • Efficient storage through automatic deduplication
  • Reproducible science built on immutable references

The CID is the atomic unit of trust in decentralized research infrastructure.

---

Further reading: IPFS CID Specification, IPLD Documentation, Multiformats

Ready to Get Started?

Explore our documentation to learn how to integrate Ekayana into your research workflow.