⚡ LNURL-pay bridge for Core Lightning (CLN) nodes using Commando over lnsocket-rs
lnurl-commando-rs is a self-hosted, lightweight HTTP server that exposes LNURL-pay endpoints and generates Lightning invoices through a connected CLN node using Commando and lnsocket.
- Implements
lnurlp(.well-known/lnurlp/{username}) - Dynamically generates BOLT11 invoices via Commando
- Fully async and powered by
hyper,tokio, andlnsocket - Environment-based configuration
- JSON-API ready responses for wallets and LNURL clients
- A GET request to
/.well-known/lnurlp/{username}returns anlnurlpresponse with payment parameters. - A client follows the callback to
/lnurl/callback?amount=...&username=..., triggering invoice creation via Commando. - The invoice is returned as a JSON response.
All invoice generation and Lightning communication happens via a secure, ephemeral connection to the CLN node using lnsocket.
| Variable | Description | Example |
|---|---|---|
SERVICE_DOMAIN |
Public domain (used in metadata/callback) | example.com |
LNURL_MIN_MSAT |
Minimum accepted payment (in msat) | 1000 |
LNURL_MAX_MSAT |
Maximum accepted payment (in msat) | 100000000000 |
LNURL_COMMENT_ALLOWED |
Max comment length (optional) | 140 |
CLN_NODE_ID |
Your CLN node's pubkey | 02abc123... |
CLN_ADDR |
IP:port of CLN node | 1.2.3.4:9735 |
CLN_COMMANDO_RUNE |
Commando Rune for authentication | (see commando-rune) |
BIND_ADDR |
HTTP server bind address | 0.0.0.0:8080 |
curl https://yourdomain.com/.well-known/lnurlp/jb55This returns the initial LNURLp metadata. The wallet then follows up by calling the callback with the payment amount and receives a BOLT11 invoice.
- Proper error handling in
error.rs - Consider rate-limiting or auth for abuse prevention
MIT