signrpc: sign and verify messages with custom key #3812
Merged
Conversation
wpaulino
approved these changes
Dec 10, 2019
Roasbeef
requested changes
Dec 11, 2019
Collaborator
Author
|
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 |
39ab7b4 to
ffbfc40
Compare
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.
Contributor
|
I think |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing
SignMessageandVerifyMessagein the mainrpc.protofile 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.protodon't have those restrictions and allow signing and verifying over custom wallet keys (limited to the1017'special purpose derivation branch).