Skip to content

Conversation

shaavan
Copy link
Member

@shaavan shaavan commented Oct 9, 2025

Builds on #4126

This PR adds Dummy Hop support for Blinded Payment Paths, paralleling the dummy-hop feature introduced for Blinded Message Paths in #3726.

By allowing arbitrary dummy hops before the real ReceiveTlvs, the length of a Blinded Payment Path can be increased to create a larger search space for an attacker trying to locate the true recipient. This reduces the risk of timing and position based deanonymization and improves user privacy.

Extends the work started in
[PR#3917](lightningdevkit#3917)
by adding ReceiveAuthKey-based verification for Blinded Payment Paths.

This reduces space previously taken by individual ReceiveTlvs and
aligns the verification logic with that used for Blinded Message Paths.
Now that we have introduced an alternate mechanism for authentication
in the codebase, we can safely remove the now redundant (hmac, nonce)
fields from the Payment ReceiveTlvs's while maintaining the security
of the onion messages.
@ldk-reviews-bot
Copy link

👋 Hi! I see this is a draft PR.
I'll wait to assign reviewers until you mark it as ready for review.
Just convert it out of draft status when you're ready for review!

PaymentDummyTlv is an empty TLV inserted immediately before the
actual ReceiveTlvs in a blinded path. Receivers treat these dummy
hops as real hops, which prevents timing-based attacks.

Allowing arbitrary dummy hops before the final ReceiveTlvs obscures
the recipient's true position in the route and makes it harder for
an onlooker to infer the destination, strengthening recipient privacy.
Adds a new constructor for blinded paths that allows specifying
the number of dummy hops.
This enables users to insert arbitrary hops before the real destination,
enhancing privacy by making it harder to infer the sender–receiver
distance or identify the final destination.

Lays the groundwork for future use of dummy hops in blinded path construction.
@shaavan
Copy link
Member Author

shaavan commented Oct 9, 2025

The implementation is still in progress. The parsing logic that mitigates timing-based attacks is being refined. Once that’s settled, this PR will be ready for review.

Copy link

codecov bot commented Oct 9, 2025

Codecov Report

❌ Patch coverage is 84.57711% with 31 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.73%. Comparing base (9514637) to head (61f0ead).
⚠️ Report is 60 commits behind head on main.

Files with missing lines Patch % Lines
lightning/src/blinded_path/payment.rs 83.78% 9 Missing and 3 partials ⚠️
lightning/src/ln/msgs.rs 66.66% 7 Missing and 1 partial ⚠️
lightning/src/ln/onion_payment.rs 65.21% 6 Missing and 2 partials ⚠️
lightning/src/routing/router.rs 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4152      +/-   ##
==========================================
+ Coverage   88.57%   88.73%   +0.16%     
==========================================
  Files         179      180       +1     
  Lines      134374   135518    +1144     
  Branches   134374   135518    +1144     
==========================================
+ Hits       119016   120258    +1242     
+ Misses      12604    12497     -107     
- Partials     2754     2763       +9     
Flag Coverage Δ
fuzzing 21.71% <1.92%> (-0.09%) ⬇️
tests 88.58% <84.57%> (+0.17%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

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