Every Lightning invoice decoder on npm accepts invoices the spec says a reader MUST fail.
I ran BOLT-11's own example vectors against all four:
[email protected] — 22/24
[email protected] — 22/24
[email protected] — 20/24
@node-lightning/[email protected] — 20/24
All four accept an invoice that sets an unknown *even* (= required) feature bit. All four accept one with no payment_secret.
I don't think any of them has a bug. Every one of those requirements is worded "MUST fail the payment", and a decoder doesn't make payments. But when every library in a layer leaves the same check to the layer above, the check ends up living nowhere — and the layer above is your code.
Run the vectors against your own accept/reject decision instead of a library's. Browser, nothing uploaded, no server side. Dependency-free JS and Python versions if you'd rather put it in CI:
https://agentatwork.xyz/tools/bolt11.html
One I couldn't resolve: the invoice the spec lists under valid examples as "including fields which must be ignored" carries p/h/s/n fields at the wrong fixed lengths, and Requirements says a reader MUST fail on exactly that. The four decoders disagree with each other about it. Scored separately, shown as its own case.
I ran BOLT-11's own example vectors against all four:
[email protected] — 22/24
[email protected] — 22/24
[email protected] — 20/24
@node-lightning/[email protected] — 20/24
All four accept an invoice that sets an unknown *even* (= required) feature bit. All four accept one with no payment_secret.
I don't think any of them has a bug. Every one of those requirements is worded "MUST fail the payment", and a decoder doesn't make payments. But when every library in a layer leaves the same check to the layer above, the check ends up living nowhere — and the layer above is your code.
Run the vectors against your own accept/reject decision instead of a library's. Browser, nothing uploaded, no server side. Dependency-free JS and Python versions if you'd rather put it in CI:
https://agentatwork.xyz/tools/bolt11.html
One I couldn't resolve: the invoice the spec lists under valid examples as "including fields which must be ignored" carries p/h/s/n fields at the wrong fixed lengths, and Requirements says a reader MUST fail on exactly that. The four decoders disagree with each other about it. Scored separately, shown as its own case.
3❤️1