bolts icon indicating copy to clipboard operation
bolts copied to clipboard

Support async payments in BOLT 12

Open valentinewallace opened this issue 1 year ago • 4 comments

This builds on #989 by adding the ability to fetch an invoice from an always-online node on behalf of an often-offline recipient, e.g. a mobile node.

The idea is that often-offline recipients will supply some always-online node such as their wallet vendor with a static keysend (i.e. payment_hash-less) invoice to return on its behalf. The recipient will then publish an offer containing blinded paths that terminate at this always-online node, who payers can request the invoice from if the recipient is offline at the time. After receiving the keysend invoice, payers will commence the protocol outlined in 1 to send the HTLC asynchronously.

Some context on the top commit where we include the invoice request in the payment onion: This definitely warrants discussion, but the idea is that this field may be useful for often-offline recipients who did not receive the invoice request when it was originally sent. Recipients may want to verify the invreq or be provided some other relevant data about the payment, while keeping the payment stateless until an HTLC is actually received. For example, future extensions have been proposed 2 that require the recipient to know a unique token for a payment, and this field would provide that to them.

Seeking conceptual feedback! I'm also working on the implementation in LDK.

Based on ~#798~ and #989.

valentinewallace avatar Mar 19 '24 17:03 valentinewallace

Changed up the feature bits, required single-chain offers, and disallowed setting invoice_amount_msat for static invoices. Also moved away from the "keysend" language for clarity. These changes were based on implementing this in LDK in https://github.com/lightningdevkit/rust-lightning/pull/3082, will take this out of draft once the design solidifies a bit more in that PR.

valentinewallace avatar Jun 03 '24 17:06 valentinewallace

Added a fixup requiring the invreq to be included in the payment onion per spec meeting discussion a week ago!

valentinewallace avatar Jun 24 '24 20:06 valentinewallace

Rebased after merge of #798 🎉

valentinewallace avatar Oct 25 '24 20:10 valentinewallace