signrpc: add schnorr sig to sign and validate msg

This commit is contained in:
ErikEk authored and Oliver Gugger committed 2022-07-14 10:29:29 +02:00
1 parent 9d568cc119
commit b5af0ce327
8 files changed
+449 -213

No files matched your search

+32 -5
View File
@@ -320,7 +320,10 @@ message InputScriptResp {
}
message SignMessageReq {
// The message to be signed.
/*
The message to be signed. When using REST, this field must be encoded as
base64.
*/
bytes msg = 1;
// The key locator that identifies which key to use for signing.
@@ -331,9 +334,21 @@ message SignMessageReq {
/*
Use the compact (pubkey recoverable) format instead of the raw lnwire
format.
format. This option cannot be used with Schnorr signatures.
*/
bool compact_sig = 4;
/*
Use Schnorr signature. This option cannot be used with compact format.
*/
bool schnorr_sig = 5;
/*
The optional Taproot tweak bytes to apply to the private key before creating
a Schnorr signature. The private key is tweaked as described in BIP-341:
privKey + h_tapTweak(internalKey || tapTweak)
*/
bytes schnorr_sig_tap_tweak = 6;
}
message SignMessageResp {
/*
@@ -343,18 +358,30 @@ message SignMessageResp {
}
message VerifyMessageReq {
// The message over which the signature is to be verified.
// The message over which the signature is to be verified. When using
// REST, this field must be encoded as base64.
bytes msg = 1;
/*
The fixed-size LN wire encoded signature to be verified over the given
message.
message. When using REST, this field must be encoded as base64.
*/
bytes signature = 2;
// The public key the signature has to be valid for.
/*
The public key the signature has to be valid for. When using REST, this
field must be encoded as base64. If the is_schnorr_sig option is true, then
the public key is expected to be in the 32-byte x-only serialization
according to BIP-340.
*/
bytes pubkey = 3;
/*
Specifies if the signature is a Schnorr signature.
*/
bool is_schnorr_sig = 4;
}
message VerifyMessageResp {
// Whether the signature was valid over the given message.
bool valid = 1;