Skip to main content
RapidDev - Software Development Agency

How to Install and Use LNBits Wallet with QR Code in OpenClaw

To use LNbits Lightning payments in OpenClaw, run `clawhub install lnbits-wallet-with-qr-code`, then set LNBITS_URL (your LNbits instance URL) and LNBITS_API_KEY (your wallet's invoice or admin key) in OpenClaw config. Once configured, you can create Bitcoin Lightning invoices with QR codes, check wallet balances, and verify payments directly from OpenClaw chat.

What you'll learn

  • How to install the LNbits ClawHub skill and connect it to your LNbits wallet
  • How to configure LNBITS_URL and LNBITS_API_KEY in OpenClaw
  • How to create Bitcoin Lightning invoices with QR codes from OpenClaw chat prompts
  • How to check wallet balances and verify payment status from OpenClaw
  • The difference between LNbits invoice keys (read + create invoices) and admin keys (full wallet access)
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner12 min read10 minutesFinance & TradingMarch 2026RapidDev Engineering Team
TL;DR

To use LNbits Lightning payments in OpenClaw, run `clawhub install lnbits-wallet-with-qr-code`, then set LNBITS_URL (your LNbits instance URL) and LNBITS_API_KEY (your wallet's invoice or admin key) in OpenClaw config. Once configured, you can create Bitcoin Lightning invoices with QR codes, check wallet balances, and verify payments directly from OpenClaw chat.

Create Bitcoin Lightning Invoices and QR Codes from OpenClaw Chat

Bitcoin Lightning Network enables instant, near-zero-fee payments that can be programmatically created and verified through wallet APIs. LNbits is the most widely deployed open-source Lightning wallet platform — it runs on top of a Lightning node (LND, CLN, or LNbits Cloud) and exposes a clean API for creating invoices, checking payments, and managing wallet operations. The OpenClaw LNbits skill brings all of this into your AI agent workflow.

The practical use case is straightforward: create a Lightning invoice for any amount with a memo describing the payment, get a QR code that anyone can scan with a Lightning wallet, and verify payment confirmation — all without logging into a web dashboard or running manual API calls. For developers and merchants integrating Lightning payments into their workflow, this means you can test payment flows, generate invoices for clients, and monitor incoming payments from OpenClaw chat during development or operations.

The QR code generation component is what differentiates this skill from a basic LNbits API wrapper. Lightning invoices are long strings of characters that are impractical to share manually. The skill converts every invoice into a scannable QR code image, making it easy to share payment requests via any channel — paste the QR code into a message, email, or document and recipients can scan it with any Lightning wallet instantly. This is particularly useful for point-of-sale scenarios, client invoicing, and testing payment integrations.

Integration method

ClawHub Skill

The LNbits skill connects to your self-hosted or hosted LNbits instance via its API. Using your wallet's API key, OpenClaw can create Lightning invoices with embedded QR codes, check your wallet balance, look up payment status, and decode invoice details from OpenClaw chat. The skill requires two configuration variables: LNBITS_URL pointing to your LNbits instance and LNBITS_API_KEY for authentication.

Prerequisites

  • OpenClaw installed and running (see openclaw.ai for installation instructions)
  • ClawHub CLI available in your terminal (bundled with OpenClaw)
  • An LNbits wallet — either self-hosted (lnbits.com) or using a hosted provider (legend.lnbits.com or similar)
  • Your LNbits wallet's Invoice Key or Admin Key (available in the LNbits wallet page)
  • The URL of your LNbits instance (e.g., https://legend.lnbits.com or your self-hosted domain)

Step-by-step guide

1

Install the LNbits Skill via ClawHub

Open your terminal and run the ClawHub install command. The LNbits skill downloads from the ClawHub registry and registers with your local OpenClaw instance. Unlike some skills, LNbits requires two configuration variables: the URL of your LNbits instance and an API key from your wallet. Both are needed before the skill can function. The install output will list both required variables (LNBITS_URL and LNBITS_API_KEY) and explain their purpose. You will gather both in the next step from your LNbits account. If `clawhub` is not found, verify your OpenClaw installation path. The ClawHub binary ships with OpenClaw and is typically located at `/usr/local/bin/clawhub` on macOS/Linux.

terminal
1clawhub install lnbits-wallet-with-qr-code

Pro tip: Run `clawhub info lnbits-wallet-with-qr-code` to see the full list of required and optional configuration variables before proceeding to the LNbits setup.

Expected result: Terminal confirms: 'lnbits-wallet-with-qr-code@X.X.X installed successfully. Required config: LNBITS_URL, LNBITS_API_KEY'. The skill is installed but not yet active until both variables are set.

2

Get Your LNbits URL and API Key

Log into your LNbits instance. If you're using the hosted demo at legend.lnbits.com, navigate to your wallet page. If you're self-hosted, go to your instance's domain. On the wallet page, look for the 'API info' section — this is typically shown as a small info panel or accessible through a settings icon. LNbits provides two types of API keys for each wallet: **Invoice Key (recommended for most uses)**: Can create invoices and check payment status. Cannot send payments or access wallet management. This is the safer key to use with OpenClaw for incoming payment workflows. **Admin Key**: Full access — can create invoices, send payments, and manage the wallet. Use this only if you need OpenClaw to send payments on your behalf. For LNBITS_URL, use the base URL of your LNbits instance — for example, `https://legend.lnbits.com` or `https://lnbits.yourdomain.com`. Do not include any path — the skill appends the correct API paths automatically. Copy the Invoice Key (or Admin Key if needed) and note your instance URL. Keep these credentials secure — they control your Lightning wallet.

Pro tip: Use the Invoice Key rather than the Admin Key for OpenClaw integration whenever possible. The Invoice Key is read/receive-only — it limits the blast radius if the key is ever accidentally exposed, since it cannot be used to send funds.

Expected result: You have your LNbits instance URL and either the Invoice Key or Admin Key for your wallet, both ready to configure in OpenClaw.

3

Configure LNBITS_URL and LNBITS_API_KEY in OpenClaw

Add both required configuration variables to OpenClaw. Use the `clawhub config set` command for each, or add them together to your `~/.openclaw/.env` file. Both must be set before the skill will operate. The LNBITS_URL must be the base URL without a trailing slash. LNBITS_API_KEY is the key string from your LNbits wallet's API info section. After setting both variables, run `clawhub reload` to apply the configuration. Verify both are set using `clawhub config get` before testing. If you're using multiple LNbits wallets (for example, different wallets for different clients or projects), note that this skill configuration supports one wallet at a time. To switch wallets, update LNBITS_API_KEY and reload.

.env
1# Option A: Add to ~/.openclaw/.env
2LNBITS_URL=https://legend.lnbits.com
3LNBITS_API_KEY=your-invoice-key-or-admin-key-here
4
5# Option B: Set via clawhub config
6clawhub config set LNBITS_URL https://legend.lnbits.com
7clawhub config set LNBITS_API_KEY your-key-here
8
9# Verify both are set
10clawhub config get LNBITS_URL
11clawhub config get LNBITS_API_KEY
12
13# Apply configuration
14clawhub reload

Pro tip: Never use an Admin Key with OpenClaw unless you explicitly need OpenClaw to send payments. The Invoice Key covers 90% of use cases with much lower risk if the configuration is accidentally shared.

Expected result: Both config values return (appropriately masked) when queried. OpenClaw confirms the lnbits-wallet-with-qr-code skill is active after reload.

4

Create Your First Lightning Invoice with QR Code

Open OpenClaw chat and request a Lightning invoice. Specify the amount in satoshis (sats) — 1 Bitcoin = 100,000,000 satoshis — and optionally provide a memo describing the payment. The skill creates the invoice via the LNbits API and returns both the raw invoice string (a long bolt11-encoded payment request starting with 'lnbc') and a QR code image. The QR code can be shared directly in any platform that supports image display. Anyone with a Lightning-enabled wallet (Strike, Wallet of Satoshi, Phoenix, Zeus, or any other) can scan the QR code to pay the invoice instantly. Lightning invoices typically expire after 1 hour by default. You can request longer expiry times by specifying them in your prompt. Once paid, invoices are settled in seconds and OpenClaw can immediately confirm payment status. RapidDev can help set up automated Lightning payment workflows in OpenClaw — for example, generating invoices for new orders in an e-commerce workflow, or routing payment confirmations to a notification channel.

OpenClaw Prompt

Create a Lightning invoice for 10,000 sats with the memo 'Test payment — OpenClaw setup'. Show me the invoice string and the QR code. Set expiry to 24 hours.

Paste this in OpenClaw chat

Pro tip: After creating the invoice, test the payment flow by scanning the QR code with your own Lightning wallet and sending the payment. Then ask OpenClaw to verify the invoice status — you'll see it flip from 'unpaid' to 'paid' within seconds.

Expected result: OpenClaw returns the invoice bolt11 string (starts with 'lnbc'), a QR code image, and invoice metadata including amount, memo, and expiry time. The invoice is visible in your LNbits wallet dashboard.

5

Check Wallet Balance and Payment History

Beyond creating invoices, the LNbits skill lets you query your wallet state directly from OpenClaw. This is useful for bookkeeping, verifying incoming payments, and monitoring wallet balances without opening a browser. **Balance checks**: Ask OpenClaw for your current wallet balance in satoshis. The skill can also convert to BTC or fiat at current prices if you have the Crypto Price skill installed alongside it. **Payment verification**: After sharing an invoice, ask OpenClaw to check whether it has been paid. Specify the invoice or its memo in your prompt and OpenClaw returns the current payment status. **Payment history**: Request recent transactions from your wallet including incoming and outgoing payments with timestamps, amounts, and memos. Useful for reconciliation and tracking. **Invoice decode**: If you receive a Lightning invoice from someone else, ask OpenClaw to decode it — this reveals the amount, memo, expiry, and destination node before you pay it.

OpenClaw Prompt

Check my LNbits wallet balance. Also show me all incoming payments received in the last 7 days, sorted by amount. Include the payment memo and the date for each.

Paste this in OpenClaw chat

lnbits-wallet-with-qr-code.yaml
1# Optional skill config
2# ~/.openclaw/skills/lnbits-wallet-with-qr-code.yaml
3lnbits-wallet-with-qr-code:
4 default_expiry: 3600 # invoice expiry in seconds (default: 3600 = 1 hour)
5 qr_size: 256 # QR code image size in pixels
6 default_currency: sats # display amounts in sats, btc, or usd
7 include_fiat_value: true # show USD equivalent alongside sats

Pro tip: Pair this skill with the Crypto Price skill to automatically display sats amounts alongside their current USD equivalent in every balance and payment response.

Expected result: OpenClaw returns the current wallet balance in sats and a list of recent incoming payments with amounts, memos, and timestamps. All data reflects the live LNbits wallet state.

Common use cases

Generate a Lightning Invoice for a Client Payment

Create a Lightning invoice with a specific amount and memo, get the payment string and QR code, and share it with whoever needs to pay you. OpenClaw generates the invoice and QR code in one step.

OpenClaw Prompt

Create a Lightning invoice in my LNbits wallet for 50,000 sats with the memo 'Invoice #2026-047 — Web development services March 2026'. Show me the payment request string and the QR code image.

Copy this prompt to try it in OpenClaw

Check Wallet Balance and Recent Payments

Ask OpenClaw to pull your current LNbits wallet balance and list recent incoming or outgoing payments. Useful for quick accounting checks without opening the LNbits dashboard.

OpenClaw Prompt

Check my LNbits wallet balance in sats and in USD (use current BTC price). Also show me the last 10 incoming payments with their amounts, memos, and confirmation timestamps.

Copy this prompt to try it in OpenClaw

Verify Payment Confirmation

After sharing a Lightning invoice, verify that it has been paid by asking OpenClaw to check the payment status. Lightning payments confirm in seconds, so this is usually instant feedback.

OpenClaw Prompt

Check if my last Lightning invoice has been paid. The invoice memo was 'Workshop ticket — Alice'. If it's paid, show me the payment amount and the time it was received.

Copy this prompt to try it in OpenClaw

Troubleshooting

OpenClaw returns '401 Unauthorized' or 'lnbits: authentication failed' when creating invoices or checking balance

Cause: LNBITS_API_KEY is incorrect, missing, or the key has been regenerated in LNbits. Also common when the wrong key type is used (e.g., a read key when an admin action is needed).

Solution: Verify the key in your LNbits wallet's API info section and re-set it with `clawhub config set LNBITS_API_KEY your-correct-key`. For operations that require the Admin Key (like sending payments), confirm you're using the admin key rather than the invoice key.

typescript
1clawhub config get LNBITS_API_KEY
2clawhub config set LNBITS_API_KEY your-correct-key-here
3clawhub reload

OpenClaw returns 'connection refused' or timeout when trying to reach LNbits

Cause: LNBITS_URL is incorrect, contains a trailing slash, or points to a server that is down. For self-hosted LNbits, the server may not be running.

Solution: Verify the URL by opening it in a browser — you should see the LNbits interface. The URL should not have a trailing slash. For self-hosted instances, confirm the LNbits service is running. Update LNBITS_URL if the URL has changed.

typescript
1# Correct URL format (no trailing slash)
2clawhub config set LNBITS_URL https://legend.lnbits.com
3clawhub reload

clawhub install lnbits-wallet-with-qr-code fails with a registry error

Cause: ClawHub registry temporary availability issue or rate limiting.

Solution: Wait 2-3 minutes and retry. Use --force to clear any partial installation state.

typescript
1clawhub install lnbits-wallet-with-qr-code --force

Lightning invoice QR code is created but payment fails with 'no route found'

Cause: The Lightning node backing your LNbits wallet has insufficient liquidity or channel connections to route the payment. This is a node connectivity issue, not an OpenClaw or LNbits configuration issue.

Solution: Try a smaller invoice amount, or check your Lightning node's channel balances and connectivity. For hosted LNbits (legend.lnbits.com), the platform manages node liquidity and routing — contact their support if persistent routing failures occur.

Best practices

  • Use the Invoice Key (not Admin Key) for most OpenClaw integrations — it can create and check invoices but cannot send payments, reducing risk if the key is accidentally exposed.
  • Store LNBITS_URL and LNBITS_API_KEY in your OpenClaw .env file, never in chat prompts or shared configuration files.
  • Set appropriate invoice expiry times — the default 1 hour is fine for most cases, but for invoices you share publicly or via email, consider longer expiry times (24 hours or more).
  • Always verify payment status after an invoice should have been paid — Lightning confirmations are near-instant, so a quick status check confirms whether the payment succeeded.
  • For amounts in satoshis, remember 1 BTC = 100,000,000 sats. Common values: 1,000 sats ≈ a fraction of a cent at most prices, 100,000 sats ≈ a few dollars, 1,000,000 sats ≈ tens of dollars (varies with BTC price).
  • Pair the LNbits skill with the Crypto Price skill to automatically display sats values alongside their USD equivalent in every invoice and balance response.
  • For production payment workflows, use a dedicated LNbits wallet per use case (e.g., one for testing, one for production) with separate invoice keys — this isolates payment flows and makes accounting cleaner.

Alternatives

Frequently asked questions

How do I install LNbits Wallet with QR Code in OpenClaw?

Run `clawhub install lnbits-wallet-with-qr-code` in your terminal. Then log into your LNbits instance, find the API info section on your wallet page, and copy your Invoice Key (for read/receive) or Admin Key (for full access). Set LNBITS_URL to your instance URL and LNBITS_API_KEY to your key using `clawhub config set`. Run `clawhub reload` and test with a balance check from OpenClaw chat.

What is the difference between the LNbits Invoice Key and Admin Key?

The Invoice Key can only create invoices and check payment status — it cannot send payments or access wallet management functions. The Admin Key has full wallet access including sending payments. For OpenClaw integration, use the Invoice Key whenever possible to minimize risk. Only use the Admin Key if you need OpenClaw to send outgoing Lightning payments on your behalf.

Does the OpenClaw LNbits skill require me to run my own Lightning node?

No. LNbits can run on top of many underlying Lightning backends, including hosted services where you don't manage the node yourself. You can use the public demo at legend.lnbits.com for testing, or hosted LNbits services that manage the underlying node for you. You only need to manage a Lightning node yourself if you specifically want self-hosted infrastructure.

Does RapidDev help with Lightning payment integrations in OpenClaw?

Yes — RapidDev can help build automated payment workflows in OpenClaw using the LNbits skill, including invoice generation for e-commerce events, payment confirmation routing, and integrating Lightning payments with other business tools. Single-wallet setups as described on this page are self-serve, but production payment pipelines benefit from a structured configuration.

Why is my OpenClaw LNbits invoice not getting paid — the QR code generates fine but payments fail?

This is typically a Lightning routing issue, not a configuration problem. Your Lightning node (or the hosted node backing your LNbits wallet) may lack sufficient liquidity in the right channels to complete the route. Try a smaller test amount first to verify basic routing works. If your Lightning node consistently has routing failures, it may need more channels or inbound liquidity. For hosted LNbits (legend.lnbits.com), report persistent routing issues to their support.

Can I use the OpenClaw LNbits skill to send Bitcoin Lightning payments?

Yes, but only if you configure the LNBITS_API_KEY with your wallet's Admin Key (not the Invoice Key). The Invoice Key is read-only plus invoice creation. The Admin Key enables outgoing payments. Ask OpenClaw to 'send X sats to [bolt11 invoice string]' and the skill will initiate the payment from your LNbits wallet.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.