Skip to content

Add a BlindedMessagePath constructor for external recipients#4742

Open
dunxen wants to merge 1 commit into
lightningdevkit:mainfrom
dunxen:2026-06-blinded-msg-path-extern-recipient
Open

Add a BlindedMessagePath constructor for external recipients#4742
dunxen wants to merge 1 commit into
lightningdevkit:mainfrom
dunxen:2026-06-blinded-msg-path-extern-recipient

Conversation

@dunxen

@dunxen dunxen commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

We're currently working on BOLT 12 receives in Bark and, at the moment, we run a CLN node for
handling lightning sends and receives atomically for clients of our ark server.

For BOLT 12 receives, we will allow clients to create their own offers (with their own per-offer derived issuer_signing_pubkey), and register them with the server. Requests for invoices on that offer are forwarded to clients who generate and sign invoices themselves. The CLN node is still the final recipient and introduction node on the lightning side. The rest of the flow is similar to our atomic BOLT 11 hold invoice/HTLC VTXO flow.

All our client lightning code uses LDK and we need a way to construct a recipient hop that CLN actually understands with no authentication. Deanonymisation protections are irrelevant in this scenario.

I'm open to ideas if you'd prefer not to have such a constructor just to cover our case as it is somewhat new.

@ldk-reviews-bot

ldk-reviews-bot commented Jun 24, 2026

Copy link
Copy Markdown

🎉 This PR is now ready for review!
Please choose at least one reviewer by assigning them on the right bar.
If no reviewers are assigned within 10 minutes, I'll automatically assign one.
Once the first reviewer has submitted a review, a second will be assigned if required.

@dunxen dunxen requested review from TheBlueMatt and jkczyz June 24, 2026 12:23
@ldk-claude-review-bot

ldk-claude-review-bot commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

The code is consistent with my prior review. The implementation is symmetric and correct, and the changelog now documents both new APIs (resolving my prior comment).

No issues found.

The previously-flagged changelog issue (missing BlindedMessagePath::new_for_external_recipient entry) is now resolved — pending_changelog/blinded-path-external-recipient.txt documents both the message-path and payment-path constructors. The code changes remain correct: new_for_external_recipient passes None for both local_node_receive_key and context, all existing callers correctly wrap their values in Some(...), and the dropped deanonymization protection is intentional and documented.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.29%. Comparing base (1c1a4ad) to head (d593175).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/blinded_path/payment.rs 98.38% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4742      +/-   ##
==========================================
- Coverage   86.90%   86.29%   -0.61%     
==========================================
  Files         161      160       -1     
  Lines      111680   111615      -65     
  Branches   111680   111615      -65     
==========================================
- Hits        97052    96315     -737     
- Misses      12115    12660     +545     
- Partials     2513     2640     +127     
Flag Coverage Δ
fuzzing-fake-hashes ?
fuzzing-real-hashes ?
tests 86.29% <99.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dunxen dunxen marked this pull request as draft June 25, 2026 11:01
@dunxen

dunxen commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Putting this in draft. Also need a similar constructor for BlindedPaymentPath. We were on an older version of LDK so didn't pick that up.

@dunxen dunxen force-pushed the 2026-06-blinded-msg-path-extern-recipient branch from d6dee2b to 8155722 Compare June 25, 2026 11:21
@dunxen dunxen marked this pull request as ready for review June 25, 2026 11:21
Comment thread pending_changelog/blinded-payment-path-external-recipient.txt Outdated
Add `new_for_external_recipient`, which builds a recipient hop using standard
BOLT-4 ChaCha20Poly1305 (empty AAD) and no `MessageContext` or deanonymisation
protections.

A similar constructor is introduced for `BlindedPaymentPath` to build
a compatible payee hop.

Tests by Claude
@dunxen dunxen force-pushed the 2026-06-blinded-msg-path-extern-recipient branch from 8155722 to d593175 Compare June 25, 2026 11:35
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.

3 participants