Skip to content

Commit 815080b

Browse files
committed
11+12: add optional accountable field in invoices
The recipient of a payment is ultimately responsible for the fast resolution of a payment (though intermediate node can, of course, slow it down). We add a signal from the final recipient that the sender can use to reason about the amount of time it should take to resolve.
1 parent 2b9c73b commit 815080b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

11-payment-encoding.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ Currently defined tagged fields are:
158158
* `9` (5): `data_length` variable. One or more 5-bit values containing features
159159
supported or required for receiving this payment.
160160
See [Feature Bits](#feature-bits).
161+
* `a` (31): `data_length` 0. A marker field that indicates whether the recipient is willing to be held accountable for the timely resolution of the invoice upon HTLC(s) receipt.
161162

162163
### Requirements
163164

@@ -203,6 +204,10 @@ A writer:
203204
- MUST pad field data to a multiple of 5 bits, using 0s.
204205
- if a writer offers more than one of any field type, it:
205206
- MUST specify the most-preferred field first, followed by less-preferred fields, in order.
207+
- if the invoice will be resolved within 90 seconds of HTLC(s) arrival:
208+
- SHOULD include a single `a` field
209+
- otherwise:
210+
- MUST NOT include an `a` field
206211

207212
A reader:
208213
- MUST skip over unknown fields, OR an `f` field with unknown `version`, OR `p`, `h` or
@@ -270,6 +275,11 @@ The `r` field allows limited routing assistance: as specified, it only
270275
allows minimum information to use private channels, however, it could also
271276
assist in future partial-knowledge routing.
272277

278+
The `a` field indicates that the recipient is willing to be held
279+
accountable for the timely resolution of the invoice. In the absence
280+
of this field, the reader should assume that there are no guarantees
281+
from the writer about resolution time.
282+
273283
### Security Considerations for Payment Descriptions
274284

275285
Payment descriptions are user-defined and provide a potential avenue for

12-offer-encoding.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ the `onion_message` `invoice` field.
644644
* [`name_len*byte`:`name`]
645645
* [`u8`:`domain_len`]
646646
* [`domain_len*byte`:`domain`]
647+
1. type: 93 (`accountable`)
647648
1. type: 160 (`invoice_paths`)
648649
2. data:
649650
* [`...*blinded_path`:`paths`]
@@ -745,6 +746,10 @@ A writer of an invoice:
745746
- MUST include `invoice_blindedpay` with exactly one `blinded_payinfo` for each `blinded_path` in `paths`, in order.
746747
- MUST set `features` in each `blinded_payinfo` to match `encrypted_data_tlv`.`allowed_features` (or empty, if no `allowed_features`).
747748
- SHOULD ignore any payment which does not use one of the paths.
749+
- if the invoice will be resolved within 90 seconds of HTLC(s) arrival:
750+
- SHOULD set `accountable`.
751+
- otherwise:
752+
- MUST NOT set `accountable`.
748753

749754
A reader of an invoice:
750755
- MUST reject the invoice if `invoice_amount` is not present.

0 commit comments

Comments
 (0)