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 without invoice
- 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.
How conveniently LNURL-Auth works is shown by the example of Lightninglogin.live
On the Lightninglogin.live website, you can try out the registration via LNURL-Auth yourself.
When you are on the website, you get a message that you can log in via Lightning.
You are shown a QR code that you can scan with a Lightning wallet that supports LNURL-Auth, such as Breez and Phoenix.
You can find an overview of all Lightning Wallets that support LNURL-Auth in the article Lightning Wallet.
After you have scanned the QR code, you are logged in and will be shown a unique user ID.
You did not have to enter any personal data or email addresses.
If you want to log in to your account again, you use the same Lightning Wallet again and are logged in again.
As a user, you identify yourself exclusively via your public key and nothing else. No password, no email address, no username or anything like that.
There is also no forwarding of information to other websites. You can open an account on any other website that uses LNURL-Auth with the same Lightning Wallet and log in again and again.
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.
For a Lightning payment, the payee creates a Lightning Invoice. The Lightning Invoice is transmitted to the payer and contains all relevant information to route the payment through the Lightning network and allocate it at the payee.
In a Lightning payment, 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.
But how can you make a Lightning payment if the payee does not create a Lightning invoice beforehand? For example, if you want to receive donations on your website and want the donor to send a few sats quickly.
With the help of LNURL-Pay the process is reversed.
The payee does not issue an invoice, but the payer sends the payee a request to issue an invoice.
The recipient of the payment sends a reply, where the payer can then add the amount and a comment.
Thus, a Lightning payment can be received in the real world. 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.
Lnurl-Pay is also used to send Lightning payments to an email address. If you use a Lightning wallet that supports LNURL pay, you can enter a Lightning address email in the field where the LNURL address is stored. Use from me the address Onleines@lntxbot.com and send me a sats if you want to try it.
If you use the lntxbot Telegram wallet yourself, then you also have such an email address, which is composed of Telegram-Username@lntxbot.com.
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
|Bitcoin Lightning Wallet (BLW)||X||X||X||X|
|Wallet of Satoshi||X||X|