Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protocols/kad: Add double hasing for privacy to libp2p-kad #3169

Open
umgefahren opened this issue Nov 25, 2022 · 2 comments
Open

protocols/kad: Add double hasing for privacy to libp2p-kad #3169

umgefahren opened this issue Nov 25, 2022 · 2 comments

Comments

@umgefahren
Copy link
Contributor

umgefahren commented Nov 25, 2022

Description

To improve privacy during kademlia lookups it was proposed to add double hashing support to kad. The following part of the notion describes the changes pretty well:

Now

  1. Client sends Req(CID) to DHT server nodes
  2. DHT server nodes lookup if one of their provider records matches CID and if yes, return it
  3. If not
    a. DHT server nodes compute Hash(CID)
    b. DHT server nodes look for the closest peerIDs (according to the XOR distance) to Hash(CID) in their routing table and return them to the client

After

  1. Client sends (Req(Hash("CR_DOUBLEHASH" || MH)) to DHT server nodes, where MH is the MultiHash included in the CID
  2. DHT server nodes lookup if one of their provider records matches Hash("CR_DOUBLEHASH" || MH) and if yes return it
  3. If not
    a. DHT server nodes look for the closest peerIDs (according to the XOR distance) to Hash("CR_DOUBLEHASH" || MH) (without having to compute the hash of the CID themselves) in their routing table and return them to the client

Due to this change in behavior, the change necessary will be minimal but breaking. We have to figure out how we want to transition here. Also look at the corresponding notion document: https://pl-strflt.notion.site/Double-Hashing-Migration-Notes-75d723deb0d44a19a95615c5ccda3165

It probably makes sense to introduce these changes with prefix lookup and record encryption (also discussed in Notion Page by PL).

Relevant documentation:

Motivation

This change would increase reader privacy, by making it harder to track what a reader is looking for. It's part of the ongoing effort to increase privacy in libp2p.

Open Questions

  • How do we want to transition?

Are you planning to do it yourself in a pull request?

Yes.

In the interest of making it easier, I would like to see #3130 to be resolved first.

@umgefahren umgefahren changed the title feat(kad): Add double hasing for privacy to libp2p-kad protocols/kad: Add double hasing for privacy to libp2p-kad Nov 25, 2022
@umgefahren
Copy link
Contributor Author

Grant Proposal: filecoin-project/devgrants#1421

@guillaumemichel
Copy link
Contributor

FYI: The reference Spec has moved from Notion to ipfs/specs#373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants