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.

760

Step by step

  1. Client scan LNURL QR or pastes lightning:LNURL... link
  2. Client decodes the LNURL
  3. Client calls the endpoint on the decoded LNURL to get the invoice requirements.
  4. If the amount is not set, the client asks for the amount from the user.
  5. Client calls the callback endpoint on the invoice requirements with the specified amount to get the Lightning invoice.
  6. 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.

758

Step by step

  1. Client scan LNURL QR or pastes lightning:LNURL... link
  2. Client decodes the LNURL
  3. Client calls the endpoint on the decoded LNURL to get the invoice requirements.
  4. If the amount is not set, the client asks for the amount from the user.
  5. Client calls the Pay to an LNURL endpoint on IBEXHub.
  6. 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.