Spark Bitcoin L2 Proxy Deployer for Openclaw

A serverless middleware that wraps the Spark Bitcoin L2 SDK behind authenticated REST endpoints to give AI agents secure, scoped wallet access.

echennells
v1.0.0
Feb 17, 2026
0
1.6k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install sparkbtcbot-proxy-deploy

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install sparkbtcbot-proxy-deploy using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Spark Bitcoin L2 Proxy Deployer?

The Spark Bitcoin L2 Proxy Deployer is a specialized tool within the Openclaw Skills library designed to bridge AI agents with the Bitcoin Lightning Network. It functions as a serverless middleware deployed on Vercel, acting as a protective layer that allows agents to perform wallet operations without ever exposing the master mnemonic. By utilizing this skill, developers can implement granular security controls including per-transaction spending caps and daily budgets.

This architecture leverages Upstash Redis for stateless session management, logging, and token storage, ensuring that your AI-driven financial operations remain robust and auditable. Whether you are building an automated merchant bot or a personal financial assistant, this skill provides the infrastructure needed for secure, programmatic Bitcoin interactions.

Spark Bitcoin L2 Proxy Deployer Use Cases

  • Granting AI agents scoped access to Bitcoin wallets without sharing private keys
  • Automating Lightning Network payments for autonomous agents with strict spending limits
  • Setting up merchant bots that can only create and monitor invoices but not spend funds
  • Integrating L402 paywall support into automated research or data retrieval workflows
  • Tracking agent transaction history and financial activity via centralized Redis logging

How Spark Bitcoin L2 Proxy Deployer Works

  1. The skill initializes a serverless environment on Vercel, pulling configuration from environment variables.
  2. It establishes a connection to the Spark Bitcoin L2 network via the Spark SDK and gRPC over HTTP/2.
  3. Incoming requests are authenticated using Bearer tokens verified against a Redis database or a fallback admin token.
  4. For payment requests, the proxy checks current spending against pre-defined MAX_TRANSACTION_SATS and DAILY_BUDGET_SATS limits.
  5. Validated operations (like transfers or invoice creation) are executed, and results are logged to Redis for persistence and auditing.
  6. For L402 requests, the proxy automatically handles the challenge-response cycle, paying the invoice and caching the resulting token.

Spark Bitcoin L2 Proxy Deployer Setup

Follow these steps to deploy the proxy using Openclaw Skills:

  1. Clone the repository:
git clone https://github.com/echennells/sparkbtcbot-proxy.git
cd sparkbtcbot-proxy
npm install
  1. Provision Redis: Create a global database via Upstash to handle state and logs.

  2. Prepare Environment Variables: Generate an admin token and your BIP39 mnemonic.

  3. Deploy to Vercel:

npx vercel --prod
  1. Configure Variables: Add SPARK_MNEMONIC, API_AUTH_TOKEN, UPSTASH_REDIS_REST_URL, and spending limits to your Vercel project settings, then redeploy.

Spark Bitcoin L2 Proxy Deployer Data Schema & Taxonomy

The skill organizes its infrastructure and state using the following schema:

Data Type Storage Method Description
Environment Config Vercel Secrets Stores sensitive mnemonics, API tokens, and spending caps
API Tokens Redis Hash (spark:tokens) Maps token strings to roles (admin/invoice) and labels
Activity Logs Redis List Stores chronologically ordered transaction and access logs
Spend Tracking Redis String Maintains a rolling daily total of sats spent to enforce budgets
L402 Cache Redis String Caches domain-specific L402 macaroons to prevent double-payment

Spark Bitcoin L2 Proxy Deployer Advanced Features

  • Automated L402 Paywall Handling: Supports recursive fetching and token caching for Lightning-protected content
  • Role-Based Access Control: Define 'admin' for full control or 'invoice' for read-only and receipt-only access
  • Lazy Invoice Detection: Automatically verifies pending Lightning invoices on every middleware request
  • Spending Guardrails: Hard-coded limits at the infrastructure level to prevent runaway agent spending
  • Serverless Optimization: Designed for Vercel's execution model with ~1.5s initialization time and zero idle costs

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*