-
Notifications
You must be signed in to change notification settings - Fork 528
BOLT 12: feature to allow requests of a bolt11 invoice. #1336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -452,6 +452,7 @@ while still allowing signature validation. | |
| * [`name_len*byte`:`name`] | ||
| * [`u8`:`domain_len`] | ||
| * [`domain_len*byte`:`domain`] | ||
| 1. type: 92 (`invreq_bolt11`) | ||
| 1. type: 240 (`signature`) | ||
| 2. data: | ||
| * [`bip340sig`:`sig`] | ||
|
|
@@ -480,6 +481,8 @@ The writer: | |
| - MUST set `invreq_quantity` less than or equal to `offer_quantity_max`. | ||
| - otherwise: | ||
| - MUST NOT set `invreq_quantity` | ||
| - if `offer_features` contains `option_bolt11_request`: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Guess these if-else's are a bit difficult to follow😂 Given that, when the offer has
which will be rejected by the reader. So we need to add a writer rule: if |
||
| - MAY set `invreq_bolt11` to request a bolt11 invoice rather than a bolt12. | ||
| - otherwise (not responding to an offer): | ||
| - MUST set `offer_description` to a complete description of the purpose of the payment. | ||
| - MUST set (or not set) `offer_absolute_expiry` and `offer_issuer` as it would for an offer. | ||
|
|
@@ -537,7 +540,14 @@ The reader: | |
| - MAY reject the invoice request if `invreq_amount`.`msat` greatly exceeds the *expected amount*. | ||
| - otherwise (no `offer_amount`): | ||
| - MUST reject the invoice request if it does not contain `invreq_amount`. | ||
| - SHOULD send an invoice in response using the `onionmsg_tlv` `reply_path`. | ||
| - if `invreq_bolt11` is present: | ||
| - if `offer_features` does not contain `option_bolt11_request`: | ||
| - MUST reject the invoice request. | ||
| - if `invreq_quantity` is present: | ||
| - MUST reject the invoice request. | ||
| - SHOULD create a BOLT 11 invoice and place it in the `bolt11_invoice` field of a response `onionmsg_tlv`, sent using the `onionmsg_tlv` `reply_path`. | ||
| - otherwise: | ||
| - SHOULD create an invoice and place it in the `invoice` field of a response `onionmsg_tlv`, sent using the `onionmsg_tlv` `reply_path`. | ||
| - otherwise (no `offer_issuer_id` or `offer_paths`, not a response to our offer): | ||
| - MUST reject the invoice request if any of the following are present: | ||
| - `offer_chains`, `offer_features` or `offer_quantity_max`. | ||
|
|
@@ -580,6 +590,8 @@ informative for the payer to know how the sender claims | |
|
|
||
| The requirement to use `offer_paths` if present, ensures a node does not reveal it is the source of an offer if it is asked directly. Similarly, the requirement that the correct path is used for the offer ensures that cannot be made to reveal that it is the same node that created some other offer. | ||
|
|
||
| The `option_bolt11_request` field allows a backwards-compatible mechanism for simple offers, to simplify transition. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we missed the part to bind the bolt11 invoice. For a bolt12 invoice there's a cryptographic binding, but for bolt11 invoice there is no proof that it is coming from the offer? Like the payer cannot prove it corresponds to the exact request or offer version. |
||
|
|
||
| # Invoices | ||
|
|
||
| Invoices are a payment request, and when the payment is made, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: