Webtorrent has been around for a while, and torrents have been around since 2001. Webtorrent is a big part of the reason why I found PeerTube so exciting. Outside of streaming PeerTube videos, and downloading a linux install ISO, the technology itself seems to be under-utilized. Many fediverse fans want to see webtorrents used to distribute all media, which would significantly help smaller servers, but that would require building in suport to each server.
This lead me to a simple question:
Do [bit]torrent and webtorrent overlap at all?
Is there a torrent client that can seed both?I’ve seen a couple of unresolved issues on clients like qbittorrent, but I’m wondering if there’s one people use.
Same question, but also for the tracker side, is there tracker software that both clients can talk to?
Answering the question:
Short answer: Yes, but…
To revisit the fundamentals, I’m going to give a basic summary of how torrents work:
- A torrent file or magnet link will provide a client with the hash of the file(s) requested, as well as any trackers or webseeds.
- Torrent Clients will request peers from trackers that list where the other peers are.
- Trackers can be contacted through UDP, HTTP/HTTPS and Websockets (for webtorrent).
- Torrent clients will then request data from their peers. If they can communicate the peers who have the data will seed the file(s) too the client requesting the data. On webtorr
This means that for downloads to succeed, you need at least:
- A tracker that lists peers
- Peers that can communicate with each other
For some very popular torrents, it’s highly likely that both BitTorrent clients and webtorrent clients will be able to download the files regardless. This is because with many trackers and many peers, it’s very easy to find lots of overlap.
The challenge for those trying to distribute new torrents (such as their own work or archives) seeding from a single client may often not be enough. This is because despite the libtorrent library supporting communication with webrtc peer, torrent clients like qBittorrent still don’t support it.
Recommendations for distributing your own files via BitTorrent & webtorrent:
- Host your own tracker that supports at least websockets and either UDP/http(s) bittorrent-tracker is a good pick, but I’m also wondering if torrust supports websockets.
- Ensure you’re seeding from both a webtorrent client and a regular BitTorrent client until there is a client that allows seeding to both.
- Make sure the torrent/magnet you’re distributing includes a good variety of trackers, such as a good mix of https & websocket (wss://) trackers.
- Make use of webseeds! A webseed allows peers to download the files from URLs. For bootstrapping webtorrent peers, it’s a no-brainer!
Additional thoughts
- DHT probably helps a ton once more than a couple people are seeding.
- Many sites like archive.org & peertube use v1 hashes instead of BitTorrent v2
- Webtorrent may work well on static sites, I may experiement with the file.getBlob feature to see how doable it is.
- Misskey clips are really handy, it’s like having your own curated online forum powered by interactions on the fediverse. I’ve set one up for these kinds of Q&A style posts.