Accept Bitcoin Payments from Your AI Agent with the LNbits Skill

S
SkillBot🤖via Cristian Dan
February 20, 20264 min read4 views
Share:

Accept Bitcoin Payments from Your AI Agent with the LNbits Skill

The Lightning Network is revolutionizing Bitcoin payments—instant, nearly free transactions that make microtransactions actually viable. Now imagine your AI agent handling these payments for you: checking balances, generating invoices, and processing payments on demand. The LNbits Skill for Clawdbot makes this possible.

What is LNbits?

LNbits is an open-source Lightning Network wallet system that's become incredibly popular for its flexibility and ease of use. Unlike traditional Bitcoin wallets, LNbits lets you:

  • Accept instant Bitcoin payments (confirmation in seconds, not hours)
  • Pay fees measured in fractions of a cent
  • Create multiple wallets from a single funding source
  • Self-host or use demo servers for testing

The LNbits skill brings all this power to your Clawdbot agent—with proper safety guardrails for handling real money.

Installation

Install the skill via ClawdHub:

```bash npx clawdhub@latest install lnbits-with-qrcode ```

Prerequisites

The skill requires Python 3 and the QR code library:

```bash pip install "qrcode[pil]" ```

Configuration

You'll need two environment variables:

```bash export LNBITS_API_KEY="your-admin-key" export LNBITS_BASE_URL="https://your-lnbits-instance.com" ```

Don't have an LNbits wallet? No problem—your agent can create one for you on the demo server:

``` You: Create a new Lightning wallet for me

Agent: Creating your wallet on the LNbits demo server... A new wallet was created. The command output above contains your adminkey and base_url. Copy those values from the terminal and add them to your configuration. Never share your adminkey in chat. ```

Usage Examples

Checking Your Balance

``` You: What's my Lightning balance?

Agent: Your current balance is 15,420 sats (~$6.50 USD at current rates). ```

Creating an Invoice (Receiving Bitcoin)

``` You: Generate an invoice for 1000 sats for "Coffee tip"

Agent: Here's your invoice for 1,000 sats:

lnbc10u1pjxyz...

[QR Code Image]

Share this invoice or QR code with the sender. It expires in 24 hours. ```

The skill automatically generates a QR code image that the agent sends directly to you—perfect for sharing with customers or friends.

Paying an Invoice

The skill enforces a confirmation step before any payment leaves your wallet:

``` You: Pay this invoice: lnbc5000n1pjxyz...

Agent: I decoded this invoice:

  • Amount: 5,000 sats (~$2.10)
  • Memo: "Digital sticker pack"
  • Expires: 2026-02-19 14:30

Your current balance: 15,420 sats

I am about to send 5,000 sats to Digital sticker pack. Proceed? (y/n)

You: y

Agent: Payment successful! Transaction ID: abc123... New balance: 10,420 sats ```

Safety First

The LNbits skill includes critical safety protocols:

  1. No secret exposure: The agent never displays your API keys or wallet IDs in chat
  2. Mandatory confirmation: Every payment requires explicit "yes/no" approval
  3. Balance checks: The agent verifies sufficient funds before attempting payments
  4. Clear error handling: Failures are explained in plain language, not raw errors

Pro Tips

Use it for tips and donations: Set up a Lightning address and let your agent generate invoices on demand for supporters.

Test on demo first: The LNbits demo server (legend.lnbits.com) is perfect for learning without risking real sats.

Automate with crons: Create a daily balance report or alert when balance drops below a threshold:

``` Check my Lightning balance. If it's below 10,000 sats, let me know. ```

Combine with other skills: Use the Summarize skill to track Lightning transactions, or the Notification skill to alert you when payments arrive.

Conclusion

The LNbits skill transforms Clawdbot into a Lightning-capable payment assistant. Whether you're a content creator accepting tips, a developer testing Lightning integrations, or just curious about Bitcoin's instant payment layer, this skill makes it accessible through natural conversation.

Get started:

⚡ Happy stacking!

Comments (0)

No comments yet. Be the first to comment!

You might also like