v0.0.29
Lightning.Pub v0.0.29
First tagged release of Lightning.Pub — a Nostr-native Lightning account system and LND wrapper for operators serving users over Nostr and optional LNURL.
API
- Full HTTP and Nostr RPC surface is defined in
proto/service/methods.protoand documented inproto/autogenerated/client.md. - Admin: LND info/channels/peers, assets & liabilities, invite links, invoice swaps (
/api/admin/swap/invoice/*), transaction swaps (/api/admin/swap/transaction/*), and metrics/reporting endpoints. - User: invoices, payments, on-chain addresses, CLINK offers, debit/manage authorizations, LNURL links, transaction swap quotes/list, and live operation streams.
- App: application and app-user management, internal payments, and LNURL pay info.
- Guest: health, LNURL pay/withdraw/address handlers, and npub linking.
- Metrics: usage/bundle/LND reports, provider disruption, WebRTC upgrade, and storage reset/zip.
- Most authenticated methods support Nostr transport in addition to HTTP POST/GET.
- Validation hardening: negative amounts are rejected; offer price, debit authorization, and swap quote validation are stricter; private-route invoices are blocked where applicable.
Configuration
- New
env.exampledocuments all supported settings — copy to.envor set as environment variables. - LND:
LND_ADDRESS,LND_CERT_PATH,LND_MACAROON_PATH,BTC_NETWORK(defaults assume Linux mainnet paths). - Fees:
SERVICE_FEE_BPS/SERVICE_FEE_FLOOR_SATSandROUTING_FEE_LIMIT_BPS/ROUTING_FEE_FLOOR_SATS; routing fee limit must be ≤ service fee (validated at startup). - Bootstrap liquidity provider:
PROVIDER_NPROFILE(pubkey + relay); disable withDISABLE_LIQUIDITY_PROVIDER=true; testing-onlyUSE_ONLY_LIQUIDITY_PROVIDER. - Swaps (off by default): set
ENABLE_SWAPS=trueand optionallyBOLTZ_HTTP_URL/BOLTZ_WEBSOCKET_URL(defaults to Zeus LSP; Boltz.exchange alt URLs also supported). - LNURL / Lightning Address: requires
SERVICE_URLpointing to a reachable HTTPS reverse proxy; otherwise LNURL is disabled (wallets may still useBRIDGE_URL). - Security:
WATCHDOG_MAX_DIFF_SATS(default 0) monitors LND vs user-balance drift;DISABLE_EXTERNAL_PAYMENTSenables honeypot mode. - Other:
NOSTR_RELAYS,PORT(default 1776),ADMIN_TOKEN,METRICS_TOKEN,SHOCK_PUSH_URL, LSP URLs/thresholds,SKIP_SANITY_CHECK,RECORD_PERFORMANCE. - Legacy env names
OUTGOING_INVOICE_FEE_USER_BPSandOUTBOUND_MAX_FEE_EXTRA_SATSare still accepted as fallbacks.
Migration
- Fresh install: SQLite schema (
db.sqlite) and metrics DB (metrics.sqlite) are created automatically; 40+ data migrations and 8 metrics migrations run on first startup. - Existing install: migrations apply automatically on startup — back up
DATA_DIR(orDATABASE_FILE/METRICS_DATABASE_FILE) before upgrading. - New tables/columns cover liquidity providers, user offers, debit/manage grants, invoice callbacks, admin settings, swap state (invoice + on-chain tx swaps with refund info), and root-operation pending tracking.
ALLOW_BALANCE_MIGRATION=trueis a dev-only flag for balance migration; leave unset in production.- No manual migration steps required; review logs for executed migration counts after restart.
Operator notes
- NIP-57 zap receipt handling and liquidity-provider pending-payment recovery are improved.
- LNURL withdraw
k1debouncing and callback URL SSRF checks may reject previously tolerated callback URLs — verify user callback endpoints are reachable and not blocked. - Internal user-to-user and swap-related transactions are now atomic; service fees are included in debit rule validation.
- Dependency updates (axios, lodash, and others) — run
npm installwhen deploying from source. - Buf breaking check: no proto compatibility issues detected (first release).