WHITE PAPER
  • 🛢️Background
  • 🗃️Design Concepts and Design Principles
  • 📇Decentralized storage
    • For Verifiable Content
    • Content addressing
      • CID: globally unique regardless of location
      • WebMingle CIDs
  • 📼NFT storage example
    • Why choose WebMingle?
    • IPFS and WebMingle to the rescue
    • Storing and Minting NFTs in WebMingle
      • Upload your images, assets and metadata
      • Mint your NFT
      • Writing NFT smart contracts
  • 🌐Application Notes
    • WMI NFT Storage
    • WMI NFT Start
    • WMI NFT Share
  • 💾Token Economics
    • Introduction
    • Economic Model
  • 🎛️Participant
  • ⚙️Statement
Powered by GitBook
On this page
  1. Decentralized storage
  2. Content addressing

CID: globally unique regardless of location

However, due to content addressing, link failure may be a thing of the past. Content-addressing systems like WebMingle are like our key-value-based DNS, but with one notable difference: you no longer need to choose a key. Instead, the key is derived directly from the file content using an algorithm that always generates the same key for the same content.

Therefore, we no longer need to coordinate among multiple writers by splitting the keyspace into domains and locations on the filesystem. There is now a generic domain: the domain of all possible values. If multiple people add the same value, there will be no conflict in the keyspace. They each get the same key from this put method, with an added benefit: improved availability and performance for retrieval over the network. This makes our key position independent. There is another important consequence: each individual key is a unique signature of the data itself, ensuring the verifiability that the key matches the content and that the content has not been altered.

This type of key is called a content identifier (CID). Once you know the CID of a file on the WebMinglenetwork, you have everything you need to find the file on the network and return it to you. Here's a JavaScript example of a full storage and retrieval round-trip using WebMingle:

// get uploaded files from a form
const fileInput = document.querySelector('input[type="file"]')

// store files and obtain a CID
const rootCid = await client.put(fileInput.files)

// retrieve files using the CID
const res = await client.get(rootCid)
const files = await res.files()
for (const file of files) {
  console.log(`${file.cid} ${file.name} ${file.size}`)
}

PreviousContent addressingNextWebMingle CIDs

Last updated 1 year ago

📇
Page cover image