Update outdated BOLT #11 quotes in invoice handling.
What changed, and why it matters
This commit only updates documentation-style comments and test fixture strings to match the current BOLT #11 specification. It changes how a specification quote is split across comment blocks and updates hard-coded Bech32 invoice strings in unit tests to reflect corrected examples. There is no code behavior change and no security relevance.
No action required; this is a non-functional comment/test-fixture cleanup commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies two files: (1) common/test/run-bolt11.c updates quoted BOLT11 example strings (features bit pattern, signature, and checksum) in a comment block that documents test vectors; (2) lightningd/invoice.c re-formats a BOLT #11 citation comment so the quote crosses a section boundary correctly. No executable logic, parsing, validation, or cryptographic code is changed.
Changed components
common/test/run-bolt11.clightningd/invoice.cInspect captured patch +7 / −5
diff --git a/common/test/run-bolt11.c b/common/test/run-bolt11.c
index fe2b3e2c..b36ae796 100644
--- a/common/test/run-bolt11.c
+++ b/common/test/run-bolt11.c
@@ -407,7 +407,7 @@ int main(int argc, char *argv[])
* * `zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygs`: 0x1111111111111111111111111111111111111111111111111111111111111111
* * `9`: features
* * `q5`: `data_length` (`q` = 0, `5` = 20; 0 * 32 + 20 == 20)
- * * `sqqqqqqqqqqqqqqqpqsq`: b1000....00001000001000000000
+ * * `sqqqqqqqqqqqqqqqqsgq`: b1000....00000100000100000000
* * `2`: unknown field
* * `qr`: `data_length` (`q` = 0, `r` = 3; 0 * 32 + 3 == 3)
* * `qqq`: zeroes
@@ -438,8 +438,8 @@ int main(int argc, char *argv[])
* * `n`: node id
* * `pk`: `data_length` (`p` = 1, `k` = 22; 1 * 32 + 22 == 54) (ignored)
* * `qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq`
- * * `2jxxfsnucm4jf4zwtznpaxphce606fvhvje5x7d4gw7n73994hgs7nteqvenq8a4ml8aqtchv5d9pf7l558889hp4yyrqv6a7zpq9fgp`: signature
- * * `skqhza`: Bech32 checksum
+ * * `z599y53s3ujmcfjp5xrdap68qxymkqphwsexhmhr8wdz5usdzkzrse33chw6dlp3jhuhge9ley7j2ayx36kawe7kmgg8sv5ugdyusdcq`: signature
+ * * `zn8z9x`: Bech32 checksum
*/
extra = tal_arr(b11, struct bolt11_field, 10);
/* Unknown field */
diff --git a/lightningd/invoice.c b/lightningd/invoice.c
index ccb5dfa6..28bc54ce 100644
--- a/lightningd/invoice.c
+++ b/lightningd/invoice.c
@@ -536,7 +536,7 @@ static struct route_info **select_inchan(const tal_t *ctx,
const struct routehint_candidate
*candidates)
{
- /* BOLT11 struct wants an array of arrays (can provide multiple routes) */
+ /* BOLT-11 struct wants an array of arrays (can provide multiple routes) */
struct route_info **r = NULL;
double total_weight = 0.0;
@@ -1221,7 +1221,9 @@ static struct command_result *json_invoice(struct command *cmd,
info->b11->description = tal_steal(info->b11, desc_val);
/* BOLT #11:
* * `h` (23): `data_length` 52. 256-bit description of purpose of payment (SHA256).
- *...
+ */
+ /* BOLT #11:
+ *
* A writer:
*...
* - MUST include either exactly one `d` or exactly one `h` field.
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.