1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

Require repeating an invoice_request in async payment onions

This field may be useful for often-offline recipients who did not receive the
invreq when it was originally sent, due to another node providing a static
invoice on their behalf. Recipients may want to verify the invreq or be
provided some other relevant data about the payment while remaining stateless
until an HTLC is actually received.
This commit is contained in:
Valentine Wallace 2024-03-15 13:24:04 -04:00
parent e8efd2c12d
commit 5d69269e3e
No known key found for this signature in database
GPG Key ID: FD3E106A2CE099B4

View File

@ -189,6 +189,9 @@ This is formatted according to the Type-Length-Value format defined in [BOLT #1]
1. `tlv_stream`: `payload`
2. types:
1. type: 1 (`invoice_request`)
2. data:
* [`...*byte`:`invoice_request_tlv_stream`]
1. type: 2 (`amt_to_forward`)
2. data:
* [`tu64`:`amt_to_forward`]
@ -243,8 +246,10 @@ The requirements ensure consistency in responding to an unexpected
`outgoing_cltv_value`, whether it is the final node or not, to avoid
leaking its position in the route.
`sender_provided_payment_preimage` is set in the case that the recipient is
often-offline and another node provided a static BOLT 12 invoice on their behalf.
`sender_provided_payment_preimage` and `invoice_request` are set in the case
that the recipient is often-offline and another node provided a static BOLT 12
invoice on their behalf, where `invoice_request` is the sender's originl
invoice request corresponding to this HTLC.
### Requirements
@ -283,6 +288,8 @@ The writer of the TLV `payload`:
- MUST set `sender_provided_payment_preimage` to randomly generated unique bytes.
- MUST set `update_add_htlc.payment_hash` to match the SHA256 hash of
`sender_provided_payment_preimage`.
- MUST set `invoice_request` to the BOLT 12 invoice request
corresponding to this HTLC.
- otherwise:
- MUST NOT set `sender_provided_payment_preimage`.
- MUST NOT include any other tlv field.