View Project


This is an implementation of Kademlia/Mainline DHT Wikipedia Kademlia Link and Wikipedia Mainline Link this implementation was refrenced from Stanford Paper

What is a DHT

A DHT (Distributed Hash Table) is a distributed network that uses an XOR based routing system based off of user defined UIDs. UIDs are made using CRC32c hash of the users IP address and a random number. The random number allows multiple nodes on 1 NAT, while also limiting any person up to 100 nodes per NAT to stop 50% attacks.

[!NOTE] Decentralized networks work on a teir based system meaning that some nodes have more power or say than others do.

[!IMPORTANT] This is a DHT implementation, NOT a torrent implementation, this can talk with BitTorrent but it can only do FIND_NODE, PING, GET, & PUT.


BEP Title Status
BEP5 Bittorrent DHT Yes
BEP32 IPv6 Yes
BEP42 DHT Security Extension Yes


To join a node you can do

Kademlia k = new Kademlia();
k.join(6881, InetAddress.getByName("HOSENAME"), 6881);

To start a node without joining you can do

Kademlia k = new Kademlia();

To set Kademlia to Mainline you can do:

Kademlia k = new Kademlia("MainLine");


Java > 8


Languages used: Java