IPFS vs WebTorrent: What the value of using IPFS instead of torrent files?

Given that IPFS builds upon the torrent protocol, what problems does IPFS solve that torrent doesn’t solve instead? What’s the value added by using IPFS rather than just using plain torrent files?

3 Likes

IPFS doesn’t actually build on top of the Bittorrent protocol, but rather takes several good ideas from protocols like Bittorrent, Git, SFS, Bitcoin and the web, and gathers them all into one package.

There are several advantages to using IPFS over torrents, but the main advantage is the fact that there is only a single massive swarm, where anybody can give a block to everybody.

For example, say you’re visiting a small website that uses jQuery (or some other popular library). There might be only a couple people who visited that website, but you’ll still get the library nearly instantly. Maybe from your neighbor, or maybe you already have jQuery in your IPFS repo.
The net result is, the website loads way quicker than would otherwise be possible.

4 Likes

there is only a single massive swarm

isn’t this true for torrents as well? For example, webtorrent works very similarly to js-ipfs. You specify a magnet URL for a resource, and the resource is downloaded over Torrent instead of HTTP.

Not exactly, for torrents, there is essentially a separate swarm for every torrent. Two big torrents with only a few small files differing won’t share peers as IPFS does, for example.
Also, the way Bittorrent chunks content into blocks doesn’t work for all types of content (and isn’t designed for deduplication between torrents).

4 Likes

Two big torrents with only a few small files differing won’t share peers as IPFS does, for example.

ah, I see. So like, if there are 2 DVDs, same video but different language packs, I can download the video from both peers, whereas with torrent I have to download both of the DVDs separately (2 entire copies). This is a pretty cool reason to use IPFS.

Bittorrent chunks content into blocks doesn’t work for all types of content

what content for example? And why doesn’t it work?

Recently I was putting cdnjs (https://cdnjs.com/) on IPFS, it is currently about 72GiB in size, in IPFS it is just 32GiB due to block level de-duplication. Torrent doesn’t provide this feature. Also using torrent you are not able to easily just fetch one library from this package, IPFS doesn’t have this limitation.

There are many other examples like this.

5 Likes

Related reference info: a github issue on Comparison of IPFS and BitTorrent for Archives

1 Like

ipfs keeps files while you distribute them, torrent stores files forever

Well, IPFS keeps files until you garbage collect them, which by default needs to be run manually (or setup on interval via configuration). After that they are not distributed. Same goes with torrents normally, they are distributed until you close your client or remove the torrent. Nothing is forever :slight_smile:

3 Likes

I made a Repo, where you can use WebTorrent and IPFS. It’s great for comparison: https://github.com/Weedshaker/PeerWebSite
I broke it down to call WebTorrent transitory and IPFS rather permanent.

if you take file split into several files creating several Torrens then create a Torrent that downloading other torrent would be similar to what ipfs does?