Skip to content

Commit

Permalink
Include BIP 353 name info in invoice_requests
Browse files Browse the repository at this point in the history
BIP 353 defines a method for resolving Human Readable Names (in the
form ₿`name`@`domain`) into bitcoin: URIs. In order to use them with
BOLT 12 with a wildcard DNS entry which resolves to a single
BOLT 12 offer for all `name`s in a domain, we need a way to
disambiguate the `name` being paid in an `invoice_request` which we
provide here by simply copying the HRN into the `invoice_request`.
  • Loading branch information
TheBlueMatt committed Oct 21, 2024
1 parent 247e83d commit 89b99a5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions 12-offer-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,12 @@ while still allowing signature validation.
1. type: 90 (`invreq_paths`)
2. data:
* [`...*blinded_path`:`paths`]
1. type: 91 (`invreq_bip_353_name`)
2. data:
* [`u8`:`name_len`]
* [`name_len*byte`:`name`]
* [`u8`:`domain_len`]
* [`domain_len*byte`:`domain`]
1. type: 240 (`signature`)
2. data:
* [`bip340sig`:`sig`]
Expand Down Expand Up @@ -481,6 +487,10 @@ The writer:
(e.g. milli-satoshis for bitcoin) for `invreq_chain` (or for bitcoin, if there is no `invreq_chain`).
- if it supports bolt12 invoice request features:
- MUST set `invreq_features`.`features` to the bitmap of features.
- if it received the offer from which it constructed this `invoice_request` using BIP 353 resolution:
- MUST include `invreq_bip_353_name` with,
- `name` set to the post-₿, pre-@ part of the BIP 353 HRN,
- `domain` set to the post-@ part of the BIP 353 HRN.

The reader:
- MUST reject the invoice request if `invreq_payer_id` or `invreq_metadata` are not present.
Expand Down Expand Up @@ -528,6 +538,9 @@ The reader:
- MUST use `invreq_paths` if present, otherwise MUST use `invreq_payer_id` as the node id to send to.
- if `invreq_chain` is not present:
- MUST reject the invoice request if bitcoin is not a supported chain.
- if `invreq_bip_353_name` is present:
- MUST reject the invoice request if `name` or `domain` contain any bytes which are not
`0`-`9`, `a`-`z`, `A`-`Z`, `-`, `_` or `.`.
- otherwise:
- MUST reject the invoice request if `invreq_chain`.`chain` is not a supported chain.

Expand Down

0 comments on commit 89b99a5

Please sign in to comment.