-
Notifications
You must be signed in to change notification settings - Fork 172
Home
OpenDHT is a C++17 Kademlia distributed hash table implementation.
The API was modified from the mainline BitTorrent DHT to add the following features:
- Ability to store arbitrary values of sizes up to 64 KiB.
- A listen operation, similar to get, that informs the requesting node of changes of values at a provided key for a few minutes. This avoid the need to poll for changes every few seconds.
- A value ID to distinguish different values stored under the same key (which was not needed when values where just IP addresses).
- A value type, attached to every value, that allows different expiration, creation or editing policies to be applied to different values. For instance, a value type may specify that values are expired after 5 minutes, or that they can only be accepted or edited if they are signed. Note that all nodes need to know about a given value type for the policy to be applied consistently, so the set of supported types is somehow part of the protocol. Nodes treat unknown value types with the default policy.
An optional public-key cryptography ("identity") layer was also added on top of the DHT and use the value type system introduced above. When used, this layer allows to put signed data on the DHT. Signed values can then only be edited by their owner. Signed values retrieved from the DHT are automatically checked and will only be presented to the user if the signature verification succeeds.
The identity layer also publishes a (usually self-signed) certificate on the DHT that can be used to encrypt data for other nodes. Encrypted values are always signed, and the signature is part of the encrypted data, which means that only the recipient can know who signed a value. For this reason, like standard non-signed values, encrypted values can't be edited.