Skip to content

Commit 1197302

Browse files
committed
Consistency: use "reject" everywhere instead of "fail" or "ignore".
And use the explicit name of the thing we are rejecting. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
1 parent 376eedf commit 1197302

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

12-offer-encoding.md

+30-30
Original file line numberDiff line numberDiff line change
@@ -314,12 +314,12 @@ A reader of an offer:
314314
from that estimate.
315315
- if the current time is after `offer_absolute_expiry`:
316316
- MUST NOT respond to the offer.
317-
- if it chooses to send an `invoice_request`, it sends an onion message:
317+
- if it chooses to send an invoice request, it sends an onion message:
318318
- if `offer_paths` is set:
319319
- MUST send the onion message via any path in `offer_paths` to the final `onion_msg_hop`.`blinded_node_id` in that path
320320
- otherwise:
321321
- MUST send the onion message to `offer_issuer_id`
322-
- MAY send more than one `invoice_request` onion message at once.
322+
- MAY send more than one invoice request onion message at once.
323323

324324
## Rationale
325325

@@ -340,7 +340,7 @@ fields.
340340

341341
The `offer_issuer_id` can be omitted for brevity, if `offer_paths` is set, as each of the final `blinded_node_id` in the paths can serve as a valid public key for the destination.
342342

343-
Because `offer_amount` can be in a different currency (using the `offer_currency` field) it is merely a guide: the issuer will convert it into a number of millisatoshis for `invoice_amount` at the time they generate an invoice, or the `invoice_request` can specify the exact amount in `invreq_amount`, but the issuer may then reject it if it disagrees.
343+
Because `offer_amount` can be in a different currency (using the `offer_currency` field) it is merely a guide: the issuer will convert it into a number of millisatoshis for `invoice_amount` at the time they generate an invoice, or the invoice request can specify the exact amount in `invreq_amount`, but the issuer may then reject it if it disagrees.
344344

345345
`offer_quantity_max` is allowed to be 1, which seems useless, but
346346
useful in a system which bases it on available stock. It would be
@@ -363,7 +363,7 @@ message: if it's valid and refers to a known offer, the response is
363363
generally to reply with an `invoice` using the `reply_path` field of
364364
the onion message.
365365

366-
The second case is publishing an `invoice_request` without an offer,
366+
The second case is publishing an invoice request without an offer,
367367
such as via QR code. It contains neither `offer_issuer_id` nor `offer_paths`, setting the
368368
`invreq_payer_id` (and possibly `invreq_paths`) instead, as it in the one paying: the
369369
other offer fields are filled by the creator of the `invoice_request`,
@@ -483,53 +483,53 @@ The writer:
483483
- MUST set `invreq_features`.`features` to the bitmap of features.
484484

485485
The reader:
486-
- MUST fail the request if `invreq_payer_id` or `invreq_metadata` are not present.
487-
- MUST fail the request if any non-signature TLV fields are outside the inclusive ranges: 0 to 159 and 1000000000 to 2999999999
486+
- MUST reject the invoice request if `invreq_payer_id` or `invreq_metadata` are not present.
487+
- MUST reject the invoice request if any non-signature TLV fields are outside the inclusive ranges: 0 to 159 and 1000000000 to 2999999999
488488
- if `invreq_features` contains unknown _odd_ bits that are non-zero:
489489
- MUST ignore the bit.
490490
- if `invreq_features` contains unknown _even_ bits that are non-zero:
491-
- MUST fail the request.
492-
- MUST fail the request if `signature` is not correct as detailed in [Signature Calculation](#signature-calculation) using the `invreq_payer_id`.
491+
- MUST reject the invoice request.
492+
- MUST reject the invoice request if `signature` is not correct as detailed in [Signature Calculation](#signature-calculation) using the `invreq_payer_id`.
493493
- if `num_hops` is 0 in any `blinded_path` in `invreq_paths`:
494-
- MUST fail the request.
494+
- MUST reject the invoice request.
495495
- if `offer_issuer_id` is present, and `invreq_metadata` is identical to a previous `invoice_request`:
496496
- MAY simply reply with the previous invoice.
497497
- otherwise:
498498
- MUST NOT reply with a previous invoice.
499499
- if `offer_issuer_id` or `offer_paths` are present (response to an offer):
500-
- MUST fail the request if the offer fields do not exactly match a valid, unexpired offer.
500+
- MUST reject the invoice request if the offer fields do not exactly match a valid, unexpired offer.
501501
- if `offer_paths` is present:
502502
- MUST ignore the invoice_request if it did not arrive via one of those paths.
503503
- otherwise:
504504
- MUST ignore any invoice_request if it arrived via a blinded path.
505505
- if `offer_quantity_max` is present:
506-
- MUST fail the request if there is no `invreq_quantity` field.
506+
- MUST reject the invoice request if there is no `invreq_quantity` field.
507507
- if `offer_quantity_max` is non-zero:
508-
- MUST fail the request if `invreq_quantity` is zero, OR greater than `offer_quantity_max`.
508+
- MUST reject the invoice request if `invreq_quantity` is zero, OR greater than `offer_quantity_max`.
509509
- otherwise:
510-
- MUST fail the request if there is an `invreq_quantity` field.
510+
- MUST reject the invoice request if there is an `invreq_quantity` field.
511511
- if `offer_amount` is present:
512512
- MUST calculate the *expected amount* using the `offer_amount`:
513513
- if `offer_currency` is not the `invreq_chain` currency, convert to the
514514
`invreq_chain` currency.
515515
- if `invreq_quantity` is present, multiply by `invreq_quantity`.`quantity`.
516516
- if `invreq_amount` is present:
517-
- MUST fail the request if `invreq_amount`.`msat` is less than the *expected amount*.
518-
- MAY fail the request if `invreq_amount`.`msat` greatly exceeds the *expected amount*.
517+
- MUST reject the invoice request if `invreq_amount`.`msat` is less than the *expected amount*.
518+
- MAY reject the invoice request if `invreq_amount`.`msat` greatly exceeds the *expected amount*.
519519
- otherwise (no `offer_amount`):
520-
- MUST fail the request if it does not contain `invreq_amount`.
520+
- MUST reject the invoice request if it does not contain `invreq_amount`.
521521
- SHOULD send an invoice in response using the `onionmsg_tlv` `reply_path`.
522522
- otherwise (no `offer_issuer_id` or `offer_paths`, not a response to our offer):
523-
- MUST fail the request if any of the following are present:
523+
- MUST reject the invoice request if any of the following are present:
524524
- `offer_chains`, `offer_features` or `offer_quantity_max`.
525-
- MUST fail the request if `invreq_amount` is not present.
525+
- MUST reject the invoice request if `invreq_amount` is not present.
526526
- MAY use `offer_amount` (or `offer_currency`) for informational display to user.
527527
- if it sends an invoice in response:
528528
- MUST use `invreq_paths` if present, otherwise MUST use `invreq_payer_id` as the node id to send to.
529529
- if `invreq_chain` is not present:
530-
- MUST fail the request if bitcoin is not a supported chain.
530+
- MUST reject the invoice request if bitcoin is not a supported chain.
531531
- otherwise:
532-
- MUST fail the request if `invreq_chain`.`chain` is not a supported chain.
532+
- MUST reject the invoice request if `invreq_chain`.`chain` is not a supported chain.
533533

534534

535535
## Rationale
@@ -551,7 +551,7 @@ the invoice request amount exceeds the amount it's expecting (i.e. its
551551
`offer_amount` after any currency conversion, multiplied by `invreq_quantity`, if
552552
any).
553553

554-
Non-offer-response `invoice_request`s are currently required to
554+
Non-offer-response invoice requests are currently required to
555555
explicitly state the `invreq_amount` in the chain currency,
556556
so `offer_amount` and `offer_currency` are redundant (but may be
557557
informative for the payer to know how the sender claims
@@ -695,7 +695,7 @@ A writer of an invoice:
695695
the minimal lightning-payable unit (e.g. milli-satoshis for bitcoin) for
696696
`invreq_chain`.
697697
- if the invoice is in response to an `invoice_request`:
698-
- MUST copy all non-signature fields from the `invoice_request` (including unknown fields).
698+
- MUST copy all non-signature fields from the invoice request (including unknown fields).
699699
- if `invreq_amount` is present:
700700
- MUST set `invoice_amount` to `invreq_amount`
701701
- otherwise:
@@ -705,7 +705,7 @@ A writer of an invoice:
705705
- if `offer_issuer_id` is present:
706706
- MUST set `invoice_node_id` to the `offer_issuer_id`
707707
- otherwise, if `offer_paths` is present:
708-
- MUST set `invoice_node_id` to the final `blinded_node_id` on the path it received the `invoice_request`
708+
- MUST set `invoice_node_id` to the final `blinded_node_id` on the path it received the invoice request
709709
- MUST specify exactly one signature TLV element: `signature`.
710710
- MUST set `sig` to the signature using `invoice_node_id` as described in [Signature Calculation](#signature-calculation).
711711
- if it requires multiple parts to pay the invoice:
@@ -734,9 +734,9 @@ A reader of an invoice:
734734
- MUST reject the invoice if `invoice_payment_hash` is not present.
735735
- MUST reject the invoice if `invoice_node_id` is not present.
736736
- if `invreq_chain` is not present:
737-
- MUST fail the request if bitcoin is not a supported chain.
737+
- MUST reject the invoice if bitcoin is not a supported chain.
738738
- otherwise:
739-
- MUST fail the request if `invreq_chain`.`chain` is not a supported chain.
739+
- MUST reject the invoice if `invreq_chain`.`chain` is not a supported chain.
740740
- if `invoice_features` contains unknown _odd_ bits that are non-zero:
741741
- MUST ignore the bit.
742742
- if `invoice_features` contains unknown _even_ bits that are non-zero:
@@ -753,11 +753,11 @@ A reader of an invoice:
753753
- MUST NOT use the corresponding `invoice_paths`.`path` if `payinfo`.`features` has any unknown even bits set.
754754
- MUST reject the invoice if this leaves no usable paths.
755755
- if the invoice is a response to an `invoice_request`:
756-
- MUST reject the invoice if all fields in ranges 0 to 159 and 1000000000 to 2999999999 (inclusive) do not exactly match the `invoice_request`.
756+
- MUST reject the invoice if all fields in ranges 0 to 159 and 1000000000 to 2999999999 (inclusive) do not exactly match the invoice request.
757757
- if `offer_issuer_id` is present (invoice_request for an offer):
758758
- MUST reject the invoice if `invoice_node_id` is not equal to `offer_issuer_id`
759759
- otherwise, if `offer_paths` is present (invoice_request for an offer without id):
760-
- MUST reject the invoice if `invoice_node_id` is not equal to the final `blinded_node_id` it sent the `invoice_request` to.
760+
- MUST reject the invoice if `invoice_node_id` is not equal to the final `blinded_node_id` it sent the invoice request to.
761761
- otherwise (invoice_request without an offer):
762762
- MAY reject the invoice if it cannot confirm that `invoice_node_id` is correct, out-of-band.
763763
- MUST reject the invoice if `signature` is not a valid signature using `invoice_node_id` as described in [Signature Calculation](#signature-calculation).
@@ -777,11 +777,11 @@ A reader of an invoice:
777777
- MUST ignore any `fallback_address` for which `address` is less than 2 or greater than 40 bytes.
778778
- MUST ignore any `fallback_address` for which `address` does not meet known requirements for the given `version`
779779
- if `invreq_paths` is present:
780-
- MUST ignore the invoice if it did not arrive via one of those paths.
780+
- MUST reject the invoice if it did not arrive via one of those paths.
781781
- otherwise, neither `offer_issuer_id` nor `offer_paths` are present (not derived from an offer):
782-
- MUST ignore any invoice if it arrived via a blinded path.
782+
- MUST reject the invoice if it arrived via a blinded path.
783783
- otherwise (derived from an offer):
784-
- MUST ignore the invoice if it did not arrive via invoice request `onionmsg_tlv` `reply_path`.
784+
- MUST reject the invoice if it did not arrive via invoice request `onionmsg_tlv` `reply_path`.
785785

786786
## Rationale
787787

0 commit comments

Comments
 (0)