joule-extension
joule-extension copied to clipboard
[WIP] Add support for LNURL pay requests
Description
This adds a new prompt for LNURL pay requests. This is currently very experimental and this PR is opened to serve as a potential starting point around implementing LNURL features.
LNURL
https://github.com/btcontract/lnurl-rfc
LNURL is a bech32-encoded HTTPS/Onion query string which is supposed to help payer interact with payee and thus simplify a number of standard scenarios such as:
- Requesting incoming channels (LNURL-channel)
- Logging in (LNURL-auth)
- Withdrawing funds (LNURL-withdraw)
- Paying for a service (LNURL-pay)
ToDos
- [ ] add support for success actions
- [ ] validate payment request amount as described in the lnurl spec
- [ ] validate payment request description hash as described in the lnurl spec
- [ ] refactor all the things :)
- [ ] specify UX for the different LNURL scenarios
Discussion
- Support for LNURL requests should be added to webln?
Screenshots
experimenting on the flow:
https://vimeo.com/448816127
This is an awesome start, thanks for being the first to look at LNURL in Joule!
My initial thoughts on the code is that it looks good, but there's quite a bit of overlap between this and prompts/payment.tsx, and it would be good to share more code between the two. Though perhaps this is what you had in mind for the refactor all the things :)
TODO.
Looking forward to seeing where this one goes!
Is this error expected from Joule with LNURL-withdraw currently?
The payment request that was provided could not be looked up due to the following error: invoice not for current active network 'mainnet'
@githorray this PR so far only supports the LNURL-pay flow. And there are no checks to validate the lnurl response.
LNURL-withdraw is the next step. Can you maybe help with that?
this is great! why was this never completed? Especially LNURL-Auth would be great to push a whole range of web-app authentications