Skip to content

Allow recipient to pay for blinded route fees#2993

Merged
thomash-acinq merged 6 commits intomasterfrom
fee-less-blinded-route
Feb 25, 2025
Merged

Allow recipient to pay for blinded route fees#2993
thomash-acinq merged 6 commits intomasterfrom
fee-less-blinded-route

Conversation

@thomash-acinq
Copy link
Contributor

@thomash-acinq thomash-acinq commented Jan 31, 2025

When using blinded payment paths, the fees of the blinded path should be paid by the recipient, not the sender.

  • It is more fair: the sender chooses the non blinded part of the path and pays the corresponding fees, the recipient chooses the blinded part of the path and pays the corresponding fees.
  • It is more private: the sender does not learn the actual fees for the path and can't use this information to unblind the path.

@thomash-acinq thomash-acinq force-pushed the fee-less-blinded-route branch 10 times, most recently from 3025a99 to 69dbea4 Compare February 10, 2025 14:37
When using blinded payment paths, the fees of the blinded path should be paid by the recipient, not the sender.

- It is more fair: the sender chooses the non blinded part of the path and pays the corresponding fees, the recipient chooses the blinded part of the path and pays the corresponding fees.
- It is more private: the sender does not learn the actual fees for the path and can't use this information to unblind the path.
@thomash-acinq thomash-acinq requested a review from t-bast February 10, 2025 15:25
@thomash-acinq thomash-acinq marked this pull request as ready for review February 10, 2025 15:26
We clarify that the previously named "hiddenFee" is actually the blinded
path fee that is being paid by the recipient (by deducing it from the
amount it plans on receiving). We thus rename variables and add docs.

We also revert the validation flow: instead of generating a payment part
for that fee based on the difference between the paid amount and the
onion value, we generate that payment part based on the blinded path fee
we recorded in the `path_id` and validate that it matches what the payer
is sending.

We revert some of the changes to the `MultiPartHandler` which aren't
necessary and do some clean-up of some unused code paths.
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better, but I think we can go further and make this clearer and more flexible: see #3010

@thomash-acinq
Copy link
Contributor Author

I've merged your improvements but changed a bit the way the recipient path fees are computed:

  • the actual fee taken by the path is payload.amount - add.amountMsat, that's what we need to use for the RecipientBlindedPathFeePart
  • we need to check that this fee is less than or equal to nodeFee(metadata.recipientPathFees, add.amountMsat) and not just nodeFee(metadata.recipientPathFees, payload.amount) which is higher.

@thomash-acinq thomash-acinq requested a review from t-bast February 24, 2025 15:24
Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, a few test nits and this should be good to go 👍

Copy link
Member

@t-bast t-bast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@thomash-acinq thomash-acinq merged commit 9456236 into master Feb 25, 2025
1 check passed
@thomash-acinq thomash-acinq deleted the fee-less-blinded-route branch February 25, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants