What is IPFS — A Decentralized File System Protocol

·

3 min read

As the revolution of Web 3.0 is taking the Digital world by storm, there are so many potential projects that have yet to set their mark in the mass audience. People barely know about these projects or don’t fully understand them. One such project is — IPFS. In this article, I will try to break down the technical aspect of IPFS and how it works.

According to official Documentation — “IPFS which stands for Interplanetary File System is a distributed system for storing and accessing files, websites, applications, and data.”

Breakdown — A decentralized file-sharing protocol, i.e It does not rely on any big organization having humongous data stores to save the files you need to store for later access. Instead, it uses peer-to-peer communication in which several nodes share and spread data amongst each other by dividing the files into smaller chunks and hashing them. Each node inside this distributed system contains a cluster of these hashed files.

To summarize, IPFS is a p2p protocol, it’s not a storage service, you don’t “Upload” your files anywhere, you just make them available to the protocol which distributes the data into smaller chunks and makes it available to other nodes.

How does it work?
Traditionally, we mostly use HTTP-based communication which is a client-server communication model. It’s a location-based addressing system. The client requests a web page, the server finds the location of the file and serves with a response.

IPFS uses content addressing to identify content by what’s in it rather than by where it’s located. A cryptographic hash on a file is used to do this, which is used as the address. So, whenever a node wants to access a file or resource, the node will ask “Does anyone have this ?” After such a request is made, the concept of Distributed Hash Tables(DHT) comes into play.

A distributed hash table (DHT) is a distributed system designed to map values to keys.
Breakdown: When the receiving nodes get such a search request, they return the corresponding value if they have it in their bucket. If they can’t find the value they will return the connection information of the neighboring or peer nodes and forward the request. This way different peers on the network can find the content and other peers without involving any centralized coordination.

Another concept that plays a major role in this ecosystem is Merkle DAG. Technically, A Merkle DAG is a DAG where each node has an identifier, and this is the result of hashing the node’s contents any opaque payload carried by the node and the list of identifiers of its children using a cryptographic hash function like SHA256.
Breakdown: Files that are shared over IPFS are split into smaller chunks. Splitting it into chunks or blocks means that different parts of the file can come from different sources and be authenticated quickly, just like in BitTorrent, when you download a file you fetch it from multiple peers at once. Now each of these smaller chunks/blocks have their own CIDs (Content Identifiers) which is the cryptographic hash of the block.

IPFS uses Merkle DAGs to create a tree-like structure of hashes with a Root hash. This, in turn, helps in the verification of Data and removes the redundancy of data.

With this, concluding on how IPFS works under the hood. Coming up is How to use IPFS and Busting myths. Hope this was helpful, Don’t forget to Like, Comment and Follow for more on Web3.0 :)