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

Allow CID to reference public keys (possibly make it extensible) #15

Closed
mildred opened this issue Dec 27, 2016 · 2 comments
Closed

Allow CID to reference public keys (possibly make it extensible) #15

mildred opened this issue Dec 27, 2016 · 2 comments

Comments

@mildred
Copy link

mildred commented Dec 27, 2016

See message on IRC: https://botbot.me/freenode/ipfs/msg/78509267/

Currently, when looking up public keys, the generic value store interface of the DHT is used.

This has the effect that when, for example looking up a public key (but this is the same for naming), the DHT is queried twice. Once for the correspondance between the public key fingerprint to know the block id and once more to get the list of peers that can provide the block with the id we just got.

Instead, the key could be directly lookup up using the content lookup interface of the DHT. This interface takes a CID and respond with a list of peers directly. This is exactly what we need.

I suggest that we add an encoding in the CID to represent a public key from the key hash to avoid the two phase lookup. This is what this ticket is for.

I also suggest that instead of taking a pointer to a CID value, the routing interface references an interface type instead, that could be implemented differently. This is to be tracked in libp2p/go-libp2p-routing.

Don't hesitate to chat with me over IRC, realtime makes it easier to remove ambiguities

@mildred mildred changed the title Allow CID to reference anything (extensible) Allow CID to reference public keys (possibly make it extensible) Dec 27, 2016
@whyrusleeping
Copy link
Member

@mildred agreed on wanting a CID codec to easily reference keys. We want to use ipld to do this, and call the format multikey.

However, we could address the problem you bring up without that. If peers added their public keys into the blockstore then you could move them around with bitswap, and peers could fetch public keys that way instead of requiring a dht query

@lidel
Copy link
Member

lidel commented Feb 6, 2020

FYSA we now have libp2p-key multicodec, it is used for representing PeerIDs as CIDs: multiformats/multicodec#130

This issue is pretty old, so I am closing this.
A lot changed since then, revisited DHT improvements can be proposed in upstream go-ipfs or libp2p repos.

@lidel lidel closed this as completed Feb 6, 2020
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

3 participants