Skip to content

Commit f0b8544

Browse files
dongcarlendothermicdev
authored andcommitted
doc: Correct createinvoice's invstring description
The existing description is incorrect. `createinvoice` doesn't actually work when supplied with a custom-encoded bolt11 invoice without the final 520 signature bits appended. If a users tries to do so, some of their tagged fields will be incorrectly truncated. `createinvoice` actually expects that the signatures are there, and it simply ignores them. See common/bolt11.c's bolt11_decode_nosig: /* BOLT #11: * * The data part of a Lightning invoice consists of multiple sections: * * 1. `timestamp`: seconds-since-1970 (35 bits, big-endian) * 1. zero or more tagged parts * 1. `signature`: Bitcoin-style signature of above (520 bits) */ if (!pull_uint(&hu5, &data, &data_len, &b11->timestamp, 35)) return decode_fail(b11, fail, "Can't get 35-bit timestamp"); > while (data_len > 520 / 5) { const char *problem = NULL; u64 type, data_length;
1 parent 8369ca7 commit f0b8544

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/lightning-createinvoice.7.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ DESCRIPTION
1212
The **createinvoice** RPC command signs and saves an invoice into the
1313
database.
1414

15-
The *invstring* parameter is of bolt11 form, but without the final
16-
signature appended. Minimal sanity checks are done. (Note: if
15+
The *invstring* parameter is of bolt11 form, but the final signature
16+
is ignored. Minimal sanity checks are done. (Note: if
1717
**experimental-offers** is enabled, *invstring* can actually be an
1818
unsigned bolt12 invoice).
1919

0 commit comments

Comments
 (0)