Skip to content

Commit ef77393

Browse files
committed
Include BIP 353 name info in invoice_requests
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`.
1 parent 247e83d commit ef77393

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

12-offer-encoding.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,12 @@ while still allowing signature validation.
437437
1. type: 90 (`invreq_paths`)
438438
2. data:
439439
* [`...*blinded_path`:`paths`]
440+
1. type: 91 (`invreq_bip_353_name`)
441+
2. data:
442+
* [`u8`:`name_len`]
443+
* [`name_len*byte`:`name`]
444+
* [`u8`:`domain_len`]
445+
* [`domain_len*byte`:`domain`]
440446
1. type: 240 (`signature`)
441447
2. data:
442448
* [`bip340sig`:`sig`]
@@ -481,6 +487,10 @@ The writer:
481487
(e.g. milli-satoshis for bitcoin) for `invreq_chain` (or for bitcoin, if there is no `invreq_chain`).
482488
- if it supports bolt12 invoice request features:
483489
- MUST set `invreq_features`.`features` to the bitmap of features.
490+
- if it received the offer from which it constructed this `invoice_request` using BIP 353 resolution:
491+
- MUST include `invreq_bip_353_name` with,
492+
- `name` set to the post-₿, pre-@ part of the BIP 353 HRN,
493+
- `domain` set to the post-@ part of the BIP 353 HRN.
484494

485495
The reader:
486496
- MUST reject the invoice request if `invreq_payer_id` or `invreq_metadata` are not present.

0 commit comments

Comments
 (0)