8.1 KiB
| layout | title | nav_order |
|---|---|---|
| default | Backend wallets | 3 |
Backend wallets
LNbits can run on top of many Lightning Network funding sources with more being added regularly.
A backend wallet can be configured using the following LNbits environment variables:
You can compare the LNbits compatible Lightning Network funding sources here.
CLNRest (using runes)
Should also work with the Rust version of CLNRest
LNBITS_BACKEND_WALLET_CLASS: CLNRestWalletCLNREST_URL:https://127.0.0.1:3010CLNREST_CA:/home/lightningd/.lightning/bitcoin/ca.pem(or the content of theca.pemfile)CLNREST_CERT:/home/lightningd/.lightning/bitcoin/server.pem(or the content of theserver.pemfile)CLNREST_READONLY_RUNE:lightning-cli createrune restrictions='[["method=listfunds", "method=listpays", "method=listinvoices", "method=getinfo", "method=summary", "method=waitanyinvoice"]]' | jq -r .runeCLNREST_INVOICE_RUNE:lightning-cli createrune restrictions='[["method=invoice"], ["pnameamount_msat<1000001"], ["pnamelabel^LNbits"], ["rate=60"]]' | jq -r .runeCLNREST_PAY_RUNE:lightning-cli createrune restrictions='[["method=pay"], ["pinvbolt11_amount<1001"], ["pnamelabel^LNbits"], ["rate=1"]]' | jq -r .runeCLNREST_RENEPAY_RUNE:lightning-cli createrune restrictions='[["method=renepay"], ["pinvinvstring_amount<1001"], ["pnamelabel^LNbits"], ["rate=1"]]' | jq -r .runeCLNREST_LAST_PAY_INDEX:lightning-cli listinvoices | jq -r '.invoices | map(.created_index) | max'CLNREST_NODEID:lightning-cli getinfo | jq -r .id(only required for v23.08)
CoreLightning
LNBITS_BACKEND_WALLET_CLASS: CoreLightningWalletCORELIGHTNING_RPC: /file/path/lightning-rpc
CoreLightning REST
This is the old REST interface that uses Ride The Lightning/c-lightning-REST
LNBITS_BACKEND_WALLET_CLASS: CoreLightningRestWalletCORELIGHTNING_REST_URL: http://127.0.0.1:8185/CORELIGHTNING_REST_MACAROON: /file/path/admin.macaroon or Base64/HexCORELIGHTNING_REST_CERT: /home/lightning/clnrest/tls.cert
Spark (Core Lightning)
LNBITS_BACKEND_WALLET_CLASS: SparkWalletSPARK_URL: http://10.147.17.230:9737/rpcSPARK_TOKEN: secret_access_key
LND (REST)
LNBITS_BACKEND_WALLET_CLASS: LndRestWalletLND_REST_ENDPOINT: http://10.147.17.230:8080/LND_REST_CERT: /file/path/tls.certLND_REST_MACAROON: /file/path/admin.macaroon or Base64/Hex
or
LND_REST_MACAROON_ENCRYPTED: eNcRyPtEdMaCaRoOn
LND (gRPC)
LNBITS_BACKEND_WALLET_CLASS: LndWalletLND_GRPC_ENDPOINT: ip_addressLND_GRPC_PORT: portLND_GRPC_CERT: /file/path/tls.certLND_GRPC_MACAROON: /file/path/admin.macaroon or Base64/Hex
You can also use an AES-encrypted macaroon (more info) instead by using
LND_GRPC_MACAROON_ENCRYPTED: eNcRyPtEdMaCaRoOn
To encrypt your macaroon, run uv run lnbits-cli encrypt macaroon.
LNbits
LNBITS_BACKEND_WALLET_CLASS: LNbitsWalletLNBITS_ENDPOINT: e.g. https://lnbits.comLNBITS_KEY: lnbitsAdminKey
LNPay
For the invoice listener to work you have a publicly accessible URL in your LNbits and must set up LNPay webhooks pointing to <your LNbits host>/wallet/webhook with the "Wallet Receive" event and no secret. For example, https://mylnbits/wallet/webhook will be the Endpoint Url that gets notified about the payment.
LNBITS_BACKEND_WALLET_CLASS: LNPayWalletLNPAY_API_ENDPOINT: https://api.lnpay.co/v1/LNPAY_API_KEY: sak_apiKeyLNPAY_WALLET_KEY: waka_apiKey
OpenNode
For the invoice to work you must have a publicly accessible URL in your LNbits. No manual webhook setting is necessary.
LNBITS_BACKEND_WALLET_CLASS: OpenNodeWalletOPENNODE_API_ENDPOINT: https://api.opennode.com/OPENNODE_KEY: opennodeAdminApiKey
Blink
For the invoice to work you must have a publicly accessible URL in your LNbits. No manual webhook setting is necessary. You can generate a Blink API key after logging in or creating a new Blink account at: https://dashboard.blink.sv. For more info visit: https://dev.blink.sv/api/auth#create-an-api-key```
LNBITS_BACKEND_WALLET_CLASS: BlinkWalletBLINK_API_ENDPOINT: https://api.blink.sv/graphqlBLINK_WS_ENDPOINT: wss://ws.blink.sv/graphqlBLINK_TOKEN: BlinkToken
Alby
For the invoice to work you must have a publicly accessible URL in your LNbits. No manual webhook setting is necessary. You can generate an alby access token here: https://getalby.com/developer/access_tokens/new
LNBITS_BACKEND_WALLET_CLASS: AlbyWalletALBY_API_ENDPOINT: https://api.getalby.com/ALBY_ACCESS_TOKEN: AlbyAccessToken
Boltz
This funding source connects to a running boltz-client and handles all lightning payments through submarine swaps on the liquid network.
You can configure the daemon to run in standalone mode by standalone = True in the config file or using the cli flag (boltzd --standalone).
Once running, you can create a liquid wallet using boltzcli wallet create lnbits lbtc.
LNBITS_BACKEND_WALLET_CLASS: BoltzWalletBOLTZ_CLIENT_ENDPOINT: 127.0.0.1:9002BOLTZ_CLIENT_MACAROON: /home/bob/.boltz/macaroons/admin.macaroon or Base64/HexBOLTZ_CLIENT_CERT: /home/bob/.boltz/tls.cert or Base64/HexBOLTZ_CLIENT_WALLET: lnbits
ZBD
For the invoice to work you must have a publicly accessible URL in your LNbits. No manual webhook setting is necessary. You can generate an ZBD API Key here: https://zbd.dev/docs/dashboard/projects/api
LNBITS_BACKEND_WALLET_CLASS: ZBDWalletZBD_API_ENDPOINT: https://api.zebedee.io/v0/ZBD_API_KEY: ZBDApiKey
Phoenixd
For the invoice to work you must have a publicly accessible URL in your LNbits. You can get a phoenixd API key from the install ~/.phoenix/phoenix.conf, also see the documentation for phoenixd.
LNBITS_BACKEND_WALLET_CLASS: PhoenixdWalletPHOENIXD_API_ENDPOINT: http://localhost:9740/PHOENIXD_API_PASSWORD: PhoenixdApiPassword
Breez SDK
A Greenlight invite code or Greenlight partner certificate/key can be used to register a new node with Greenlight. If the Greenlight node already exists, neither are required.
LNBITS_BACKEND_WALLET_CLASS: BreezSdkWalletBREEZ_API_KEY: ...BREEZ_GREENLIGHT_SEED: ...BREEZ_GREENLIGHT_INVITE_CODE: ...BREEZ_GREENLIGHT_DEVICE_KEY: /path/to/breezsdk/device.pem or Base64/HexBREEZ_GREENLIGHT_DEVICE_CERT: /path/to/breezsdk/device.crt or Base64/Hex
Breez Liquid SDK
This funding source leverages the Breez SDK - Liquid to manage all Lightning payments via submarine swaps on the Liquid network. To get started, simply provide a mnemonic seed phrase. The easiest way to generate one is by using a liquid wallet, such as Blockstream Green. Once generated, you can copy the seed to your environment variable or enter it in the admin UI.
LNBITS_BACKEND_WALLET_CLASS: BreezLiquidSdkWalletBREEZ_LIQUID_SEED: ...
Each submarine swap incurs service and on-chain fees. To account for these, you may need to increase the reserve fee in the admin UI by navigating to Settings -> Funding, or by setting the following environment variables:
LNBITS_RESERVE_FEE_MIN: ...LNBITS_RESERVE_FEE_PERCENT: ...
Cliche Wallet
CLICHE_ENDPOINT: ws://127.0.0.1:12000
Nostr Wallet Connect (NWC)
To use NWC as funding source in LNbits you'll need a pairing URL (also known as pairing secret) from a NWC service provider. You can find a list of providers here.
You can configure Nostr Wallet Connect in the admin ui or using the following environment variables:
LNBITS_BACKEND_WALLET_CLASS: NWCWalletNWC_PAIRING_URL: nostr+walletconnect://...your...pairing...secret...