Skip to content

v0.0.29

Choose a tag to compare

@github-actions github-actions released this 09 Jul 21:48
4397aad

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.proto and documented in proto/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.example documents all supported settings — copy to .env or 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_SATS and ROUTING_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 with DISABLE_LIQUIDITY_PROVIDER=true; testing-only USE_ONLY_LIQUIDITY_PROVIDER.
  • Swaps (off by default): set ENABLE_SWAPS=true and optionally BOLTZ_HTTP_URL / BOLTZ_WEBSOCKET_URL (defaults to Zeus LSP; Boltz.exchange alt URLs also supported).
  • LNURL / Lightning Address: requires SERVICE_URL pointing to a reachable HTTPS reverse proxy; otherwise LNURL is disabled (wallets may still use BRIDGE_URL).
  • Security: WATCHDOG_MAX_DIFF_SATS (default 0) monitors LND vs user-balance drift; DISABLE_EXTERNAL_PAYMENTS enables 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_BPS and OUTBOUND_MAX_FEE_EXTRA_SATS are 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 (or DATABASE_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=true is 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 k1 debouncing 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 install when deploying from source.
  • Buf breaking check: no proto compatibility issues detected (first release).