Description
As explained in the Lightning Invoices Flow, you need an invoice every time you want to make a payment. The LNURL-pay protocol automates the process of requesting an invoice and agreeing on the amount.
The idea is that a wallet can scan a static QR code or click on a static LNURL address and get back details about the expected payment. Once the user accepts the terms, the wallet will call the service and get a Lightning invoice specific to that payment.
Flow for clients without IBEXHub account
This is the regular flow of the LNURL-withdraw protocol. This is how to be used when the client doesn't use IBEXHub.
Step by step
- Client scan LNURL QR or pastes lightning:LNURL... link
- Client decodes the LNURL
- Client calls the endpoint on the decoded LNURL to get the invoice requirements.
- If the amount is not set, the client asks for the amount from the user.
- Client calls the callback endpoint on the invoice requirements with the specified amount to get the Lightning invoice.
- Pay the invoice
Flow for clients with IBEXHub account
This is the flow for LNURL-pay using IBEXHub, the client has an IBEXHub account where the funds are going to be debited.
Step by step
- Client scan LNURL QR or pastes lightning:LNURL... link
- Client decodes the LNURL
- Client calls the endpoint on the decoded LNURL to get the invoice requirements.
- If the amount is not set, the client asks for the amount from the user.
- Client calls the Pay to an LNURL endpoint on IBEXHub.
- IBEXHub tries to pay the invoice and sends the response back.
For more information, please refer to the official spec https://github.com/lnurl/luds/blob/luds/06.md.