← All guides

Lightning guide

Your own address, your own domain

A Lightning address looks like an email address. It can carry your domain while the payments still land in the wallet you already use — and you can change wallets without changing the address.

What a Lightning address really is

An address such as yourname@getalby.com is not an inbox. It is a name that a wallet turns into a URL, fetches, and reads a small JSON document from. For an address name@domain.tld the URL is always the same shape:

https://domain.tld/.well-known/lnurlp/name

Ask for that URL and the wallet answers with a pay request: the smallest and largest amounts it will take, a line of text describing who is being paid, and a callback — the address a wallet calls, with an amount, to get an actual invoice. Here is a live answer from Minibits, abbreviated, with the handle replaced by yourname. Alby and Wallet of Satoshi answer in the same shape, with their own values listed further down:

{
  "callback": "https://minibits.cash/.well-known/lnurlp/yourname",
  "minSendable": 1000,
  "maxSendable": 1000000000,
  "metadata": "[[\"text/plain\",\"Pay to yourname@minibits.cash with Lightning.\"],[\"text/identifier\",\"yourname@minibits.cash\"]],"
  "commentAllowed": 100,
  "allowsNostr": true,
  "tag": "payRequest"
}

Amounts are in millisatoshis, so minSendable 1000 is one sat and maxSendable 1000000000 is one million sats.

The address is a pointer, and nothing else. Whoever serves that one URL decides where the money goes. That is the whole trick: the name can be yours while the URL is answered by your wallet — or by a copy of your wallet's answer that sits on your own server.

Why bother

You need two things: a domain you control, and a wallet that already gives you a Lightning address. Nothing here moves funds by itself — you are only choosing who answers the question "where do I pay this name".

Method 1: keep a copy of your wallet's answer

This works on any host, including ones that only serve files and cannot run code. You take the JSON your wallet serves for its own address and place it under your domain, under the name you want to hand out.

  1. Give the domain something to answer with. If it already serves a site, skip this. If not, point it at the host that will hold the file — for GitHub Pages that is four A records on the apex, or a CNAME on a subdomain, plus the lowest TTL your DNS provider allows:
    185.199.108.153
    185.199.109.153
    185.199.110.153
    185.199.111.153
    Propagation can take minutes or hours, and nothing below works until it has. Enter the domain under the repository's Settings → Pages, and switch on Enforce HTTPS once the certificate is issued.
  2. In a browser, open your wallet's own pay request. Replace yourname with your own name on that service:
    https://getalby.com/.well-known/lnurlp/yourname        # Alby
    https://walletofsatoshi.com/.well-known/lnurlp/yourname  # Wallet of Satoshi
    https://minibits.cash/.well-known/lnurlp/yourname        # Minibits
  3. Save that JSON as a plain text file named after the address you want to give out, with no extension. Using two@example.com as the example, the file is named two.
  4. Put it at .well-known/lnurlp/two in the folder or repository your domain serves from, so the file is reachable at https://example.com/.well-known/lnurlp/two.
  5. If the host builds the site with a static generator, tell it to publish the folder — a top-level dot in .well-known means many generators skip it by default. For Jekyll, a _config.yml in the root with these two lines is enough:
    include:
      - .well-known
  6. Serve it over HTTPS, and check the file came out unchanged — a saved copy that lost its quoting is a broken address.

The reason this works is that the callback inside the JSON is a full address on the wallet's own domain. When someone pays two@example.com, their wallet reads your file, sees the callback, and asks the wallet directly for the invoice. Your host never handles a payment.

Method 2: redirect from your web server

If you have a server, a redirect is usually the better version: nothing is copied, so nothing goes stale. Your host answers the request by pointing the wallet at the provider, which answers as it always does.

nginx

Add this inside the server block for the domain — for example in /etc/nginx/sites-available/example.com:

server {
    location = /.well-known/lnurlp/two {
        return 302 https://getalby.com/.well-known/lnurlp/yourname;
        add_header Access-Control-Allow-Origin "*";
    }
}

The target is whichever wallet you use; all three are listed further down. Then reload nginx:

sudo nginx -t && sudo systemctl reload nginx

Apache

In a virtual host, or in the .htaccess in the domain's root where overrides are allowed:

Redirect 302 /.well-known/lnurlp/two https://getalby.com/.well-known/lnurlp/yourname

<If "%{REQUEST_URI} =~ m#^/.well-known/lnurlp/#">
    Header always set Access-Control-Allow-Origin "*"
</If>

The <If> block is the part worth keeping: it grants the cross-origin read only under lnurlp, so the rest of the site is not opened up to every origin that asks. Reload Apache after the change.

Two details in that configuration are not decoration:

On any other server the job is the same two things: one route that answers /.well-known/lnurlp/two with a redirect to the wallet's endpoint, and permission for another origin to read it. How each server spells that is in its own documentation.

Three wallets, one shape

The wallet only has to answer one URL. Alby, Wallet of Satoshi and Minibits all do, and the differences between them are small enough to list. Each of these was fetched and read while this page was written — the field names below are the ones you will see in your own file.

Alby

Addresses look like name@getalby.com, and the pay request sits at https://getalby.com/.well-known/lnurlp/name. The callback stays on the same domain, and the answer also carries payerData describing which sender details are welcome, so a client can ask for a name or an email before paying.

Endpoint
https://getalby.com/.well-known/lnurlp/yourname
Range
1 sat to 10,000,000 sats, read from an account that accepts payments
Comments
Up to 255 characters
Zaps
allowsNostr true with a nostrPubkey
Callback
https://getalby.com/lnurlp/yourname/callback — same domain, so a saved copy works

Wallet of Satoshi

Addresses look like name@walletofsatoshi.com, at https://walletofsatoshi.com/.well-known/lnurlp/name. There is one thing here worth understanding rather than copying blindly: the callback does not stay on walletofsatoshi.com. It points at livingroomofsatoshi.com with a long account identifier in the path — a different host, run by the same service.

That is legal and it works, and it is exactly why the copy method means copy the whole answer, never reconstruct it. Rebuild it from what you remember and you will write the wrong host, and the address will answer with a pay request that cannot produce an invoice.

Endpoint
https://walletofsatoshi.com/.well-known/lnurlp/yourname
Range
1 sat to 100,000,000 sats per payment
Comments
Up to 255 characters
Zaps
allowsNostr true with a nostrPubkey
Callback
Absolute, on livingroomofsatoshi.com with a per-account id — copy it as it comes

Minibits

Addresses look like name@minibits.cash, at https://minibits.cash/.well-known/lnurlp/name. Minibits is an ecash wallet, so a payment arrives over Lightning and lands as ecash — the address is the front door, not the wallet. Its callback is the same path it was fetched from, which is the simplest case of the three.

Endpoint
https://minibits.cash/.well-known/lnurlp/yourname
Range
1 sat to 1,000,000 sats per payment
Comments
Up to 100 characters
Zaps
allowsNostr true with a nostrPubkey
Callback
Same path on minibits.cash, so a saved copy works

Two cautions about those numbers. They belong to the account, not to the wallet: a different name on the same service can allow a different range, and an account that has not been set up to receive reports maxSendable: 0, which means nobody can pay it. Read the numbers from your own endpoint before quoting them to anyone. And all three answer with Access-Control-Allow-Origin: * when a browser asks, which is what lets a web client read them at all.

The same redirect, once per wallet

For Method 2, the only line that changes is the target. Use one of these; whichever wallet you pick, the address handed out stays two@example.com:

# Alby
location /.well-known/lnurlp/two { return 302 https://getalby.com/.well-known/lnurlp/yourname; }

# Wallet of Satoshi
location /.well-known/lnurlp/two { return 302 https://walletofsatoshi.com/.well-known/lnurlp/yourname; }

# Minibits
location /.well-known/lnurlp/two { return 302 https://minibits.cash/.well-known/lnurlp/yourname; }

With a file instead of a server, the same three sources are where you copy the JSON from — https://getalby.com/.well-known/lnurlp/yourname, https://walletofsatoshi.com/.well-known/lnurlp/yourname, or https://minibits.cash/.well-known/lnurlp/yourname. Save whichever your wallet served, whole and unedited, as .well-known/lnurlp/two.

Check it before you hand it out

  1. Fetch your own address from outside your head:
    curl -s https://example.com/.well-known/lnurlp/two
  2. Read the metadata line. It should name the wallet account that will actually receive the money. If it names someone else, the copy or the redirect points at the wrong endpoint.
  3. Check the status and the type. curl -sI should show 200 for a file, or 302 for a redirect. For the redirect, follow it once and confirm the JSON comes back:
    curl -sL https://example.com/.well-known/lnurlp/two | head -c 200
  4. Pay it. Send the smallest amount your wallet allows to two@example.com and confirm it appears in the wallet. Keep an eye on which name the invoice describes — that is where the money goes.
  5. Try it in one browser-based client as well as one app. That is the only way to catch a missing CORS header before a stranger does.

What tends to break

Where this comes from: the address-to-URL rule is LUD-16, and the shape of a pay request is LUD-06. The shape of this guide follows a guide on orangepill.dev, which is no longer served by its site and is readable only in the archive; the steps are rewritten here and the wallet details re-checked. Wallets mentioned: Alby, Wallet of Satoshi and Minibits. The field values on this page were fetched from a live endpoint while writing it; if a wallet changes its answer, the method still holds and the numbers may not.