Skip to content

Commit fe0bdd6

Browse files
authored
Merge pull request #225 from lightninglabs/verifymessage-schnorr
signer_client: correctly use 32-byte key for schnorr
2 parents 50295c0 + 6d65e0a commit fe0bdd6

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)