‹ Notes

Notes on BitTorrent DHT mutable torrents.

get_peers(id, infohash) returns either the list of peers for an infohash, or a list of DHT nodes that may contain this information (used by the XOR routing algorithm).

announce_peer(id, infohash, port, token) the sending peer is appending their ip:port combo to the peers list for this infohash. token is given by the storage node to the querying node, to ensure only they can add themselves to this list.

Mutable torrents

BEP-44 introduced changes to the BitTorrent DHT where nodes could store arbitrary data under their public key. e.g. put(key=pubkey, value=anything), where the writes are authenticated via signatures. These values can only store 1000 bytes. Entries expire after 1h, and nodes must periodically re-announce them for replication by replaying the put message.

BEP-46 built atop BEP-44 and introduced a magnet URI scheme for mutable torrents. A mutable torrent is subscribed to on the basis of a publisher’s public key.