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:
parent
e8efd2c12d
commit
5d69269e3e
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user