
BitTorrent's DHT - spiffytech
https://en.wikipedia.org/wiki/Mainline_DHT
======
jwcrux
There was an interesting talk [0] and paper [1] presented at some security
conferences about crawling the DHT for different purposes. It's been a while,
but I remember these to be a great read.

[0]
[https://www.defcon.org/images/defcon-18/dc-18-presentations/...](https://www.defcon.org/images/defcon-18/dc-18-presentations/Wolchok/DEFCON-18-Wolchok-
Crawling-Bittorrent-DHTS.pdf)

[1] [https://jhalderm.com/pub/papers/dht-
woot10.pdf](https://jhalderm.com/pub/papers/dht-woot10.pdf)

~~~
synctext
State-of-the-art in DHT measurements: [http://www.p2p-conference.org/p2p14/wp-
content/uploads/2014/...](http://www.p2p-conference.org/p2p14/wp-
content/uploads/2014/09/225.P2P2014_50.pdf) "100 Million DHT replies"

~~~
voltagex_
Am I missing it in the paper or was the code for this ever released?

------
jlouis
Here is an Erlang implementation of, essentially, the BT DHT:

[https://github.com/jlouis/dht](https://github.com/jlouis/dht)

Its main feature is that it has a full formal model written in QuickCheck to
verify its integrity. That is, the dht code is simulated in a universe in
which rarely occurring events are far more likely to happen.

------
lewisl9029
There's also fairly robust pure JS implementation of the BitTorrent DHT that
works in both Node and the browser: [https://github.com/feross/bittorrent-
dht](https://github.com/feross/bittorrent-dht)

I'd love to see more decentralized web apps built on similar technologies.

~~~
DiThi
How can it work in the browser? There's no reference to WebRTC in the code.

~~~
lewisl9029
Sorry, it looks like you're right, there's no browser support yet.

I had always simply assumed that since webtorrent works in the browser, the
DHT it uses must also work in the browser, but apparently browser DHT support
is still a work in progress:
[https://github.com/feross/webtorrent/issues/288](https://github.com/feross/webtorrent/issues/288)

------
runn1ng
This is why I don't get the fuss about IPFS.

It's basically bittorrent and its DHT, just named differently! (and without
the added value of trackers)

~~~
sliken
I suggest you learn more about IPFS, you are missing quite a bit. Read up on
merkle-dag's, content addressable storage, and universal name spaces.

It's a distributed filesystem. IPFS uses the DHT similarly to bittorrent, just
to find peers. But there's much more to IPFS than DHT+torrent.

~~~
runn1ng
All right, will try

------
jerguismi
Could this DHT be used to store _any_ content?

~~~
olympus
You're probably better off using the BitCoin blockchain (which is a
distributed network). It's well documented that you can include data in
BitCoin transactions and pretty secure.

But I'd bet you could store information in the DHT itself. Here's the issue:
to store the information in the DHT you'd have to attach it to a torrent. To
make it relatively persistent the torrent would have to be popular so that it
will continue to be seeded and not disappear for a while (like a movie file or
a popular music album). If you're doing that you might as well stick the info
in the torrent itself instead of hacking it into the DHT. That's what torrents
are for.

~~~
sliken
First blockchains are slow. Second you can put things in the DHT without
having anything to do with a torrent.

~~~
thisisrobv
+1 not sure where "to store the information in the DHT you'd have to attach it
to a torrent" comes from.

~~~
olympus
It comes from the fact that the Mainline DHT is specifically about BitTorrent
nodes and who has which torrents. The client programs don't just pass
information around willy-nilly.

------
sktrdie
How's this news? BitTorrent's DHT has been around for years.

~~~
TazeTSchnitzel
Things don't have to be new to appear on HN, just interesting.

