Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bolt11 test vector with amount in `p` units #699

Open
wants to merge 1 commit into
base: master
from

Conversation

@Sword-Smith
Copy link

Sword-Smith commented Nov 13, 2019

This addresses #692. But as part of #692 people have also requested that the RFC is changed such that it is specified that any amount with the pico-multiplier MUST be divisible by 10. This request is addressed in PR #700 .
+
+Breakdown:
+
+* lnbc: prefix, Lightning on bitcoin mainnet
+* 9678785340p: amount (9678785340 pico-bitcoin = 967878534 milli satoshi)
+* 1: Bech32 separator
+* pwmna7l: timestamp (1572468703)
+* p: payment hash...
+* d: short description

    • 8d: data_length (8 = 7, d = 13; 7 * 32 + 13 == 237)
    • gfkx7cmtwd68yetpd5s9xar0wfjn5gpc8qhrsdfq24f5ggrxdaezqsnvda3kkum5wfjkzmfqf3jkgem9wgsyuctwdus9xgrcyqcjcgpzgfskx6eqf9hzqnteypzxz7fzypfhg6trddjhygrcyqezcgpzfysywmm5ypxxjemgw3hxjmn8yptk7untd9hxwg3q2d6xjcmtv4ezq7pqxgsxzmnyyqcjqmt0wfjjq6t5v4khx: 'Blockstream Store: 88.85 USD for Blockstream Ledger Nano S x 1, "Back In My Day" Sticker x 2, "I Got Lightning Working" Sticker x 2 and 1 more items'
      +* x: expiry time
    • qy: data_length (q = 0, y = 2; 0 * 32 + 4 == 4)
    • jw5q: 604800 seconds (j = 18, w = 14, 5 = 20, q = 0; 18 * 32^3 + 14 * 32^2 + 20 * 32 + 0 == 604800)
      +* r: tagged field: route information
    • zj: data_length (z = 2, j = 18; 2 * 32 + 18 == 82)
      +* s4x9qlmd57lq7wwr23n3a6pkayy3jpfucyptlncs2maswe3dnnjy3ce2cgrvykmxlfpvn6ptqfqz4df5uaulvd4hjkckuqxrqqkz8jgp: signature
      +* hputwh: Bech32 checksum

Please send $30 for coffee beans to the same peer, which supports features 1 and 9

lnbc25m1pvjluezpp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5vdhkven9v5sxyetpdees9qzsze992adudgku8p05pstl6zh7av6rx2f297pv89gu5q93a0hf3g7lynl3xq56t23dpvah6u7y9qey9lccrdml3gaqwc6nxsl5ktzm464sq73t7cl

@Sword-Smith Sword-Smith force-pushed the Sword-Smith:master branch 2 times, most recently from 1fb0897 to a7811b5 Nov 13, 2019
@Sword-Smith

This comment has been minimized.

Copy link
Author

Sword-Smith commented Nov 13, 2019

The error reported is some sort of alleged spelling error. But both words are correctly spelled.

"Misspelled words in 11-payment-encoding.md: Blockstream USD Blockstream"

@t-bast

This comment has been minimized.

Copy link
Collaborator

t-bast commented Nov 14, 2019

The error reported is some sort of alleged spelling error.

You need to update the spellchecker dictionary (.aspell.en.pws) to add new unknown words (in your case USB / Blockstream).

This addresses #692.
@Sword-Smith Sword-Smith force-pushed the Sword-Smith:master branch from a7811b5 to 8b5ac44 Nov 14, 2019
@Sword-Smith

This comment has been minimized.

Copy link
Author

Sword-Smith commented Nov 14, 2019

The error reported is some sort of alleged spelling error.

You need to update the spellchecker dictionary (.aspell.en.pws) to add new unknown words (in your case USB / Blockstream).

Commit has been updated with these additional changes.

@t-bast

This comment has been minimized.

Copy link
Collaborator

t-bast commented Nov 14, 2019

Thanks, I'll test this vector as soon as I have a bit of time ;)

@Sword-Smith

This comment has been minimized.

Copy link
Author

Sword-Smith commented Dec 2, 2019

How's it looking with your time, @t-bast? :)

@t-bast

This comment has been minimized.

Copy link
Collaborator

t-bast commented Dec 2, 2019

I'm sorry, I'm really swamped right now with Trampoline work...
But I'll find a bit of time this week to test this (so that it's tested before next monday's meeting).

@t-bast

This comment has been minimized.

Copy link
Collaborator

t-bast commented Dec 3, 2019

Sorry for the wait, thanks for your patience!
It looks like the test vector wasn't signed with the test private key (see https://github.com/lightningnetwork/lightning-rfc/blob/master/11-payment-encoding.md#examples).
We make all test vectors with a reference private key (e126f68f7eafcc8b74f54d269fe206be715000f94dac067d1c04a8ca3b2db734) so that test suites can sign and verify that they generate the exact same invoice when using the same parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
3 participants
You can’t perform that action at this time.