Skip to content

Validate payment secret when decoding#1840

Merged
t-bast merged 4 commits intomasterfrom
payment-secret-refactor
Jun 11, 2021
Merged

Validate payment secret when decoding#1840
t-bast merged 4 commits intomasterfrom
payment-secret-refactor

Conversation

@t-bast
Copy link
Copy Markdown
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
t-bast added 2 commits June 10, 2021 16:47
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