Skip to content

Proof of concept to explain the usage of Content Identifiers (CIDs) from IPFS

License

Notifications You must be signed in to change notification settings

GAIA-X4PLC-AAD/poc-ipfs-content-identifier

Repository files navigation

POC: IPFS Content Identifier (CIDs)

Note: This POC shows how a CID is specified, constructed, how you can validate and deconstruct it again and lists resources. This helps to understand the concept and gives implementation hints. If you want to create CIDs for arbitrary files you can simply create a Pinata account or use IPFS Desktop to upload files.

Summary

What is a CID

When we exchange data with peers on the decentralized web, we depend on content addressing (as opposed to the location addressing of the centralized web) to securely locate and identify data.

A content identifier, or CID, is a self-describing content-addressed identifier. It doesn't indicate where content is stored, but it forms a kind of address based on the content itself.

The CID specification originated in IPFS.

Why CID

With decentralisation in mind, we depend on having an agreed upon standard of identifying data. Aside from identifying data, being able to validate the contents of said data is required. However not every piece of data or every implementer has the same use case and/or properties resulting in different requirements. Because of that it's important there is enough flexibility.

IPFS has solved the problem of being able to convey all the requirements of the identification of data creating the concept of a CID. The link below "Anatomy of a CID" describes in great detail how a CID is built.

Why this POC

This POC demonstrates how we can leverage the concept of a CID by building one and extracting information from one in our projects.

Run locally

Make sure you have node > 18 and npm installed. Possibly through nvm.

Install dependencies

npm install

Run

npm run start

When making changes to ./src/index.ts make sure to stop the server, restart and reload the page to view your changes. This POC does not have hot-reloading.

Resources

About

Proof of concept to explain the usage of Content Identifiers (CIDs) from IPFS

Topics

Resources

License

Stars

Watchers

Forks