A minimal LNurl/Nostr/Zap-receipt server in Rust using SQLite.
- LNURL-pay endpoint with NWC (Nostr Wallet Connect) integration
- NIP-05 endpoint for Nostr identity verification
- NIP-57 (zaps receipts publishing)
- Prisms: Automatic payment splitting to multiple lightning addresses
- Web-based admin dashboard for user management
- Multi-domain support
- Secure authentication system
/lnurlp/:username- LNURL-pay endpoint/.well-known/lnurlp/:username- Well-known LNURL-pay endpoint/.well-known/nostr.json- NIP-05 verification/lnurlp/:username/callback- LNURL-pay callback/lnurlp/:username/verify/:payment_hash- Payment verification
/admin- Admin interface (requires authentication)/admin/login(POST) - Admin authentication/admin/users(GET) - List all users/admin/add(POST) - Add user via admin interface/admin/:username/:domain(DELETE) - Delete user via admin interface/admin/:username/:domain/prism(PUT) - Update prism configuration
The admin dashboard provides a web-based interface for managing users and Lightning addresses.
- Secure password-based authentication using randomly generated admin passwords
- Admin password is generated on server startup and printed to console/logs
- Session-based authentication with HTTP-only cookies
- 24-hour session timeout
- Add Users: Create new users with Lightning addresses
- View Users: List all registered users with their details
- Delete Users: Remove users from the system
- Multi-domain Support: Each user can have different domains
When adding users, you can configure:
- Username (optional): Custom username or auto-generated if not provided
- Domain (required): The domain for the Lightning address (e.g.,
example.com) - Nostr Public Key (optional): For NIP-05 verification support
- Accepts both npub format (
npub1...) and hex format - Enables Nostr identity verification at
username@domain
- Accepts both npub format (
- NWC Connection String (optional): For LNURL-pay functionality
- Nostr Wallet Connect URI (
nostr+walletconnect://...) - Enables Lightning payments to
username@domain - Security Note: Only use read-only connections with
make_invoicepermission only for regular users
- Nostr Wallet Connect URI (
- Prism Configuration (optional): For automatic payment splitting
- Enable prism mode to split received payments
- Requires NWC with
pay_invoicepermission - Configure multiple splits with lightning addresses and percentages
Prisms allow a lightning address to automatically split incoming payments to multiple recipients. When a payment is received by a prism-enabled address, it's automatically forwarded to the configured lightning addresses based on percentage splits.
- Create a Prism User: In the admin panel, check "Enable Prism" when adding a user
- Configure NWC: Provide an NWC connection string with
pay_invoicepermission - Add Splits: Define one or more recipients with their lightning addresses and percentages
- Automatic Forwarding: When the prism receives a payment, it automatically:
- Receives the payment to the prism's NWC wallet
- Calculates split amounts based on percentages
- Pays out each split to the configured lightning addresses
- Keeps any remaining percentage in the prism wallet
- Percentages: Don't need to total 100% - remaining funds stay in the prism wallet
- Minimum Split: Each split must be at least 1 sat (1000 msats)
- Recipients: Use standard lightning addresses (user@domain.com)
- NWC Permission: Requires
pay_invoicepermission (unlike regular users)
- Revenue Sharing: Split podcast payments among hosts
- Automatic Donations: Forward a percentage to charity
- Team Payments: Distribute earnings to team members
- Savings: Keep a percentage while forwarding the rest
pay_invoice permission, which allows the server to send payments. Only use prisms with wallets you control and trust this server with.
- Admin password displayed only on server startup
- NWC connection strings stored securely (for invoice generation only)
- Session-based authentication with automatic expiration
- Input validation for all user data
- CSRF protection through session cookies
At least one of the following must be provided when creating a user:
- Nostr Public Key: Enables NIP-05 verification
- NWC Connection String: Enables LNURL-pay functionality
Both can be provided to enable full Lightning + Nostr functionality.
# Build the project
cargo build
# Run the server
cargo run- Start the server and note the admin password printed to console
- Navigate to
http://localhost:8080/admin - Enter the admin password to access the dashboard
- Use the interface to manage users and Lightning addresses
BIND_ADDRESS- Server bind address (default:127.0.0.1)PORT- Server port (default:8080)DATABASE_URL- Database connection string (default:sqlite:rustress.db)NIP57_PRIVATE_KEY- Private key for signing zap receipts (required for NIP-57)
- Uses SQLite for storage
- Automatic migrations on startup
- Stores users, invoices, and payment metadata