Skip to content

Commit 5d69269

Browse files
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.
1 parent e8efd2c commit 5d69269

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

04-onion-routing.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ This is formatted according to the Type-Length-Value format defined in [BOLT #1]
189189

190190
1. `tlv_stream`: `payload`
191191
2. types:
192+
1. type: 1 (`invoice_request`)
193+
2. data:
194+
* [`...*byte`:`invoice_request_tlv_stream`]
192195
1. type: 2 (`amt_to_forward`)
193196
2. data:
194197
* [`tu64`:`amt_to_forward`]
@@ -243,8 +246,10 @@ The requirements ensure consistency in responding to an unexpected
243246
`outgoing_cltv_value`, whether it is the final node or not, to avoid
244247
leaking its position in the route.
245248

246-
`sender_provided_payment_preimage` is set in the case that the recipient is
247-
often-offline and another node provided a static BOLT 12 invoice on their behalf.
249+
`sender_provided_payment_preimage` and `invoice_request` are set in the case
250+
that the recipient is often-offline and another node provided a static BOLT 12
251+
invoice on their behalf, where `invoice_request` is the sender's originl
252+
invoice request corresponding to this HTLC.
248253

249254
### Requirements
250255

@@ -283,6 +288,8 @@ The writer of the TLV `payload`:
283288
- MUST set `sender_provided_payment_preimage` to randomly generated unique bytes.
284289
- MUST set `update_add_htlc.payment_hash` to match the SHA256 hash of
285290
`sender_provided_payment_preimage`.
291+
- MUST set `invoice_request` to the BOLT 12 invoice request
292+
corresponding to this HTLC.
286293
- otherwise:
287294
- MUST NOT set `sender_provided_payment_preimage`.
288295
- MUST NOT include any other tlv field.

0 commit comments

Comments
 (0)