You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're currently working on this distinction. The IDFromPublicKey puts the public key in a tagged struct, hashes it, and sets the peer ID to that hash. IDFrom Ed25519PublicKey embeds the public key in the peer ID, so that if you have the nodes peer ID, you have their public key as well. For now, I would recommend using IDFromPublicKey. IDFromEd25519PublicKey is experimental and not yet fully supported.
Looking at the example here: https://github.com/libp2p/go-libp2p/blob/master/examples/libp2p-host/host.go
and then later when creating the Peer ID:
However in the go docs for go-libp2p-peer
There is also a function to create a peer corresponding to Ed25519:
https://godoc.org/github.com/libp2p/go-libp2p-peer#IDFromEd25519PublicKey
func IDFromEd25519PublicKey
func IDFromEd25519PublicKey(pk ic.PubKey) (ID, error)
IDFromEd25519PublicKey returns the Peer ID corresponding to Id25519 pk
Should the example use this function since its using crypto.GenerateEd25519Key to generate the public key?
Or do you you use IDFromEd25519PublicKey when you generate a priv, pub pair with a function different from crypto.GenerateEd25519Key(rand.Reader)?
Or does it not matter what you use?
The text was updated successfully, but these errors were encountered: