Expand description
Kademlia DHT for WeftOS mesh peer discovery (K6.2).
Implements a simplified Kademlia Distributed Hash Table for wide-area peer discovery. Uses XOR distance metric on 256-bit node keys and k-bucket routing tables.
DHT keys are namespaced with the governance genesis hash prefix so that nodes from different governance clusters occupy disjoint key-spaces.
Structs§
- DhtEntry
- A record stored in the DHT.
- Kademlia
Discovery - Kademlia DHT discovery backend.
- Kademlia
Table - Simplified Kademlia routing table with k-buckets.
- Namespaced
DhtKey - A governance-namespaced DHT key.
Constants§
- ALPHA
- Parallel lookup factor.
- KEY_
BITS - Key-space size in bits (SHA-256).
- K_
BUCKET_ SIZE - Maximum peers per k-bucket.
Functions§
- bucket_
index - Bucket index for a given XOR distance.
- leading_
zeros - Count leading zero bits in a DHT key (0..=256).
- xor_
distance - XOR distance between two DHT keys.
Type Aliases§
- DhtKey
- A 256-bit DHT key.