wbobeirne / webln-demo

Demo of WebLN usage for in-browser Lightning payments
7 stars 0 forks source link

Sample static LN invoice has an invalid human-readable part #1

Open brandoncurtis opened 5 years ago

brandoncurtis commented 5 years ago

The sample invoice used in the demo uses the human-readable part "sb": https://github.com/wbobeirne/webln-demo/blob/9af3298a56c89d4de383d3b80f8885a3279368b2/src/App.tsx#L97

This is not a prefix recognized by BIP-173 or SLIP-0173.

This prefix causes an invoice decoding error, yielding this: image

In the medium term it would be ideal to source an invoice from a real node on the same network as the user. In the meantime, for testing purposes, users can generate their own test invoices (e.g. from yalls.org or similar) and insert them in place of the included invoice.

wbobeirne commented 5 years ago

It's actually a valid BOLT-11 payment invoice, the problem is it was generated on a simnet node that I used for demos. That of course only works locally on the simnet, and it only worked once (I had to generate one invoice per demo and paste it in. Hacky stuff for sure.)

You're totally right, that a full-fledged demo of this will require a node running to generate invoices to get payments. Ideally I'd like to expand this demo to have you to open a channel with a WebLN request, send a payment with a WebLN request, and then refund that payment by having the page ask you to generate an invoice via a WebLN request. That way, after you've run through the demo, you'd get your money back (minus channel fees.)