What is Kademlia?

Kademlia is a peer-to-peer Distributed Hash Table (DHT) based on the XOR metric.

  • Every Kademlia node and key is identified by a 160-bit identifier.
  • Kademlia is a key-value store, where each value is stored at the k nodes whose node IDs are closest to the key ID.
  • The distance between two IDs id1 and id2 is defined as id1 XOR id2.
    For example, distance(1, 4) = d(0b001, 0b100) = 0b001 XOR 0b100 = 0b101 = 5.