Skip to content

jb55/lnurl-commando-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lnurl-commando-rs

⚡ 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.

Features

  • Implements lnurlp (.well-known/lnurlp/{username})
  • Dynamically generates BOLT11 invoices via Commando
  • Fully async and powered by hyper, tokio, and lnsocket
  • Environment-based configuration
  • JSON-API ready responses for wallets and LNURL clients

How it Works

  1. A GET request to /.well-known/lnurlp/{username} returns an lnurlp response with payment parameters.
  2. A client follows the callback to /lnurl/callback?amount=...&username=..., triggering invoice creation via Commando.
  3. 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.

Environment Configuration

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

Example Usage

curl https://yourdomain.com/.well-known/lnurlp/jb55

This returns the initial LNURLp metadata. The wallet then follows up by calling the callback with the payment amount and receives a BOLT11 invoice.

Dependencies

TODO

  • Proper error handling in error.rs
  • Consider rate-limiting or auth for abuse prevention

License

MIT

About

An lnurl server powered by commando and lnsocket-rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published