x + 2 = y
, and then you pass in x = 2
, then y = 4
. No matter how many times you run it, you will have the same answer if you keep passing in x = 2
. In the same way, IPFS creates CIDs for files that are reproducible. If you share a file of Pinnie.png
you will get the same CID every time. It is through this CID that content is fetched across the IPFS network, which each piece pointing to a blocks on different nodes, altogether building a cohesive piece of content.
The CID is determined by the content of the file or folder
ipfs://{CID}
or if you don’t have an IPFS node, you can use an IPFS Gateway like https://ipfs.io/ipfs/{CID}
. This simple concept of CIDs give them several super powers.
Verifiability
The CID’s uniqueness and dependence on the content it represents make the data inherently verifiable. Suppose a creator shares an image of a digital artwork on the IPFS network: if someone tries to replace the original image with a different one, the CID for the new image will be different. This guarantees that the content cannot be tampered with, reinforcing trust within the network.Portability and Addressability
CIDs also facilitate data portability. Because a CID represents the content itself rather than its location, you can move your data across various nodes within the IPFS network without losing access to it. This content-addressed system breaks away from the traditional location-based addressing used in systems like HTTP, leading to a more robust and reliable data sharing network.Ownership and Persistence
The CID’s capabilities don’t stop at verification and portability. They also empower users to take ownership of data they care about. By ‘pinning’ a CID to a pinning service or their own node, users can ensure the longevity of data, even if the original data owner stops hosting it. This is particularly valuable in the context of non-fungible tokens (NFTs). For instance, if you purchase an NFT, you can pin the CID of the token’s metadata and image to a pinning service or a node you control, securing its existence indefinitely. This practice truly underlines the principle of digital ownership.Community Preservation
In addition to ownership and persistence, communities can preserve digital content through the practice of pinning much like how traditional art is preserved in museums. CIDs provide an opportunity for groups to maintain access to valuable data, ensuring its longevity.V0 & V1
There are two different types of CIDs you might see while using IPFS. The first is V0, which looks something like this:QmVLwvmGehsrNEvhcCnnsw5RQNseohgEkFNN1848zNzdng
This was the first kind of IPFS CID that was used for several years, however over time a new version was developed called the V1. This version was more flexible and future proof, and looks something like this:
bafkreih5aznjvttude6c3wbvqeebb6rlx5wkbzyppv7garjiubll2ceym4
Both of these CIDs are the same content, a wonderful picture of Pinnie, however the cryptographic algorithm they were put through was different. Pinata has used the V0 for several years but now uses V1 for the previously mentioned reasons.