-
Notifications
You must be signed in to change notification settings - Fork 339
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
Include a PaymentContext
in PaymentPurpose
#2970
Commits on Apr 15, 2024
-
Refactor handling of InvoiceRequest
In order to generate and InvoiceSent event, it would be cleaner to have one location where a Bolt12Invoice is successfully generated. Refactor the handling code to this end and clean-up line length by making some of the type conversions more streamlined.
Configuration menu - View commit details
-
Copy full SHA for 7e085c5 - Browse repository at this point
Copy the full SHA 7e085c5View commit details -
Refactor handling of Bolt12Invoice
In order to provide an InvoiceGenerated event, it would be cleaner to have one location where a Bolt12Invoice is successfully created. Refactor the handling code to this end and clean-up line length by making some of the type conversions more streamlined.
Configuration menu - View commit details
-
Copy full SHA for e239c92 - Browse repository at this point
Copy the full SHA e239c92View commit details -
Implement Eq and Hash for Bolt12Invoice
Bolt12Invoice will be added to a new Event::InvoiceGenerated variant. These traits along with PartialEq are required to be implemented for any type used in an Event.
Configuration menu - View commit details
-
Copy full SHA for 01814dc - Browse repository at this point
Copy the full SHA 01814dcView commit details
Commits on Apr 18, 2024
-
Return the invoice when requesting a refund
When sending an invoice for a refund, information from the invoice may be useful for caller. For instance, the payment_hash can be used to track whether the refund was paid. Return the invoice to facilitate this use case.
Configuration menu - View commit details
-
Copy full SHA for 12c3a24 - Browse repository at this point
Copy the full SHA 12c3a24View commit details -
Add PaymentContext to payment::ReceiveTlvs
Providing LDK-specific data in a BlindedPath allows for the data to be received with the corresponding payment. This is useful as it can then be surfaced in PaymentClaimable events where the user may correlated with an Offer, for instance. Define a PaymentContext enum for including various context (e.g., offer, refund, static invoice).
Configuration menu - View commit details
-
Copy full SHA for c881538 - Browse repository at this point
Copy the full SHA c881538View commit details -
Pass PaymentContext through HTLC processing
PendingInboundPayment::BlindedReceive includes a PaymentContext, which the recipient includes in each blinded path. Included this when processing HTLCs in ChannelManager, first into PendingHTLCRouting and then to OnionPayload. Later, this will be included in the PaymentPurpose when surfaced to user in PaymentClaimable and PaymentClaimed events.
Configuration menu - View commit details
-
Copy full SHA for 9be364f - Browse repository at this point
Copy the full SHA 9be364fView commit details -
Define an OfferId for BOLT 12 Offers
Use a merkle root hash of the offer TLV records to define an offer id. Will be included in a BOLT 12 invoice's blinded payment paths in order for the recipient to identify which offer the payment is for.
Configuration menu - View commit details
-
Copy full SHA for b9970ff - Browse repository at this point
Copy the full SHA b9970ffView commit details -
Include OfferId in VerifiedInvoiceRequest
Extract the OfferId from the offer metadata sent back in the InvoiceRequest and include it in VerifiedInvoiceRequest. This can be used to correspond the eventual payment for the invoice response by including it in the invoice's blinded payment paths.
Configuration menu - View commit details
-
Copy full SHA for ac6d4cb - Browse repository at this point
Copy the full SHA ac6d4cbView commit details -
Include Offer context in blinded payment paths
When constructing blinded payment paths for a Bolt12Invoice response, include the OfferId so that the eventual payment can be correlated with the Offer.
Configuration menu - View commit details
-
Copy full SHA for 48d9245 - Browse repository at this point
Copy the full SHA 48d9245View commit details -
Include Refund context in blinded payment paths
When requesting a payment for a refund, include a context in the Bolt12Invoice's blinded payment paths indicated it is for such. When the eventual payment is received, the user can use the payment hash to correlate it with the corresponding Refund.
Configuration menu - View commit details
-
Copy full SHA for 09ce1b5 - Browse repository at this point
Copy the full SHA 09ce1b5View commit details -
Rename InvoicePayment to Bolt11InvoicePayment
PaymentPurpose will be expanded to include BOLT 12 payment context. Rename the InvoicePayment variant accordinly before new variants are added.
Configuration menu - View commit details
-
Copy full SHA for e74f243 - Browse repository at this point
Copy the full SHA e74f243View commit details -
Configuration menu - View commit details
-
Copy full SHA for ef3ec8f - Browse repository at this point
Copy the full SHA ef3ec8fView commit details -
BOLT 12 variants of PaymentPurpose
In order to provide more context in PaymentClaimable and PaymentClaimed events, introduce new variants of PaymentPurpose for use with BOLT 12 payments. Separate variants are used for offers and refunds. An unknown variant is used for backwards compatibility and ease of testing, but is otherwise not publicly constructable.
Configuration menu - View commit details
-
Copy full SHA for 54ca54d - Browse repository at this point
Copy the full SHA 54ca54dView commit details -
Use BOLT 12 PaymentPurpose variants
When constructing a PaymentPurpose in ChannelManager, use the PaymentContext from OnionPayload to determine which variant to construct, including those for BOLT 12 payments.
Configuration menu - View commit details
-
Copy full SHA for 0c52ea2 - Browse repository at this point
Copy the full SHA 0c52ea2View commit details -
Configuration menu - View commit details
-
Copy full SHA for b06b2c7 - Browse repository at this point
Copy the full SHA b06b2c7View commit details -
Include InvoiceRequest fields in PaymentContext
When receiving a payment, it's useful to know information about the InvoiceRequest. Include this data in PaymentContext::Bolt12Offer so users can display information about an inbound payment (e.g., the payer note).
Configuration menu - View commit details
-
Copy full SHA for 8367e02 - Browse repository at this point
Copy the full SHA 8367e02View commit details -
Update PaymentPurpose's payment_preimage docs
Clarify that payment_preimage should only be used to claim a payment when handling Event::PaymentClaimable, not Event::PaymentClaimed.
Configuration menu - View commit details
-
Copy full SHA for 478911d - Browse repository at this point
Copy the full SHA 478911dView commit details