MCPcopy Create free account
hub / github.com/ElementsProject/lightning / check_payer_sig

Function check_payer_sig

plugins/offers_invreq_hook.c:628–638  ·  view source on GitHub ↗

BOLT #12: * - MUST reject the invoice request if `signature` is not correct as detailed in * [Signature Calculation](#signature-calculation) using the * `invreq_payer_id`. *... * - MUST reject the invoice if `signature` is not a valid signature using * `invoice_node_id` as described in [Signature Calculation](#signature-calculation). */

Source from the content-addressed store, hash-verified

626 * `invoice_node_id` as described in [Signature Calculation](#signature-calculation).
627 */
628static bool check_payer_sig(struct command *cmd,
629 const struct tlv_invoice_request *invreq,
630 const struct pubkey *payer_key,
631 const struct bip340sig *sig)
632{
633 struct sha256 merkle, sighash;
634 merkle_tlv(invreq->fields, &merkle);
635 sighash_from_merkle("invoice_request", "signature", &merkle, &sighash);
636
637 return check_schnorr_sig(&sighash, &payer_key->pubkey, sig);
638}
639
640static struct command_result *invreq_amount_by_quantity(struct command *cmd,
641 const struct invreq *ir,

Callers 1

listoffers_doneFunction · 0.85

Calls 3

check_schnorr_sigFunction · 0.85
merkle_tlvFunction · 0.50
sighash_from_merkleFunction · 0.50

Tested by

no test coverage detected