Skip to content

Payer proofs#9116

Open
rustyrussell wants to merge 14 commits intoElementsProject:masterfrom
rustyrussell:guilt/payer-proof
Open

Payer proofs#9116
rustyrussell wants to merge 14 commits intoElementsProject:masterfrom
rustyrussell:guilt/payer-proof

Conversation

@rustyrussell
Copy link
Copy Markdown
Contributor

This is an implementation of the latest lightning/bolts#1295 draft proposal.

Experimental at this stage, as format may change.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@rustyrussell rustyrussell added this to the v26.06 milestone May 7, 2026
@rustyrussell rustyrussell requested a review from cdecker as a code owner May 7, 2026 04:47
rustyrussell and others added 10 commits May 7, 2026 14:17
We missed this.  It's experimental, so no changelog needed.

Spotted-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
We no longer have offer_recurrence, we have
offer_recurrence_compulsory and offer_recurrence_optional.  Decode was
changed in v25.12, but we never properly tested it (recurrence is
experimental, after all).

I opted for simplicity over truth here, and simply modified decode to
match the schema, but add a "compulsory" flag.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
If we have 5 fields, ilog64(5) is 3, and (1 << 3) is 8.  Adding one
made it 16.

In fact, since ilog64(4) is also 3, we should *subtract one*, but
this handles 0 more neatly (ilog64(0) is defined to return 0, as
a special case).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Allow a callback to tell us the hash of unknown branches.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Proof code needs this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Claude helped debug, using the LDK implementation at first, then
modified heavily.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
[Adapted for my decode routines --RR]
vincenzopalazzo and others added 3 commits May 7, 2026 14:28
[Adapted for my decode routines --RR]
Changelog-EXPERIMENTAL: JSON-RPC: `decode` now supports the `lnp` payer proof format.
Create canonical JSON test vectors, using SUPERVERBOSE.  We remove the
ones from bolt12_merkle.c.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-EXPERIMENTAL: JSON-RPC: `createproof` to create a payment proof for a (successful) BOLT12 payment.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants