Open josephawallace opened 1 year ago
How do you handle the difficulty in distinguishing clients, bootstraps, and service peers?
pid, err := client.Host.Peerstore().FirstSupportedProtocol(peerId, protocols.KeygenPId)
to determine whether a peer supports a protocol (in this example keygen). You can do this for all peers in a peer store to get the list of service peers. From there, the peers can be selected randomly.How do you keep track of which service nodes hold which keys?
Peer-side KV store will map: publicKey ---> keygenSaveData Client-side KV store will map: keyName ---> publicKey (assigned by user) / publicKey ---> metadata (returned from keygen)
Therefore, on signing, you only need to specify the key name. The client will retrieve the the public key, then the metadata (which contains the party of nodes) and form a complete request. The main work here is getting the data to be returned from a keygen protocol and saving it properly with the client.
The client should send the requests over streams - ended up that I don't want to use pubsub channels because every node gets blue-balled when they have to check their databases just to see that they don't have the key.
Description
The participating service nodes of a keygen or signature function are selected by the client. Up to this point, that party of nodes was considered the owner of the key. However, with the upcoming changes to authorization, they resource owners will be specified in an access control policy. Therefore, there is no reason for a client to make the decision on what nodes will perform the actual work of computing a new key or signature, since that is inconsequential. Seeing that the service nodes do not need to distinguish themselves, they should be selected dynamically, as appropriate.
Todo