theoldfuture.com

'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. https://ipfs.io/ “Homepage: IPFS is the Distributed Web” [return]
  2. https://en.wikipedia.org/wiki/Content-addressable_storage “Wikipedia: Content-addressable storage” [return]
  3. https://news.ycombinator.com/item?id=18009908 “Hacker News: IPFS is purely hash based which is great for static images/movies” [return]
  4. https://github.com/ipfs/specs/tree/master/architecture “GitHub: ipfs/specs/tree/master/architecture” [return]
  5. https://github.com/ipfs/specs/tree/master/architecture#35-naming----pki-namespace-and-mutable-pointers “GitHub: ipfs/specs/tree/master/architecture#Naming” [return]
  6. https://github.com/ipfs/go-ipfs/issues/2934 “GitHub: ipfs/go-ipfs namesys: IPNS/DNS resolution is very slow” [return]
  7. https://github.com/ipfs/go-ipfs/issues/3860 “GitHub: ipfs/go-ipfs Ipns very slow” [return]
  8. https://ipfs.io/blog/25-pubsub/ “IPFS Blog: Take a look at pubsub on IPFS” [return]
  9. https://github.com/libp2p/go-floodsub/ “GitHub libp2p/go-floodsub” [return]
  10. https://discuss.ipfs.io/t/state-of-pubsub/2411/6 “IPFS Forum: State of pubsub” [return]

This post was published Sep 18, 2018

theoldfuture.com

email@theoldfuture.com

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