Skip to content

Commit 2347f2c

Browse files
committed
Add invreq_payer_bip_353_signature field
When including a BIP 353 HRN, we also require including a signature of the `invoice_request` using one of the keys from the offer stored in the BIP 353 DNS record.
1 parent b37d046 commit 2347f2c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

blip-0042.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@ to allow contacts to pay them back:
6060
- [`u8`:`domain_len`]
6161
- [`domain_len*byte`:`domain`]
6262

63+
The `invreq_payer_bip_353_signature` field lets payers provide a signature of
64+
the `invoice_request` using one of the signing keys of the offer associated
65+
with their BIP 353 name, thus proving ownership of this BIP 353 name.
66+
67+
1. type: 2000001735 (`invreq_payer_bip_353_signature`)
68+
2. data:
69+
- [`point`:`offer_signing_key`]
70+
- [`bip340sig`:`signature`]
71+
6372
#### Requirements
6473

6574
The writer of `invoice_request`:
@@ -80,6 +89,12 @@ The writer of `invoice_request`:
8089
- If it includes `invreq_payer_bip_353_name`:
8190
- MUST set `name` to the post-₿, pre-@ part of the BIP 353 HRN.
8291
- MUST set `domain` to the post-@ part of the BIP 353 HRN.
92+
- MUST include `invreq_payer_bip_353_signature` using the private key of
93+
its `offer_issuer_id` or, if its offer doesn't include `offer_issuer_id`,
94+
the private key of the `blinded_node_id` of one of its `offer_paths`.
95+
The signed data should be computed as detailed in [Bolt 12][bolt12-sig],
96+
with "lightning" || "invoice_request" || "invreq_payer_bip_353_signature"
97+
as signature tag.
8398
- If it includes `invreq_payer_offer`:
8499
- MUST encode `payer_offer` as a TLV stream of its individual records.
85100
- If the encoded offer is more than 300 bytes long:
@@ -91,6 +106,9 @@ The writer of `invoice_request`:
91106

92107
The reader of `invoice_request`:
93108

109+
- If `invreq_bip_353_name` is provided:
110+
- MUST ignore the `invoice_request` if `invreq_payer_bip_353_signature` is
111+
missing or invalid.
94112
- MUST send back an `invoice` including the `invoice_request` contact fields
95113
provided by the sender, as specified in Bolt 12.
96114
- After the invoice has been paid, if `invreq_contact_secret` was included:
@@ -104,6 +122,8 @@ The reader of `invoice_request`:
104122
- MUST use the received `payer_offer` whenever paying that contact.
105123
- If `payer_bip_353_name` was included:
106124
- SHOULD use it to fetch a `payer_offer` if none was included.
125+
- MUST verify that the received offer matches the `offer_signing_key`
126+
provided in `invreq_payer_bip_353_signature`.
107127
- SHOULD use it to refresh the `payer_offer` if it expires.
108128
- MAY use it to refresh the `payer_offer` periodically.
109129
- MAY manually associate the received `contact_secret` with an existing
@@ -125,6 +145,11 @@ large, which would constrain the payment paths that can be used by the payer.
125145
We thus recommend only including offers that are smaller than 300 bytes in
126146
`invreq_payer_offer`, or a small BIP 353 HRN.
127147

148+
When a BIP 353 HRN is included, the node receiving `invoice_request` does not
149+
know whether it really belongs to the sender. This is why the sender must also
150+
include a signature that proves that they control one of the private keys of
151+
the offer stored in the BIP 353 record.
152+
128153
When payments are coming from known contacts, there is less risk that the
129154
`payer_note` that is optionally included contains spam. It is thus recommended
130155
to display it, while we generally don't recommend displaying `payer_note`s
@@ -259,3 +284,5 @@ section.
259284

260285
- lightning-kmp: <https://github.com/ACINQ/lightning-kmp/pull/719>
261286
- phoenix wallet: <https://github.com/ACINQ/phoenix/pull/645>
287+
288+
[bolt12-sig]: https://github.com/lightning/bolts/blob/master/12-offer-encoding.md#signature-calculation

0 commit comments

Comments
 (0)