-
Notifications
You must be signed in to change notification settings - Fork 407
Include a PaymentContext
in PaymentPurpose
#2970
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
7e085c5
Refactor handling of InvoiceRequest
jkczyz e239c92
Refactor handling of Bolt12Invoice
jkczyz 01814dc
Implement Eq and Hash for Bolt12Invoice
jkczyz 12c3a24
Return the invoice when requesting a refund
jkczyz c881538
Add PaymentContext to payment::ReceiveTlvs
jkczyz 9be364f
Pass PaymentContext through HTLC processing
jkczyz b9970ff
Define an OfferId for BOLT 12 Offers
jkczyz ac6d4cb
Include OfferId in VerifiedInvoiceRequest
jkczyz 48d9245
Include Offer context in blinded payment paths
jkczyz 09ce1b5
Include Refund context in blinded payment paths
jkczyz e74f243
Rename InvoicePayment to Bolt11InvoicePayment
jkczyz ef3ec8f
Add PaymentPurpose::is_keysend utility method
jkczyz 54ca54d
BOLT 12 variants of PaymentPurpose
jkczyz 0c52ea2
Use BOLT 12 PaymentPurpose variants
jkczyz b06b2c7
Test for PaymentContext in offers_tests.rs
jkczyz 8367e02
Include InvoiceRequest fields in PaymentContext
jkczyz 478911d
Update PaymentPurpose's payment_preimage docs
jkczyz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be an enum? If its only going to be a BOLT12 thing it seems like overkill, though if we ever end up with a BOLT13 we'd need it? Or is it also intended to have a refund variant and that's why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, possibly for refunds and future / alternative payment protocols / extensions. Hard to say for sure, but could need a
Bolt12Subscription
, for instance. Maybe static invoices (for offline receive) unless we are able to obtain a sender-includedInvoiceRequest
for use here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't that just be repeated payments for the same
OfferId
?I believe the current thinking is the
InvoiceRequest
will be copied into the HTLC onion.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's certainly possible. But who knows what the spec will ultimately look like. In general, it seems better to allow expanding the number of variants than adding increasingly more
Option
fields for future uses. The latter may require the user to figure out how to interpret it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, hard to balance future uses at the serialization layer vs complexifying the API today for it. I wonder if we can't make the API simpler (ie expose just a struct) but at the serialization layer do something smarter?