Skip to content

Proposal: protocol scheme for urls #92

@RangerMauve

Description

@RangerMauve

Description

BitTorrent is great for sharing archives of static content through clients that download them to a folder, or render a single file from the folder in the case of videos. Magnet links have made the flow of creating a torrent and sharing it with people dead simple.

However, magnet links are limited in that they only use the search portion of a URL and don't allow you to specify a file or specify a hostname to navigate through. This is an essential feature for getting torrents to be loaded in web browsers and interoperating with their idea of what an "origin" is.

Prior / Existing art

IPFS is similar to BitTorrent in that it is a P2P network for transferring files. They developed their own ipfs:// and ipns:// protocols for use in browsers and link sharing. This is used in their various applications including ipfs-companion which enables people to view websites published on IPFS.

The bittorrent: protocol proposed on the ietf mailing list in 2010. It's an interesting start, but it ended up trying to do things like connecting to initial peers and wasn't as good as magnet links. (IMO) It also doesn't account for new features like BEP 46 which allows specifying a public key in a magnet URI instead of an infohash which allows people to publish mutable torrents on the DHT.

My Webrun project for which I created btih:// and btpk:// protocol schemes in order to load JS files from a torrent (from an infohash or public key). I modeled this after IPFS by having different schemes for the mutable and immutable torrents, but I'm not sure if this is the best way to go for users. I chose btih and btpk because that's what's used in the URNs for magnet links.

wtp-webext by @tom-james-watson is a Firefox extension that lets you load torrents as websites in a browser using WebTorrent and the experimental libdweb API in Firefox. He's using the wtp:// scheme to stand for web torrent protocol, and is planning on supporting DNS resolution for infohashes through the same way IPNS and Dat do it.

Design

The URL should support:

  • Referencing infoHashes as the origin for the URL
  • Supporting file paths into the torrent through the path of the URL
  • Referencing public keys for BEP 46 mutable torrents
  • Referencing domains that get resolved through DNS

Not sure if it's necessary to support all the features of a magnet URI like trackers. My reasoning is that a browser should primarily rely on a DHT / local discovery / PEX rather than trackers since it's more decentralized.

Protocol name suggestions

  • bittorrent://
  • bt://
  • wtp://
  • ???

I wanted to create this issue to get feedback on the idea and to figure out what would work. My goal is to have some sort of URL figured out by the summer time and to have at least a couple of applications that are able to torrents with it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions