Skip to main content

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

The user’s identity is their Lightning node pubkey — stable, global, and self-sovereign.

Endpoint

Returns a LNURL challenge. Encode as a QR and display in your login flow.
After the wallet callback, verify via:

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:
This is used internally by the split mechanism — when you set 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

  1. Deploy a LNURL-pay endpoint at https://yourdomain.com/.well-known/lnurlp/{username}
  2. Return the standard LNURL-pay metadata response:
  1. The callback endpoint 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 becomes you@yourbtcpay.com.

Ownership verification for the API directory

When you register your API at POST /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:
Then register:
Verified APIs rank higher in the directory and display a ✓ badge.

Compatible wallets