Skip to content

Commit d7a2239

Browse files
common: add bolt12 payer proof support
Add common-layer payer proof encode, decode, and verification support for the `lnp` BOLT12 proof format with selective TLV disclosure via merkle tree reconstruction. - payer_proof_from_invoice(): creates a payer proof from a paid invoice by computing selective disclosure over the invoice's TLV merkle tree, including only required fields (invreq_payer_id, invoice_payment_hash, invoice_node_id, invoice_features) plus optional extra disclosures, then signing with the payer key - payer_proof_decode(): decodes and fully verifies an lnp-encoded proof by reconstructing the merkle root from disclosed fields, leaf hashes, omitted TLV markers, and missing hashes, then checking the invoice signature, payment preimage, and payer signature - Expose payer proof decoding through bolt12-cli and the offers plugin decode command with lnp1 prefix detection - Vector-backed tests covering the published payer-proof corpus, including note-bearing proofs and selective disclosure of odd experimental TLVs Changelog-None
1 parent 9737ef5 commit d7a2239

8 files changed

Lines changed: 1798 additions & 3 deletions

File tree

common/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ COMMON_SRC_NOGEN := \
8181
common/peer_io.c \
8282
common/penalty_base.c \
8383
common/per_peer_state.c \
84+
common/payer_proof.c \
8485
common/permute_tx.c \
8586
common/ping.c \
8687
common/plugin.c \

0 commit comments

Comments
 (0)