From e832784cba705e8db902e2eefcaaac6cea8f603e Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 12 Mar 2025 09:28:08 +1030 Subject: [PATCH] BOLTS: update which fixes BIP353 quotes, missing invreq field in invoices. Signed-off-by: Rusty Russell --- Makefile | 2 +- devtools/bolt12-cli.c | 6 ++++++ plugins/fetchinvoice.c | 4 ---- plugins/offers_invreq_hook.c | 4 ---- wire/extracted_bolt12_00_invoice-add-bip353.patch | 14 -------------- 5 files changed, 7 insertions(+), 23 deletions(-) delete mode 100644 wire/extracted_bolt12_00_invoice-add-bip353.patch diff --git a/Makefile b/Makefile index 77cb5cd6d..6d196f22e 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ CCANDIR := ccan # Where we keep the BOLT RFCs BOLTDIR := ../bolts/ -DEFAULT_BOLTVERSION := 8707471dbc23245fb4d84c5f5babac1197f1583e +DEFAULT_BOLTVERSION := ecf792d87367fb6ff132a0cc7a53193dfb77d001 # Can be overridden on cmdline. BOLTVERSION := $(DEFAULT_BOLTVERSION) diff --git a/devtools/bolt12-cli.c b/devtools/bolt12-cli.c index 1965dfc98..84b7ae951 100644 --- a/devtools/bolt12-cli.c +++ b/devtools/bolt12-cli.c @@ -641,6 +641,12 @@ static u64 get_offer_type(const char *name) * 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: 160 (`invoice_paths`) * 2. data: * * [`...*blinded_path`:`paths`] diff --git a/plugins/fetchinvoice.c b/plugins/fetchinvoice.c index fd912a6a1..c40889763 100644 --- a/plugins/fetchinvoice.c +++ b/plugins/fetchinvoice.c @@ -1228,13 +1228,9 @@ static struct command_result *param_invreq(struct command *cmd, int badf; struct sha256 merkle, sighash; - /* FIXME: quote is garbled, see: https://github.com/lightning/bolts/pull/1222 */ /* BOLT #12: * - 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. diff --git a/plugins/offers_invreq_hook.c b/plugins/offers_invreq_hook.c index be5edbbc9..5cefec997 100644 --- a/plugins/offers_invreq_hook.c +++ b/plugins/offers_invreq_hook.c @@ -1046,16 +1046,12 @@ struct command_result *handle_invoice_request(struct command *cmd, } } - /* FIXME: quote is garbled, see: https://github.com/lightning/bolts/pull/1222 */ /* BOLT #12: * * The reader: *... * - 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. diff --git a/wire/extracted_bolt12_00_invoice-add-bip353.patch b/wire/extracted_bolt12_00_invoice-add-bip353.patch deleted file mode 100644 index 56c298a5e..000000000 --- a/wire/extracted_bolt12_00_invoice-add-bip353.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- wire/bolt12_wire.csv.raw 2025-01-23 16:17:55.387267448 +1030 -+++ wire/bolt12_wire.csv 2025-01-23 16:18:15.515380646 +1030 -@@ -103,6 +103,11 @@ - tlvdata,invoice,invreq_payer_note,note,utf8,... - tlvtype,invoice,invreq_paths,90 - tlvdata,invoice,invreq_paths,paths,blinded_path,... -+tlvtype,invoice,invreq_bip_353_name,91 -+tlvdata,invoice,invreq_bip_353_name,name_len,u8, -+tlvdata,invoice,invreq_bip_353_name,name,byte,name_len -+tlvdata,invoice,invreq_bip_353_name,domain_len,u8, -+tlvdata,invoice,invreq_bip_353_name,domain,byte,domain_len - tlvtype,invoice,invoice_paths,160 - tlvdata,invoice,invoice_paths,paths,blinded_path,... - tlvtype,invoice,invoice_blindedpay,162