What is LNURL?
LNURL is a set of open standards built on top of the Lightning Network. Rather than exposing raw Lightning invoices or node pubkeys directly in your app, LNURL defines human-friendly URL-based protocols that wallets know how to handle. When a wallet scans a LNURL QR code, it decodes a URL, fetches a JSON response from your server, and then takes the appropriate action (signing a challenge, fetching a pay request, etc.) — all invisibly to the user. l402-kit ships with two LNURL features out of the box:
Both protocols work across all major Lightning wallets (Phoenix, Blink, Zeus, Breez, Alby) and require no additional dependencies — your server only needs to serve a JSON endpoint and optionally verify a secp256k1 signature.
LNURL-auth — passwordless login
l402-kit.com uses LNURL-auth for the payment dashboard. You can use the same flow in your own app.How it works
Endpoint
TypeScript — verify LNURL-auth signature
LNURL-auth requires no email, no password, no OAuth. The user’s identity is their Lightning pubkey — portable across wallets, uncensorable, globally unique.
LNURL-pay — Lightning Address
A Lightning Address (you@domain.com) is a human-readable alias that resolves to a LNURL-pay endpoint. l402-kit exposes one at:
ownerAddress: "you@blink.sv", the Worker resolves blink.sv/.well-known/lnurlp/you to get a BOLT11 invoice.
How to set up your own Lightning Address
- Deploy a LNURL-pay endpoint at
https://yourdomain.com/.well-known/lnurlp/{username} - Return the standard LNURL-pay metadata response:
- The
callbackendpoint receives?amount=<msats>and returns:
Self-hosted with BTCPay Server
BTCPay Server ships with LNURL-pay built in — just enable it in your store settings. Your Lightning Address becomesyou@yourbtcpay.com.
Ownership verification for the API directory
When you register your API atPOST /api/register, l402-kit automatically checks for a /.well-known/l402.txt file at your API’s domain. If found and it contains your Lightning Address, your listing gets a verified badge.
Create the file: