go-nitro icon indicating copy to clipboard operation
go-nitro copied to clipboard

Do not pass private key directly to p2p messaging service.

Open geoknee opened this issue 2 years ago • 1 comments

This doesn't align with best practices around handling private keys:

https://github.com/statechannels/go-nitro/blob/92d6f4d92c4e567181216a0517b631e7f6f65e05/client/engine/messageservice/p2p-message-service/service.go#L76

See https://www.notion.so/statechannels/RFC-8-Securing-Private-StateChannel-Key-c4f2945172d84db2b84220d64502e38c for details.

Apparently the motivation was to create a deterministic message key from the channel signing key. I believe the message key is used to encrypt or sign messages.

Alternatives are:

  • pass in the hash of the private key
  • pass in the corresponding public key
  • ...

These retain the desired property of a deterministic message key.

geoknee avatar Jan 27 '23 17:01 geoknee

This is related to #1495, passing in the SC key directly allows us to recover the SC address from the peer ID.

lalexgap avatar Aug 01 '23 17:08 lalexgap