ungovernable.tech

[ DEEP DIVE ][ FINANCIAL SOVEREIGNTY ]

LNbits

Also LNbits Merchant Stack, LNbits Extensions, Lightning Accounts System.

Lightning Network Deep Dive covers the network; Accepting Bitcoin In Person is the operational guide built on this stack.

Usable updated 2026-11-24 9 min read
Contents

Lightning Network Deep Dive covers the network; Accepting Bitcoin In Person is the operational guide built on this stack. This note is about LNbits itself: what it is, what it is not, the extension model, the funding-source model, the merchant stack, and the security incident of November 2026 that every operator should know about.

Summary

LNbits is a lightweight Python (MIT-licensed, lnbits/lnbits since December 2019) server that sits on top of a Lightning funding source — your LND or Core Lightning node, phoenixd, a Breez SDK wallet, or a custodial service — and adds three things the funding source does not give you:

  1. An accounts system. Every LNbits wallet is a separate accounting bucket with its own invoice and payment API keys. An app you hand a wallet key can never touch your full balance, because it never sees it — the keys authorize operations against one wallet's internal balance, not the node.
  2. An HTTP API and LNURL machinery. One API shape for create-invoice / pay-invoice / LNURL-pay / LNURL-withdraw, identical across backends, so applications do not care what node implementation is underneath.
  3. An extension system. The core ships minimal (LNURLp, TPoS, Withdraw, Paywall, SatsPay, Boltz swaps, NWC Provider, Watch Only, Split Payments, Scrub, TipJar, Decoder); everything else — point of sale hardware, Bolt Cards, FOSSA ATMs, offline shops, Nostr integrations — installs as an extension from the registry (60+ extensions per the docs index; v1.6.0 added sandboxed WASM extensions so third-party code runs without the vetting overhead of in-process extensions).
Question Answer
Does LNbits hold keys? No. It holds credentials to a funding source (macaroons, runes, API keys). Custody = wherever the funding source keeps its keys.
Is it custodial? You choose: point it at your own node (self-custody) or at OpenNode/Alby/Blink/ZBD/Strike/LNPay (custodial, and per the backend comparison those require KYC).
What can it do for a merchant? The Merchant Stack: TPoS checkout, shared Inventory, Orders/receipts, WebShop, Tabs, offline LNURL shops, hardware PoS, on-chain watch-only acceptance, even OTC bitcoin selling. See Accepting Bitcoin In Person.
Version as of 2026-11-24 v1.7.1 (2026-11-11) — a security patch on top of the v1.7.0 urgent security update. Anything older must be assumed compromised-able; see §Security incident.

The funding-source model

The backend comparison page tabulates 21 funding sources, and the table is really a custody-and-privacy decision tree:

  • Local nodes (self-custody, full features): LND REST or gRPC, Core Lightning via CLNRest (built into CLN since v23.08) or RPC rune, Eclair, Spark.
  • Self-custody without a node: phoenixd (ACINQ's server daemon, automatic channel management, minimal fees), Breez SDK (embedded), Boltz (swap-service backend).
  • Custodial services: OpenNode, Alby, Blink, ZBD, Strike, LNPay — easy setup, low privacy, KYC required, transaction fees.
  • Chaining: an LNbits instance can itself be another instance's funding source.
  • Testing: FakeWallet (invoices auto-pay) and VoidWallet (rejects everything) for development.

Two properties of the model matter more than the list:

  1. Balances are internal accounting. LNbits wallet balances are rows in LNbits's own database; the actual satoshis live on the funding source. Switching backends does not transfer balances — the docs warn that if the old node held the funds and the new one holds nothing, users will hold balances they cannot spend. Migration is a manual, operator-managed affair.
  2. Feature support varies by backend. The comparison's feature matrix shows hold invoices — the primitive Bitcoin Contracts and Escrow builds escrow on — as LND: yes, CLN: some, everything else: no. Node and channel management exist only on LND and CLN. Keyset/keysend support varies. Pick the backend for the primitives your application needs, not the other way round.

LNbits v1.7.0 added an on-chain wallet funding type (PR #4194), BOLT12 offer payments (#4169), NIP-17 support (#4260), TOTP two-factor authentication (#4203), a job scheduler and automatic extension updates — closing several of the gaps earlier versions were criticised for.

What it is not

  • Not a custody product. The project's own post-incident guidance states it flatly: "LNbits is a hot wallet. Hot wallets carry risk as the credentials needed to spend funds are available to an online system… Always assume that any online system can be compromised." An LNbits deployment inherits the threat model of whatever box and funding source it runs on.
  • Not anonymous infrastructure by default. A public LNbits instance (legend.lnbits.com, or a SaaS tenant) sees every invoice, memo, wallet balance and payment of the wallets it hosts; the hosted services backends additionally impose KYC. Privacy comes from self-hosting on your own node, which the comparison rates "high" against the services' "low".
  • Not a replacement for a full e-commerce stack. It has WebShop and SatsPay payment pages, but anything beyond (stock-weight shipping, tax engines beyond simple VAT fields) belongs in a real shop system integrated via the API or webhooks (v1.7.0 added outgoing payment webhooks).

Security incident, November 2026

The release history is the sharpest evidence about operational risk this project offers. A vulnerability was discovered on 2026-11-08; the project's advisory says versions prior to 1.7.0 are affected and "funds running on prior versions of LNbits are at risk of being stolen". v1.7.0 (2026-11-10) shipped the fix plus hardening across authentication, extension management and payment handling; v1.7.1 (2026-11-11) rotated auth keys. Full exploit details were promised in a later report.

The advisory's recovery steps are worth reproducing as a checklist, because they generalise to any hot Lightning infrastructure:

  1. Prefer a fresh server. "Updating alone cannot remove access an attacker may already have gained" — rebuild on a new machine, preserve logs first.
  2. Rotate all user keys (Super Admin → Settings → Users → Reset Wallet Keys); connected apps must be re-keyed.
  3. Replace funding-source credentials — rotate node macaroons/runes or service API keys, then update LNbits settings.
  4. Rotate every other secret stored in settings, treating them all as compromised.
  5. Revoke and recreate extension connections — the advisory names NWC Provider, LNDHub, Bolt Cards, TPOS, Bleskomat and FOSSA as the extensions that hold connections.

The advisory also coined the operating rule this note endorses: keep only day-to-day operational funds on LNbits, sweep the excess to on-chain cold storage whose keys are offline. That is the same hot/cold split any exchange-scale operator uses; a merchant running LNbits is running a hot wallet and should budget for it.

Trade-offs

  • Extensibility vs supply chain. Extensions are third-party code inside your money server. WASM extensions (v1.6.0+) are sandboxed by design precisely to cut this risk; in-process Python extensions are not. Pin versions, review manifests, and note that v1.7.0's "automatic extension updates" cuts both ways.
  • One API for everything vs lowest common denominator. The uniform API hides backend differences until they matter — hold-invoice escrow silently unavailable on phoenixd, node management absent on custodial services. Read the feature matrix before building on a primitive.
  • Self-custody privacy vs operational load. Your own LND/CLN gives high privacy and no KYC, at the cost of channel management and a hot node to secure. phoenixd trades some privacy and channel control for near-zero maintenance. Custodial services trade custody, privacy and KYC for a ten-minute setup — appropriate for a demo, not for a sovereignty practice.
  • SaaS convenience vs tenancy. my.lnbits.com (billed per instance; lnbits.com advertises SaaS from 21 sats/hour) is a real server with HTTPS and a dashboard, but the operator of the SaaS can see everything short of the funding-source keys, and super-user features (manual settlement entries, OTC selling) live on that box.
  • Incident response is on you. The November 2026 advisory assumed an operator who can rebuild a server, rotate macaroons and re-key every connected app. If nobody in the organisation can do that, that is the argument for the simpler custodial setups — or for not running a hot wallet at all.

Attack surface

  • Compromise of the LNbits host = compromise of the funding source's spend credentials. Admin macaroons and runes live in settings or env files. Mitigate with the hot/cold split, firewalling the node's RPC ports, and (post-v1.7.0) TOTP 2FA on admin access.
  • Extension registry as a supply-chain channel. Malicious or backdoored extensions run with the server's privileges. WASM sandboxing mitigates; in-process extensions do not get that guarantee. Treat "install extension" like "install browser extension with wallet access".
  • Key leakage through connected apps. Every wallet's invoice/pay API keys are bearer credentials; any app you paste them into holds that wallet. The 2026 advisory's step 5 exists because extensions accumulate connections that outlive their usefulness. Audit them.
  • Internal-accounting drift. Because balances are database rows, a database restore without the matching funding source produces spendable-looking balances that cannot be spent. Back up node state and LNbits state together, and reconcile.
  • Public-instance metadata exposure. Invoice memos, amounts, wallet names and timing on a shared instance are visible to the instance operator and, via the API keys' read scope, to whatever holds them. Self-host for private sales records.
  • Known-exploited software windows. The 2026-11-08 → 2026-11-10 window is the concrete case: unpatched LNbits facing the public internet held stealable funds. Patch latency is part of the threat model for anything hot.

Evidence

Claim Source Read
Definition: Python server on top of any funding source; accounts system; extension platform; LNURL fallback wallet docs.lnbits.com user's guide; lnbits.com; lnbits/lnbits README 2026-11-24
Per-wallet API keys partition exposure of the funding source docs.lnbits.com; lnbits.com ("harden app security") 2026-11-24
21 funding sources; custody/KYC/privacy table (OpenNode, Alby, Blink, ZBD, Strike, LNPay = custodial + KYC); hold invoices LND yes / CLN some / rest no docs.lnbits.com guide/wallets/comparison 2026-11-24
Balances are internal accounting; backend switch does not transfer funds docs.lnbits.com guide/faq/backends 2026-11-24
v1.7.0 (2026-11-10) urgent security update; vulnerability discovered 2026-11-08; prior versions' funds at risk; recovery steps 1–5; hot-wallet guidance lnbits/lnbits release v1.7.0; news.lnbits.com security-update advisory 2026-11-24
v1.7.1 (2026-11-11, 4fa70f3) rotates auth keys lnbits/lnbits release v1.7.1; docs.lnbits.com changelog; PyPI lnbits 1.7.1 2026-11-24
v1.7.0 features: on-chain wallets #4194, BOLT12 #4169, NIP-17 #4260, TOTP 2FA #4203, job scheduler #4226, auto extension updates #4314, outgoing webhooks #4113 lnbits/lnbits release notes 2026-11-24
v1.6.0 (2026-09-02) introduced sandboxed WASM extensions lnbits/lnbits release v1.6.0 2026-11-24
Core extensions list (LNURLp, TPoS, Withdraw, Paywall, SatsPay, Boltz, NWC Provider, Watch Only, Split Payments, Scrub, TipJar, Decoder); 60+ extensions total docs.lnbits.com guide/using-extensions; extensions index 2026-11-24
Merchant Stack composition and TPoS capabilities (carts, tips, tax, Stripe tap-to-pay via TPoS Wrapper, cash validation, on-chain watch-only, remote payment display, receipts, OTC selling) docs.lnbits.com merchant-stack pages 2026-11-24
SaaS from 21 sats/hr on lnbits.com; demo at demo.lnbits.com lnbits.com; lnbits/lnbits README 2026-11-24
Repo facts: MIT, created 2019-12-09, Python 3.10–3.13 required (v1.7.0 upgraded to Python 3.13, Pydantic 2) lnbits/lnbits GitHub; PyPI lnbits 2026-11-24

Primary sources

Page history

Updated
2026-11-24
Origin
Compiled from the ungovernable.tech research notes.
Improve this page
Suggest an edit — issues and pull requests are welcome.