Developer Toolkit · Bitcoin Spark L2

SparkBTCBot

A Bitcoin wallet for your AI agent. SparkBTCBot plugs any agent into the Spark Layer 2 network — Lightning invoices, instant transfers, and agent-to-agent payments via L402, installed in two commands.

Spark Wallet Lightning Invoices L402 Auth

AI meets Bitcoin Layer 2

SparkBTCBot bridges AI agents and the Spark Bitcoin L2 network, enabling autonomous wallet management, instant payments, Lightning invoices, message signing, and L402 paywall authentication.

Instant Transfers

Zero-fee Spark transfers and Lightning invoices — settled in seconds, not blocks.

Flexible Security

Encrypted seed access for prototyping, or a proxy with key isolation for production.

Full Wallet Control

BIP39 wallets, balance monitoring, Spark & Lightning invoices, token operations, and L1 withdrawals.

Two Ways to Spark

Whether you want simple local access or increased security and controls with the proxy version, there's a SparkBTCBot for you.

Agent Skill

SparkBTCBot Skill

Direct Spark SDK access from within your AI agent. Install as a plugin or clone locally — start transacting immediately.

  • Wallet generation & encrypted seed storage
  • Zero-fee instant Spark network transfers
  • Lightning invoices (BOLT11) & Spark invoices
  • LRC20 token operations & batch transfers
  • Message signing & identity verification
  • L1 Bitcoin withdrawal with fee estimation
  • L402 paywall authentication
Recommended For Personal development, learning, trusted single-agent environments, and rapid prototyping.
Quick Install
claude plugin marketplace add https://github.com/echennells/sparkbtcbot-skill
claude plugin install sparkbtcbot
🛡
Serverless Gateway

SparkBTCBot Proxy

A hardened HTTP gateway on Vercel. Agents get bearer tokens — never your private keys.

  • Private key isolation — mnemonic stays on server
  • Role-based access: admin, invoice, pay-only, read-only
  • Per-transaction & daily spending limits
  • Instant token revocation without moving funds
  • ~18 REST endpoints with Upstash Redis persistence
  • L402 paywall support with token caching & auto-retry
  • L402 preview endpoint & pending payment handling
Recommended For Production deployments, multi-agent architectures, and security-critical environments.
Quick Install
claude plugin marketplace add https://github.com/echennells/sparkbtcbot-proxy
claude plugin install sparkbtcbot-proxy

Skill vs. Proxy

A quick comparison to help you choose the right tool for your use case.

Aspect⚡ Skill⚡ Proxy
Access Model Direct SDK — agent holds encrypted seed HTTP gateway — agent holds bearer token
Key Security Agent has full wallet control Private key never leaves server
Spending Limits None (full access) Per-tx and daily caps
Access Control Single user, full permissions Role-based (admin / invoice / pay-only / read-only)
Deployment Plugin install or local clone Plugin install or Vercel + Upstash Redis
Setup Complexity Set passphrase, run setup Deploy to Vercel, provision Redis, create tokens
Revocation Rotate mnemonic Instant per-token
Multi-Agent Single agent Multiple agents

Up and Running
in Minutes

Choose your path and follow the steps below.

1

Install the skill

Add SparkBTCBot to your agent via the plugin system or by cloning locally.

Recommended — Plugin
claude plugin marketplace add https://github.com/echennells/sparkbtcbot-skill
claude plugin install sparkbtcbot
Alternative — Git Clone
git clone https://github.com/echennells/sparkbtcbot-skill.git \
~/.claude/skills/sparkbtcbot-skill
2

Configure & set up wallet

Set a passphrase and run the setup script to generate an encrypted wallet seed.

cd ~/.claude/skills/sparkbtcbot-skill
npm install
cp .env.example .env
# Set SPARK_PASSPHRASE (12+ chars) in .env
npm run setup
3

Back up & start

Back up the generated mnemonic offline, delete the backup file, and start transacting.

# Back up the mnemonic printed by setup, then:
rm ~/.spark/MNEMONIC_BACKUP_*.txt
# Now ask your agent: "Check my Spark wallet balance"
1

Install or deploy

Install the proxy plugin for agent usage, or clone and deploy your own instance.

Recommended — Plugin
claude plugin marketplace add https://github.com/echennells/sparkbtcbot-proxy
claude plugin install sparkbtcbot-proxy
Alternative — Self-Host
git clone https://github.com/echennells/sparkbtcbot-proxy.git
cd sparkbtcbot-proxy
npm install
npx vercel --prod
2

Configure environment

Set your mnemonic and Upstash Redis credentials as Vercel environment variables.

# In Vercel dashboard → Settings → Environment Variables:
SPARK_MNEMONIC="your twelve word mnemonic phrase here..."
API_AUTH_TOKEN="your-admin-fallback-token"
UPSTASH_REDIS_REST_URL="https://your-redis.upstash.io"
UPSTASH_REDIS_REST_TOKEN="your-token"
3

Create agent tokens

Generate role-based bearer tokens with spending limits for your AI agents.

curl -X POST https://your-proxy.vercel.app/api/tokens \
-H "Authorization: Bearer $ADMIN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"role":"pay-only","label":"my-agent","maxTxSats":500,"dailyBudgetSats":5000}'

Enjoy SparkBTCBot? A star helps others discover the project

Star on GitHub