probe-lab / go-kademlia

Generic Go Kademlia implementation
Other
17 stars 4 forks source link

Learning from others #57

Open dennis-tra opened 1 year ago

dennis-tra commented 1 year ago

To avoid falling for the "Not invented here" syndrome I want to use this issue as a dumping ground for take-aways from other DHT implementations and specifications. Some I want to look at

  1. Theseus - https://wootfish.github.io/theseus.dht/
  2. BitTorrent Mainline DHT
  3. Ethereum discv5

I'll update this top-level issue comment whenever I have found the time to look into any of the above.


Theseus

Interesting bit on traffic obfuscation:

All protocol traffic is indistinguishable from random noise. Length-prefixing schemes are used on both protocol ciphertexts and plaintexts, and messages may be padded to any degree. This allows arbitrary message chunking, which is essential for traffic obfuscation.

Instead of a SHA256, they use Argon2id for Sybil resistance. They claim that Argon2id was "designed to render [brute-force attacks] extremely computationally expensive." This, together with peer ID expirations form the basis for Sybil resistance

Node IDs are generated by running a timestamp and a random bytestring through a state-of-the-art memory-hard cryptographic hash function, Argon2id. The result is trimmed and used. The node ID is always distributed along with its preimage, so that remote peers may verify that the two match. The timestamp is used to enforce an expiration date on node IDs.

iand commented 12 months ago

Also see rust-libp2p kademlia implementation

iand commented 11 months ago

Adding https://iroh.computer/design/dsht/ which has some thinking on improvements that can be made

guillaumemichel commented 11 months ago

I like the idea of using Argon2id for identity generation for mitigating Sybil attacks. If we are to change the key generation process, we may also want to get a balanced trie. For the IPFS network, it would be a protocol change, so ideally we could group it with another protocol breaking change (such as Composable DHT).