-
Since The protocols I am using specifically at the moment are mDNS, Kademlia, and Gossipsub. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You can probably use identify to pass an additional user public key in one of the fields. You'll have to do the rest yourself |
Beta Was this translation helpful? Give feedback.
-
My suggestion is to not couple PeerId to users at all — a peer is a p2p network node, and as you say a single user may well use multiple nodes. These nodes need one unique identity each, even though they serve the same human. The associated PublicKey is an implementation detail of libp2p, I wouldn’t use it to represent the user either. A user should have their own SecretKey etc. which is completely separate from libp2p keys. So you’ll need to implement a way on your application level for transferring a SecretKey between nodes of the same end user and then use that for encryption and signatures on the application data — in addition to all the transport layer encryption employed by libp2p. |
Beta Was this translation helpful? Give feedback.
My suggestion is to not couple PeerId to users at all — a peer is a p2p network node, and as you say a single user may well use multiple nodes. These nodes need one unique identity each, even though they serve the same human. The associated PublicKey is an implementation detail of libp2p, I wouldn’t use it to represent the user either. A user should have their own SecretKey etc. which is completely separate from libp2p keys.
So you’ll need to implement a way on your application level for transferring a SecretKey between nodes of the same end user and then use that for encryption and signatures on the application data — in addition to all the transport layer encryption employed by libp2p.