IPFS : A Censorship-Resistant File Sharing System

With the rise of technology and its influence on our daily life, most of us have become dependent on third-party hosts to store our data. Like, we use google drive to store our files, GitHub to store our source code and, whichever application we are using, we are sharing our data with them. When we host our data in these platforms then, by default we give them the access to modify or use our data. Another major concern is that the government has the access to ban any third-party application and, with that all the data in it also gets inaccessible. So, Privacy and the threat of Censorship both are the major concern for us when choosing the best file-sharing system. In this scenario, IPFS comes to the rescue.

What is IPFS?

IPFS stands for Inter Planetary File System. It is a peer-to-peer, decentralized and distributed file-sharing system. Through IPFS dependency on third-party hosts can be eliminated as it is decentralized, ensuring secure storage of data, with no threat of censorship.

Working of IPFS :

Usually, we access content on the web through their location ( IP Address ) This is called Location based addressing. But, often they get inaccessible due to server issues.

To overcome this, IPFS uses Content-based addressing instead of Location-based addressing.

Content-based addressing means, to access data we just have to tell what data we need and not their entire address.

IPFS creates a unique cryptographic hash called Content Identifier (CID). Each time a user uploads a file in the IPFS network, a CID gets allotted to it, which is used to identify and access that particular file.

Since it's a P2P network, therefore when we want to access a certain file we ask for it in the network and, the nearest node which has that data provides it to the one in need.

To cross-verify, if the data received matches the data asked, users can check both the hashes of the data received and, the data requested.

Storage in IPFS :

Files are stored inside IPFS objects. Each object has a storage capacity of 256kb.

An IPFS object can also store links to other IPFS objects like the linked list data structure.

But, what if you want to store a file having a size greater than 256 kb?

In that case, that file will be divided into multiple objects each having an individual size of 256 kb. At last, To connect all the data pieces stored in different objects an empty object is created which links all of them.

IPFS stores the files in an immutable format, meaning they cannot be changed or modified. But, suppose your cat sat on your keyboard and some wrong data got registered and now you want to edit that file. Well, IPFS values your time and efforts, so you need not have to create that file system again as it is version controlled. Like Git, a new version is created with each commit and it gets linked to the previous one. This allows easy access to earlier versions and the possibility to revert changes.

Applications of IPFS:

  1. In the year 2017, The Turkish Government imposed censorship on the online encyclopedia Wikipedia. A few hacktivists, put a copy of it on IPFS. Since IPFS is distributed and has no centralized servers. The Turkish government were not able to block it.

  2. DTube (Decentralized Tube ) is an application similar to YouTube, but it is decentralized and hosted on IPFS. Anyone can post any type of content on it without the fear of getting banned due to its non-censorship policies.

Limitations of IPFS :

  1. One of the major limitations of IPFS is that any node can get offline at any time. And, hence all the content that was dependent on that node would become inaccessible. To solve this issue, we can either Incentivize nodes or, Proactively distribute files and make sure there is always a minimum number of nodes available to access.

  2. IPFS also lacks File privacy, since IPFS is designed for public content sharing, so anyone can use it for performing illegal activities.

Summary :

IPFS is a decentralized, peer-to-peer file-sharing system that allows secure storage of data without any dependency on third-party hosts. It uses content-based addressing through Content Identifiers (CID). While IPFS has some limitations, such as the unavailability of nodes, inefficient storage management, and lack of file privacy, it has a huge potential to revolutionize the entire file-sharing and storage system.

Resources :

  1. https://docs.ipfs.tech/

  2. https://courses.csail.mit.edu/6.857/2017/project/10.pdf