LNURL are advanced features and applications that go beyond just payment processing for Lightning Wallets.
LNURL is a protocol for communication between Lightning wallets and external applications and third-party services.
These functions can be:
- LNURL-withdraw – Pick up payments
- LNURL-auth – Authorize, register and log in to external services and applications.
- LNURL-pay – payment for a service
- LNURL channel – connect to incoming channels
With the help of LNURL, a simplified interaction between the payer and the payee is possible.
In the following article, the possible functions are briefly presented and should thus be an incentive for developers to realize their own applications based on Lightning.
A service provider generates a bech32 encoded https call using a simple http-JSON command that starts with LNURL and is displayed as an encrypted QR code to the user.
If the user uses a Lightning Wallet that supports LNURL, he can easily scan the QR code and use the corresponding function.
If a payee wishes to receive a Lightning payment, an invoice must be created and sent to the payer.
If a user has a claim to receive a payment, an invoice must first be created by the payee without an LNURL. The latter then sends this payment request (invoice) incl. amount and reason for payment to the payer and waits for receipt of payment.
The process can be made more user-friendly if the payer creates this payment request for the payee.
This is useful when a user wants to withdraw his balance.
A typical example of use is a balance on a wallet that is to be withdrawn. For example, to transfer it to another wallet.
Likewise, the user may have earned credit through activities, which are now to be paid out.
The user will be shown a QR code, which will be scanned with the LNURL suitable Lightning Wallet and the amount will be credited to the wallet.
For demonstration purposes, faucet sites are suitable, where you can get a few Satoshi for free.
In the past, you could get some Satoshi for free at https://lightning-faucet.com.
Under Withdraw, the Lightning credit was then requested.
This can be done by sending a Lightning invoice or via LNURL widdraw:
If this faucet has sufficient funds, you can pick up some Satoshi for free.
Another option is per: https://paywall.link/to/26d69d/web
If Lightning credit is available, you will see the following page.
Another use case would be the payout of Lightning credits at exchanges, gaming sites or affiliate programs.
Scan the QR code with the Receive or Withdraw function of your Lightning Wallet and get some Satoshi for testing purposes.
LNURL-Auth can be used to authorize, register or log in to external services and websites. The advantage for the user is that no personal information has to be disclosed.
An example of use can be found in the registration with the service lapps.
You create an invoice in the amount of one Satoshi using your own node and enter the word Lapps in the purpose field.
The creation of the invoice is for authorization purposes only and no payment of the invoice will be made.
The invoice generated in this way, for example:
is entered in the “Lightning Payment Request” field.
After that you can optionally enter a username and the email.
The invoice is the login when you want to log in again.
Those who operate their own Lightning Node thus have a unique Lightning Node ID.
This Lightning Node ID does not have any personal information and can be used as a credential via LNURL-Auth.
Thus, each person can prove his access authorization with the help of a Lightning node. Thus, no email / password combination or social media account is required.
The Lightning node ID is the username. The proof that one is the owner of this node can be proved by 1 Satoshi transaction.
Thus, the service provider does not obtain any personal data of the user. He only knows that you are the authorized person, but not who you are.
On the page https://test.etleneum.com/#/account access can be authorized via lnurl login.
This application works only with Lightning wallets that support LNURL-Auth.
The QR code can be scanned or the address can be taken by clicking on the QR code “Copy address of link” and paste it into a LNURL enabled Lightning Wallet.
For example, into the lntxbot wallet.
After posting the link to the bot, you are logged into Etleneu in the same second.
On the Bitcoiners.best site, the login via LNURL is then as follows:
LNURL Login at https://bitcoiners.best/login
With Lightning, static invoices cannot be created via QR code.
Because with Lightning, each payment consists of a combination of hash and preimage. This serves as proof of payment and to secure the payment path via the payment channels involved.
Thus, no static QR code can be printed on its website or on an invoice to receive payments. Each invoice must be created individually and specifically for the one payment.
Accordingly, the recipient of the payment creates an invoice and sends it to the payer.
However, with the help of LNURL-pay, the process can be reversed.
The payee does not issue an invoice, but the payer sends the payee a request to issue an invoice.
With LNURL-Pay, it is so that the user is shown a QR code, which creates an https get request.
The payer’s Lightning Wallet requests payment metadata via the QR code.
The server then creates an invoice with the correct amount and purpose and sends this information to the wallet. These details are then displayed in the wallet and the payer can make the payment.
Thus, payments can be realized with a smartphone wallet and real-world devices and services.
This static QR code can be printed on invoices, affixed to a store window, or placed next to products on a menu.
The busker can place a sign with the static QR code next to him and the donor can then decide in the app what he wants to donate.
If the own node is running on a phone or behind a firewall, there is no public IP address and thus another node cannot connect directly. But this is necessary if someone wants to open a channel to you. This can be solved by opening a channel yourself beforehand.
Per lnurl-channel this process is automated. You scan a QR code, then your wallet automatically connects to the node and waits for the node to open a channel to you.
Lightning Wallets with LNURL support
The following Lightning Wallets support LNURL or functions of LNURL