-
Notifications
You must be signed in to change notification settings - Fork 282
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
Let users of libp2p decide on authentication scheme #185
Comments
This actually can be accomplished by integrating Noise. To use it, User would just create Noise security adaptor with a set of handshake patterns. Example in pseudocode:
Since specific handshake pattern is a string, it can be added to a list of supported protocols and then negotiated by multiselect:
or
or
Note that |
What are the use-cases you have in mind? The only use-case I can think of is bootstrapping of peers on the local network by guessing. The hard requirement is that both sides of the connection need some kind of peer ID. Libp2p treats them like are like PIDs and pretty much all parts of libp2p break without them (which is why the "insecure" transport is currently broken). On the other hand, they can (in theory) be ephemeral. Concerns:
However, you're right that being able to connect to a peer without knowing their peer ID is something a flexible network stack should support and I've personally wanted to be able to do this just for debugging (e.g., there's a peer running on some random IP, who is it?). It just needs some pretty significant motivation. |
@Stebalien do I understand correctly that go-libp2p does not allow connecting to an address without the peer ID of the node behind given address? I.e. does go-libp2p not offer a version of As a reference point in rust-libp2p there is both a |
@mxinden yep, go-libp2p requires a peerID in order to make a connection. If the application layer wants to find some out of band way to communicate the peerID with different security requirements (e.g. stored in a DNS TXT record, an HTTP server on some predetermined port on the same IP address, etc.) they can. As an aside: IIRC most of the security negotiation protocols in use will compare the inbound public key to the peerID and error out if they aren't compatible. This means that if I really wanted an insecure dial it could likely be done via some wrapper that dials |
Thanks @aschmahmann for the clarification. I am closing here since (a) the discussion has stalled and (b) we are still missing a use-case. Please follow-up with a comment in case you would like to continue this discussion. In case dialing an unknown node by its address only is a missing feature in go-libp2p I would suggest starting this discussion in one of the go-libp2p-* repositories. |
So, according to noise spec there are 3 source payload security properties:
And 6 destination payload security properties:
I, as a user of a perfect p2p library (which libp2p is), would want to configure my security adaptors to provide desired properties depending on my application (with some wise defaults).
Current implementations require dialer to know responder's peer id to do authentication. This requirement reduces number of different use-cases when libp2p can be applied.
This issue is a result of a discussion in #184.
The text was updated successfully, but these errors were encountered: