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

IPIP-334: Double-Hashed Find Providers in Reframe #334

Closed
wants to merge 2 commits into from

Conversation

willscott
Copy link
Contributor

This PR describes a proposed request/response method for reframe to support "double-hashed" content routing lookups.

cc @guillaumemichel

…to the current method.

FindHashedSHA256Request requests content routing records using a derived hash of a CID of interest.

This extension to reframe also introduces authenticaled content routing records that can be
returned by this method. These records will blind the true peer ID of the provider, and
are extended with a signature allowing the requester to validate their authenticity.
Comment on lines +222 to +223
It is constructed by taking the raw bytes of the multihash, prepending the ascii bytes "CR_DOUBLEHASH", and taking the SHA256 hash of that data.
The resulting digest is then packed itself into a multihash, using the multihash code identifier multihash.DBL_SHA2_256.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the contingency for replacing SHA256 with other function in the future?
Creating a new message type?

Would it be acceptable renaming these requests to FingHashedProvidersRequest and move hash function multicodec to struct field?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current contingency is a new message type.

having it in the request is sub-optimal because it would mean another round of probing for what types of hashes are supported.

changing the hash algorithm will be 'a big deal' and something we don't do often, so using the existing 'identify' layer to identify which one the server supports seems preferable to the client trying other ones and getting told they're not supported.

we expect handlers of FindProviders to support 1 or at most 2 hash algorithms at any given time.

```

The query is a derived hash of the multihash being requested.
It is constructed by taking the raw bytes of the multihash, prepending the ascii bytes "CR_DOUBLEHASH", and taking the SHA256 hash of that data.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should support prefix requests, with variable length Queries

Suggested change
It is constructed by taking the raw bytes of the multihash, prepending the ascii bytes "CR_DOUBLEHASH", and taking the SHA256 hash of that data.
It is constructed by taking the raw bytes of the multihash, prepending the ascii bytes "CR_DOUBLEHASH", and taking a variable length prefix of the SHA256 hash of that data.


```ipldsch
type FindHashedSHA256Response struct {
Providers [Provider]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FindHashedSHA256Response should contain a map of Bytes -> Encrypted Provider. A single FindHashedSHA256Request using prefix lookup may return multiple encrypted provider records matching the prefix.

@lidel lidel changed the title Double-Hashed Find Providers reframe extension IPIP-334: Double-Hashed Find Providers in Reframe Oct 26, 2022
@lidel
Copy link
Member

lidel commented Aug 7, 2023

Reframe is no more (ipfs/kubo#9479)

/routing/v1 version is tracked in #421

@lidel lidel closed this Aug 7, 2023
@lidel lidel deleted the feat/reframe-double-hashed branch August 7, 2023 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Deferred
Development

Successfully merging this pull request may close these issues.

3 participants