Skip to content

signrpc: sign and verify messages with custom key #3812

Merged
Roasbeef merged 3 commits into
lightningnetwork:masterfrom
guggero:sign-custom
Dec 12, 2019
Merged

signrpc: sign and verify messages with custom key #3812
Roasbeef merged 3 commits into
lightningnetwork:masterfrom
guggero:sign-custom

Conversation

@guggero
Copy link
Copy Markdown
Collaborator

@guggero guggero commented Dec 10, 2019

The existing SignMessage and VerifyMessage in the main rpc.proto file are very restrictive in that they only allow creating signatures over the node's identity private key and that a signature's recovered public key must correspond to a nodes' identity public key known to the network.
The new methods in the signer.proto don't have those restrictions and allow signing and verifying over custom wallet keys (limited to the 1017' special purpose derivation branch).

Comment thread lnrpc/signrpc/signer_server.go Outdated
Comment thread lnrpc/signrpc/signer_server.go Outdated
@guggero
Copy link
Copy Markdown
Collaborator Author

guggero commented Dec 11, 2019

I switched to default ECDSA encoding but left the message prefixing in to avoid signing anything sensitive. This means that you can only verify signatures generated with the lnd signer which should be fine for our use case.

I've also given the VerifyMessage the signer/read permission instead of signer/generate.

@guggero guggero requested a review from Roasbeef December 11, 2019 08:59
@guggero guggero force-pushed the sign-custom branch 3 times, most recently from 39ab7b4 to ffbfc40 Compare December 11, 2019 20:52
To allow signing of messages with any key in the key chain
we add two new methods to the signer RPC. These behave differently
to the methods with the same name in the main RPC as described
in the documentation comment.
Copy link
Copy Markdown
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🛫

@Roasbeef Roasbeef merged commit 3381755 into lightningnetwork:master Dec 12, 2019
@guggero guggero deleted the sign-custom branch December 12, 2019 07:14
@joostjager
Copy link
Copy Markdown
Contributor

I think admin.macaroon needs to be regenerated? In that case it may be good to add that to the release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants