Comment by ValdikSS
16 hours ago
IPFS (at least initially) was designed to be a BitTorrent replacement, a new version of it, which you can use not only with a special software, but also via HTTP and also directly inside the browser.
It basically works as BitTorrent, but also provides HTTP access to the files.
In fact, many pirate websites use IPFS in one way or another (either directly, by serving the downloads over one of the public gateway, or indirectly, for internal needs).
Couldn't you also just build a bittorrent client that hosts a local webserver to provide http access? I could never get what IPFS actually did that bittorrent didn't.
1. IPFS has addressable content
The main drawback of BitTorrent v1 file hashing scheme inside the .torrent file is that it makes a virtual stream of the directory you want to share, splits that stream into blocks, and hash it altogether. That means that each file inside the torrent is unique, even if your directory have very common files, each is which exist in BitTorrent network per se.
IPFS solves this issue by just hashing the contents of the file. The "directory" of the files is a list of each individual file. If somebody has created a directory of 100 mp3 files and you happen to have one of it and added it into your IPFS daemon, you will be serving this file even if you've downloaded it from elsewhere (not from this "directory").
2. IPFS has both immutable and mutable files and directories
In BitTorrent, if you want to update your torrent file (in Russian we use «раздача» (bittorrent "upload"/"seeding"), a very precise word for bittorrent which doesn't have direct equivalent in English, so I'll stick to "torrent file), all the swarm needs to be switched to the updated version due to #1.
This means you have split swarm: the majority of people still seed the old version of torrent, and the minority seed the new version. Because of non-content addressation, all the old, already exising files in new .torrent file are treated as "new", and the old swarm can't seed them.
In IPFS, you can either create new immutable directory with all the old files and 1 new file, and all the old files would be seeded by the existing peers, or you can create mutable directory, and you can just modify it to your like without the need to update the link.
---
Both of these issues are solved in BitTorrent v2 more or less, but it's still not very popular, even if the specification is from 2017.
IPFS however is much more featureful than that. It allows to build decentralized distributed (serverless) websites and services, with user data and such.
There used to be a ZeroNet project which directly aimed at decentralized distributed web services, and is was very cool, there were many blogs, forums, boards. It all could be implemented in IPFS, but I saw only very simple text editors over IPFS and such, much simpler applications than it was in ZeroNet.
BitTorrent had their own version of distributed websites, Maelstrom: https://www.ctrl.blog/entry/bittorrent-maelstrom.html
> Couldn't you also just build a bittorrent client that hosts a local webserver to provide http access?
And this does exist! See confluence by anacrolix:
https://github.com/anacrolix/confluence
And also https://github.com/anacrolix/btlink :)