Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update signer rpc protos #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 79 additions & 9 deletions vendor/signrpc/signer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,12 @@ message SignMessageReq {
privKey + h_tapTweak(internalKey || tapTweak)
*/
bytes schnorr_sig_tap_tweak = 6;

/*
An optional tag that can be provided when taking a tagged hash of a
message. This option can only be used when schnorr_sig is true.
*/
bytes tag = 7;
}
message SignMessageResp {
/*
Expand Down Expand Up @@ -385,6 +391,13 @@ message VerifyMessageReq {
message VerifyMessageResp {
// Whether the signature was valid over the given message.
bool valid = 1;


/*
An optional tag that can be provided when taking a tagged hash of a
message. This option can only be used when is_schnorr_sig is true.
*/
bytes tag = 5;
}

message SharedKeyRequest {
Expand Down Expand Up @@ -444,12 +457,33 @@ message TaprootTweakDesc {
bool key_spend_only = 2;
}

enum MuSig2Version {
/*
The default value on the RPC is zero for enums so we need to represent an
invalid/undefined version by default to make sure clients upgrade their
software to set the version explicitly.
*/
MUSIG2_VERSION_UNDEFINED = 0;

/*
The version of MuSig2 that lnd 0.15.x shipped with, which corresponds to the
version v0.4.0 of the MuSig2 BIP draft.
*/
MUSIG2_VERSION_V040 = 1;

/*
The current version of MuSig2 which corresponds to the version v1.0.0rc2 of
the MuSig2 BIP draft.
*/
MUSIG2_VERSION_V100RC2 = 2;
}

message MuSig2CombineKeysRequest {
/*
A list of all public keys (serialized in 32-byte x-only format!)
participating in the signing session. The list will always be sorted
lexicographically internally. This must include the local key which is
described by the above key_loc.
A list of all public keys (serialized in 32-byte x-only format for v0.4.0
and 33-byte compressed format for v1.0.0rc2!) participating in the signing
session. The list will always be sorted lexicographically internally. This
must include the local key which is described by the above key_loc.
*/
repeated bytes all_signer_pubkeys = 1;

Expand All @@ -465,6 +499,14 @@ message MuSig2CombineKeysRequest {
on-chain.
*/
TaprootTweakDesc taproot_tweak = 3;

/*
The mandatory version of the MuSig2 BIP draft to use. This is necessary to
differentiate between the changes that were made to the BIP while this
experimental RPC was already released. Some of those changes affect how the
combined key and nonces are created.
*/
MuSig2Version version = 4;
}

message MuSig2CombineKeysResponse {
Expand All @@ -482,6 +524,11 @@ message MuSig2CombineKeysResponse {
is used.
*/
bytes taproot_internal_key = 2;

/*
The version of the MuSig2 BIP that was used to combine the keys.
*/
MuSig2Version version = 4;
}

message MuSig2SessionRequest {
Expand All @@ -491,10 +538,10 @@ message MuSig2SessionRequest {
KeyLocator key_loc = 1;

/*
A list of all public keys (serialized in 32-byte x-only format!)
participating in the signing session. The list will always be sorted
lexicographically internally. This must include the local key which is
described by the above key_loc.
A list of all public keys (serialized in 32-byte x-only format for v0.4.0
and 33-byte compressed format for v1.0.0rc2!) participating in the signing
session. The list will always be sorted lexicographically internally. This
must include the local key which is described by the above key_loc.
*/
repeated bytes all_signer_pubkeys = 2;

Expand All @@ -516,6 +563,24 @@ message MuSig2SessionRequest {
on-chain.
*/
TaprootTweakDesc taproot_tweak = 5;

/*
The mandatory version of the MuSig2 BIP draft to use. This is necessary to
differentiate between the changes that were made to the BIP while this
experimental RPC was already released. Some of those changes affect how the
combined key and nonces are created.
*/
MuSig2Version version = 6;

/*
A set of pre generated secret local nonces to use in the musig2 session.
This field is optional. This can be useful for protocols that need to send
nonces ahead of time before the set of signer keys are known. This value
MUST be 97 bytes and be the concatenation of two CSPRNG generated 32 byte
values and local public key used for signing as specified in the key_loc
field.
*/
bytes pregenerated_local_nonce = 7;
}

message MuSig2SessionResponse {
Expand Down Expand Up @@ -553,6 +618,11 @@ message MuSig2SessionResponse {
now.
*/
bool have_all_nonces = 5;

/*
The version of the MuSig2 BIP that was used to create the session.
*/
MuSig2Version version = 6;
}

message MuSig2RegisterNoncesRequest {
Expand Down Expand Up @@ -637,4 +707,4 @@ message MuSig2CleanupRequest {
}

message MuSig2CleanupResponse {
}
}