From 6d65e0a659bc089cccf1211b2bd95a8a970278b3 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 2 Jun 2025 17:40:22 +0200 Subject: [PATCH] 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. --- signer_client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/signer_client.go b/signer_client.go index 048db2c..acadd2d 100644 --- a/signer_client.go +++ b/signer_client.go @@ -502,6 +502,12 @@ func (s *signerClient) VerifyMessage(ctx context.Context, msg, sig []byte, opt(rpcIn) } + // If the signature is a Schnorr signature, we need to set the public + // key as the 32-byte x-only key, as mentioned in the RPC docs. + if rpcIn.IsSchnorrSig { + rpcIn.Pubkey = pubkey[1:] + } + rpcCtx = s.signerMac.WithMacaroonAuth(rpcCtx) resp, err := s.client.VerifyMessage(rpcCtx, rpcIn) if err != nil {