Skip to content

Commit 6d65e0a

Browse files
committed
signer_client: correctly use 32-byte key for schnorr
This was incorrect all along, seems like we haven't actually used the VerifySchnorr option in any project yet.
1 parent 50295c0 commit 6d65e0a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

signer_client.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,12 @@ func (s *signerClient) VerifyMessage(ctx context.Context, msg, sig []byte,
502502
opt(rpcIn)
503503
}
504504

505+
// If the signature is a Schnorr signature, we need to set the public
506+
// key as the 32-byte x-only key, as mentioned in the RPC docs.
507+
if rpcIn.IsSchnorrSig {
508+
rpcIn.Pubkey = pubkey[1:]
509+
}
510+
505511
rpcCtx = s.signerMac.WithMacaroonAuth(rpcCtx)
506512
resp, err := s.client.VerifyMessage(rpcCtx, rpcIn)
507513
if err != nil {

0 commit comments

Comments
 (0)