Commit d7a2239
committed
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-None1 parent 9737ef5 commit d7a2239
8 files changed
Lines changed: 1798 additions & 3 deletions
File tree
- common
- test
- devtools
- plugins
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| 84 | + | |
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
| |||
0 commit comments