What’s IPFS and how it can change the Internet

Omid Mogharian
NATIX
Published in
3 min readFeb 4, 2020

The InterPlanetary File System is a peer-to-peer protocol that seeks to connect devices to store and share files in a distributed manner. IPFS is designed to fix HTTP problems and moves the internet towards the permanent web. A web that contents are stored permanently and no single entity controls or owns all of the data.

Photo by David Menidrey on Unsplash

Due to the peer-to-peer design of IPFS, the user will receive the requested data faster since it’ll route to the closest user that has a copy of that data. Think of a network that any user can be both client and host. Bandwidth usage is much more efficient in such a network.

After uploading a file to IPFS, an immutable hash is returned which identifies the content of the file. The hash is cryptographically guaranteed to uniquely represent that content. At the other end, anyone can provide storage for IPFS. Data is replicated and chunked across storage providers. To achieve this, IPFS combines several great ideas from computer science in the past years.

To understand how things work, first, a fundamental compression is needed:

HTTP is IP addressed, IPFS is content addressed.

In another word, in IPFS network, the hash of the content acts as a pointer to the file, not the address of the file. So the same contents will have a similar hash.

A routing layer is placed over the network to find other nodes as well as stored data. DHTs (e.g. Chord, proposed at MIT) are the most common way to create such a routing mechanism. DHT is a dictionary-like interface to the data that is stored on distributed nodes across the network. When a node advertises a block available for download, IPFS stores a record in the DHT with its own Peer ID, so in effect buckets that are now in independent nodes in the network, can be found easily.

The main protocol for exchanging data between these nodes is Bitswamp, Inspired by the popular BitTorrent protocol. Once nodes found each other and got connected, Bitswamp is responsible for how the transfer of contents occurs. It gives out the best chance to download the large file faster by downloading buckets for different peers at the same time.

Source

IPFS uses MerkleDAG, inspired by the git protocol, to give a structure to the contents around the network. It simply connects a series of content with a logical Structure(e.g. files and folder) together in the form of a directed acyclic graph.

So far, all components were concerned about content-addressed data, which is immutable. It means changing an object leads to changing its hash/address, and in fact, makes it a different object. A naming layer (IPNS) not only gives content human-readable names but also handles the ability to have mutable pointers to them. IPNS is based on SFS where a name is simply the hash of a public key. Records are signed by the private key (Whoever owns the private key controls the name) and distributed via the routing system.

Where we are heading?

Filecoin incentivizes IPFS by a crypto coin. Similar to that other projects like SiaCoin, NOIA and Storj are trying to realize this movement. Early adaptors started to build an application on top of these solutions and at least in test phases as it’s claimed in the theory, use cases seem countless.

DISCLAIMER: This post just reflects the author’s personal opinion, not any other organization. This is not official advice. The author is not responsible for any decisions that readers choose to make.

--

--

Omid Mogharian
NATIX
Editor for

CTO & Co-Founder @NATIX - Software enthusiast, Passionate about life.