What is IPFS?

What is IPFS

Can you imagine what your life would be without access to the Internet? No, right? Even though it hasn’t been around for long in comparison with other inventions, the Internet has earned its place in our society. We use it to communicate with friends living in other parts of the word, watch 3D movies, listen to songs, or do research for projects.

However, it seems that the winds of changes are blowing once again and one invention might fundamentally change the way we use the Net. While browsing you might have stumbled upon the upstart I’m talking about. Of course, what I have in mind is IPFS, which has huge ambitions.

Since most IPFS explanations are technical and complicated, today we’re going to talk what IPFS is in simple terms.

#1. What does IPFS stand for?

IPFS is short for the Interplanetary File System. At its core, the IPFS is a communication protocol, created by Juan Benet and Protocol Labs. It aims to create a peer-to-peer network, just like BitTorrent or cryptocurrencies like Bitcoin. You might think about it as the next step in decentralizing the Internet and a new way to distribute and share content across the globe.

I know that this explanation sounds vague. What’s more, you are probably wondering what’s wrong with the way we share information nowadays. So, before we go into details about IPFS and how it works, we have to talk a little communication protocols and why we need something like IPFS.

#1.1. What are communication protocols? 

In the beginning, when the first computers appeared it wasn’t possible to surf the Net. The reasons aren’t hard to guess. First, the Internet was probably just an idea, waiting for the right moment to grow. Second, it was impossible for computers to communicate with one another and without communication, we can’t share information.

Imagine going to a foreign country without knowing the language. You wouldn’t be able to talk with the other native citizens, and they wouldn’t be able to understand you. The same was valid for computers until the 1980s when communication protocols were created.

Without going into unnecessary details, what’s relevant here is the Internet Protocol Suite with its two main protocols – The Transmission Control Protocol and the Internet Protocol. You might know it better as the TCP/IP.

The TCP and the IP work together and establish the Internet’s rules. Without them, it will be impossible to send information or join computers into networks.

What’s also important is the structure of the interconnection between computers. Many models exist, but the relevant ones are:

The most of the Internet functions on the client-server model and uses the Hypertext Transfer Protocol for communication. Also known as HTTP. Type an address, and that’s what you usually see first in the address bar.

We can illustrate how the client-server model works with an example. You type the address of the page you want to visit and send a request to the server, which fulfills your request and the page loads. In simple words, the information you require is hosted on a server, and you need to initiate a session to get it.

#1.2. Why the client-server model is not attractive anymore? 

By now most of you are wondering what’s wrong with the client-server model. After all, the model has been working for quite some time. The word you’re searching for is centralization. The data is kept on large servers, usually, the property of some big company. So, it’s easy for someone, say the government, to block access to certain pages or sites.

That’s what we call censorship. It’s not a big problem for some countries but look at China. It has blocked access to Google! Can you imagine something like that happening in your country? It might seem like science fiction, but it could happen in the future.

Turkey, for example, also has blocked Wikipedia, so if you want to browse your favorite encyclopedia, you’d have to go through a VPN or move to another country. What’s more, servers keep your data and hackers and governments alike might use it against you.

As a matter of fact, people have been looking for alternatives for ages, mainly because HTTP works best for loading web pages, but when it comes to large files, it’s not so good. Think about the years before BitTorrent. It was a struggle to download something over 1 GB, for example, because you had to wait hours. Similar limitations led to the development of the cloud computing.

You start to get the idea, right? Keeping your eggs in one basket is not a good idea, as people say. We continue to use the client-server model to browse the Net simply because there is no better alternative, which can deliver the same speed or quality.

Nevertheless, people are thinking how to make the Internet decentralized. Here is where IPFS comes into the picture in its efforts to replace HTTP.

#2. How does IPFS work?

Now that we covered communication protocol, you understand that IPFS as a protocol establishes the rules how computers would communicate and transfer information. To build on top of that definition, we must say that the idea behind the IPFS is to make the Internet distributed by using a peer-to-peer method to store and distribute information.

I imagine that you know how BitTorrent works, right? You run an application, which allows you to connect to another people who have the information you want, and you download it from the rest of the swarm. However, you can’t download the file if there are no peers online who are running their computers.

Well, IPFS is something very similar, but on a larger scale. The developers aim to run the Internet on a peer-to-peer network so that the whole web will be one large BitTorrent swarm. How could something like that be possible?

Well, first IPFS is an open-source project, which is currently being developed by hundreds of specialists. It also incorporates innovation, like FileCoin, for example. More about it later on.

To understand how IPFS works, we have to explain how you access content on the Web. We already covered the communication protocols, which are the basis for accessing information. Let’s imagine that you are searching for photos of “funny animals,” and you want to download a picture you like on your computer.

What do you do in this situation? You click on the photo and select “Save,” right? It’s as simple as that. However, what you might not know is that your computer needs to know where to find the picture. In other words, it requires the IP address where the image is hosted and the domain name.

That’s called location-based addressing. The downside of location-based addressing is that when the server is down and inaccessible, the computer will not be able to download your photo. Instead, you’ll get an error message.

However, it’s likely that another person, who has searched for “funny animals” has already got a copy of the picture you want. The bad news is that you can’t connect with him and request the image file because what matters is where the picture is hosted, not who has it.

That’s why IPFS wants to switch from location to content-based addressing. In layman terms, you’ll tell the computer what you want, instead of where to find it. In this way, you’ll be able to access content even if the servers are unavailable.

#2.1. How does content-based addressing function? 

IPFS uses something called Merkle DAG, a combination of:

  • ​Merkle tree, whose function is to make sure that the blocks are correct, unaltered, and undamaged.
  • ​DAG is short for Directed Acyclic Graph – a way to represent sequences of information. An example of DAG would be a family tree.

In other words, Merkle DAG is a way to structure data, using hashes to reference objects and data blocks in a DAG structure.

Using the Merkle tree, each file receives a unique hash, something like a fingerprint, which is calculated using cryptographic hash functions. If you’re familiar with cryptocurrencies, you know that these hashes are easy to check but difficult to guess.

So, when you need a picture of funny animals, you ask the network, “Does anyone have the file with this hash?” If someone has it, he will provide it to you, and you’ll be able to download it. Simple, right?

The question here is, “How do I know that the file hasn’t been tampered with?” Well, since you’ve requested a file with a specific hash, you can check if the hash matches what you’ve received. Any tampering would result in a hash different than the one you’ve requested. A simple solution to virus or malware problems, don’t you think?

Another great feature of IPFS and content addressing would be deduplication. Let’s say that three people publish the same picture on IPFS. Only one file would be created, not three. Think about the benefits and how much space would be saved!

#2.2. How does IPFS store files?

To store a file on IPFS, you need to create an IPFS object, which consists of two parts:

  • ​Data
  • ​Links

Each IPFS object is small in size – it can store up to 256 Kb. I know what you’re thinking. That’s not even enough for a world file. Well, you’re right. That’s why larger files, for example, videos or songs will be split into many 256 kb IPFS objects. Afterward, a single empty object will be created with links to all the pieces of the file.

For example, if the object is divided into 16 parts, the IPFS object will contain no data and links to all these 16 parts. It’s just like a file system, if you think about it.

One interesting thing you should know is that once you publish an IPFS object, you can’t change it. Again I will make the comparison with cryptocurrencies. Just like the blockchain, the IPFS is immutable, so once something is published it can’t be edited. It might seem a big disadvantage when it comes to files, but there is a solution.

IPFS will support versioning of files. For example, if you publish a paper, which you might decide to edit in the future, you’ll create a “commit object.” When you want to change the file, you’ll publish the updated version of the IPFS network, which will create a new commit object, linking it to the previous one.

As you can see, you won’t edit the original file, but you’ll link any future updates to it so that the first document with all the edits is available on the network.

#2.3. What is IPFS drawback?

By now you’ve probably guessed what could be IPFS biggest drawback, but I’ll illustrate it with an example.

Just like BitTorrent, every node in the IPFS network keeps a copy of the files it has downloaded. However, what would happen if the nodes, which have the file you want, are offline? That’s right. You won’t be able to download it, just like a torrent with no seeders. You’ll have to wait for the nodes to come online again or find another way to get a copy of the files.

To avoid this potential issue, IPFS would have to:

  • ​Find a way to incentivize people to keep the content online
  • ​Distributed files in such a way that there are always copies available.

A possible and likely solution would be FileCoin. FileCoin is developed by the same people behind the IPFS project. It’s a storage marketplace build on top of IPFS.

Let’s say that you have free storage space on your hard drive. You can rent it to FileCoin, which will keep small, encrypted versions of other people’s files. In return, you’ll get money.

On the other hand, if you have a file that you want to be uploaded, you can pay a small fee to FileCoin to list your file on the exchange. Then the storage nodes (those with extra hard drive space) will make their bid. When the bidding is over, your file gets split into small, encrypted segments, which will be sent to the nodes for safe keeping.

You don’t have to worry about somebody combining all the pieces because only you have the private key, which will enable you to recall all the parts. What’s more, the whole process is designed in a way to get you the lowest possible price for storing the file.

What’s the difference between FileCoin and Google cloud storage, for example? Well, FileCoin relies heavily on blockchain technology and it’s completely decentralized, so it’s less likely to become the victim of hacker or government attack.

However, FileCoin is not the only one in the decentralized storage market. You might have heard about Storj or Sia, which are decentralized storage platform with fixed prices. So, it remains to be seen if FileCoin will rise to the challenge and find enough supporters.

#3. What are the possible applications of IPFS?

Do you remember what we said about Turkey and how it blocked Wikipedia? Well, IPFS’s team responded by uploading the Turkish version of Wikipedia on IPFS where everybody can access it even with the censorship in place.

Another application of IPFS is DTube, short for Decentralized Tube. It similar to YouTube, however, it’s not centralized so you can publish whatever videos you want. You can read more about DTube here.

But that’s not all. After all, IPFS is the Interplanetary File System, and as unbelievable it might sound, it may have an interplanetary application. If somewhere in the near future, we establish a base on Mars, for example, it will take at least eight minutes to load a single page because the signal needs at least four minutes to travel to Earth.

However, if we use IPFS, we can cash large parts of the Internet. In this way, when we want to load a page, it won’t have to travel all the way to Earth, but instead, it will come from a node on Mars. Of course, all this is in theory, and we’ll have to see if it will work in practice.

The Interplanetary File System is an ambitious project, which will bring on revolutionary changes to the way we use the Internet and make information more decentralized and easy to access. We will continue to observe how IPFS will develop and what innovations it will offer, so stay tune for more information.

What do you think about IPFS? Do you think that it has a bright future? Do you think it possible to replace HTTP? Share your opinion in the comments.

About the author

    WhaleSumo