Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate payment secret when decoding #1840

Merged
merged 4 commits into from
Jun 11, 2021
Merged

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Jun 8, 2021

The payment_secret feature was made mandatory in #1810 and is the default in other implementations as well. We can thus force it to be available when decoding onion payloads, which simplifies downstream components (no need to handle the case where a payment_secret may be missing anymore).

I kept it optional in PaymentRequest, otherwise all the spec test vectors would be considered invalid. We may want to update the spec test vectors once all implementations have turned on mandatory support for payment secrets and then make it a non-optional field in PaymentRequest.

The `payment_secret` feature was made mandatory in #1810 and is the default
in other implementations as well. We can thus force it to be available when
decoding onion payloads, which simplifies downstream components (no need
to handle the case where a `payment_secret` may be missing anymore).
@t-bast t-bast requested a review from pm47 June 8, 2021 13:00
The `NodeRelay` actors are indexed by `payment_secret`, which ensures we
will never send a mismatching `payment_secret`.
It's confusing to end with `Request` because `PaymentRequest` usually
refers to Bolt 11 invoices.

We now explicitly namespace these requests to distinguish between the
PaymentInitiator and the PaymentLifecycle ones.
@t-bast t-bast merged commit bbfbad5 into master Jun 11, 2021
@t-bast t-bast deleted the payment-secret-refactor branch June 11, 2021 16:11
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