'IPFS is only for static files'

IPFS 1 is a content-addressed, distributed filesystem 2 for sharing files in a free-for-all filesystem. It blurs the line between the web and the local filesystem, and makes applications be able to move from being a online website into a local application without changing any of the beheviour or functionality. Roaming and offline-first are two of the best things about IPFS.

IPFS is getting more and more popular. It is also getting more attention from the “common” developer who might not have paid attention to a P2P Filesystem before. Those people are suddenly starting to ask more questions about it, learn about it and help others understand it.

However, there are a few misconceptions to what IPFS can and cannot do. One of the most common ones that some people keep repeating 3, maybe because their “weapon” project is less sound than IPFS, or simply because they misunderstand IPFS, is that IPFS can only handle static files and is useless for everything else

“IPFS is only for static websites, you can’t have dynamic websites”

First, the name IPFS, meaning InterPlanetary FileSystem, sure sounds like it’s just a normal filesystem, but you can use it between planets. This is true but also not the full truth.

Instead, IPFS is basically about building a data-exchange protocol in a modular codebase 4, so pieces can be changed out when needed, so once we are ready to go interplanetary, we have protocols that works well with the fact.

The base layer of this is all about static, content-addressed data. But it can be transferred dynamically.

For example, the naive solution for dynamic data in a immutable system, is having dynamic pointers pointing to static data. This way, the data itself can be immutable, while the pointers are dynamic, so it’s easy to have a website you can update without people having to know the address of the new content. In IPFS, the first solution for this was IPNS 5.

But IPNS is naive. It’s slow 6 7 and requires a polling-mechanism to get the latest update of the data and this doesn’t scale well.

This is where pubsub 8 comes in. The current main implementation is called floodsub 9 as it essentially floods the network when you send a message. There is a WIP implementation called gossipsub 10 that mimics the gossip protocol to make it more efficient and scalable.

The point of pubsub is similar to that of IPNS, enable static data to be sent dynamically. With this functionality and with the right data structures you can build dynamic applications that are not just faster and more secure for the average person accessing the internet, but also applications that can work no matter if you’re connected to the internet backbone or not.

If you are interested in IPFS but the thought of everything being static is turning you off, look into pubsub and IPNS in IPFS, and you will see that no matter what you are building today, could be built as a offline-first application instead. If you’re interested, check out the blogpost posted on the IPFS Blog 8 introducing pubsub.

  1. “Homepage: IPFS is the Distributed Web” [return]
  2. “Wikipedia: Content-addressable storage” [return]
  3. “Hacker News: IPFS is purely hash based which is great for static images/movies” [return]
  4. “GitHub: ipfs/specs/tree/master/architecture” [return]
  5. “GitHub: ipfs/specs/tree/master/architecture#Naming” [return]
  6. “GitHub: ipfs/go-ipfs namesys: IPNS/DNS resolution is very slow” [return]
  7. “GitHub: ipfs/go-ipfs Ipns very slow” [return]
  8. “IPFS Blog: Take a look at pubsub on IPFS” [return]
  9. “GitHub libp2p/go-floodsub” [return]
  10. “IPFS Forum: State of pubsub” [return]

This post was published Sep 18, 2018

To help hosting this website on IPFS run ipfs pin add --progress /ipns/