Skip to content

Commit f2a747b

Browse files
committed
resolve p field ambiguity and add signature disclaimer
1 parent 011bf84 commit f2a747b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

11-payment-encoding.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ A writer:
211211
A reader:
212212
- MUST skip over unknown fields, OR an `f` field with unknown `version`, OR `p`, `h` or
213213
`n` fields that do NOT have `data_length`s of 52, 52 or 53, respectively.
214+
- MUST fail the payment if a mandatory field (`p` or `s`) was skipped due to an incorrect
215+
length.
216+
- MUST fail the payment if a `d` field is not present and a `h` field was skipped due to an
217+
incorrect length.
214218
- if the `9` field contains unknown _odd_ bits that are non-zero:
215219
- MUST ignore the bit.
216220
- if the `9` field contains unknown _even_ bits that are non-zero:
@@ -368,6 +372,7 @@ https://github.com/rustyrussell/lightning-payencode
368372

369373
NB: all the following examples are signed with `priv_key`=`e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734`.
370374
All invoices contain a `payment_secret`=`1111111111111111111111111111111111111111111111111111111111111111` unless otherwise noted.
375+
Signatures are deterministic and generated using RFC6979 (using HMAC-SHA256). Note that even though using a `low R` would save 1 byte in the DER-encoded signature (by avoiding the need for a leading zero byte when the most significant bit is set), it is not enforced in this specification.
371376

372377
> ### Please make a donation of any amount using payment_hash 0001020304050607080900010203040506070809000102030405060708090102 to me @03e7156ae33b0a208d0744199163177e909e80176e55d97a2f221ede0f934dd9ad
373378
> lnbc1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdpl2pkx2ctnv5sxxmmwwd5kgetjypeh2ursdae8g6twvus8g6rfwvs8qun0dfjkxaq9qrsgq357wnc5r2ueh7ck6q93dj32dlqnls087fxdwk8qakdyafkq3yap9us6v52vjjsrvywa6rt52cm9r9zqt8r2t7mlcwspyetp5h2tztugp9lfyql

0 commit comments

Comments
 (0)