What problem does it solve?
AI agents require programmable, borderless, self-custodial access to a Bitcoin L2 wallet to perform autonomous transactions. This skill provides a ready-made Spark Bitcoin L2 wallet integration using the Spark SDK, enabling mnemonic-based wallet provisioning, BTC and token management, Lightning interop, and cooperative exits without relying on centralized services.
Core Features & Use Cases
- Wallet provisioning from a BIP39 mnemonic and management of Spark addresses
- Check BTC balance, tokens, deposits, and perform Spark-to-Spark transfers
- Create and pay Lightning invoices and Spark native invoices for payments
- Token operations (BTKN/LRC20), batch transfers, and token invoices
- Withdrawals to L1 via cooperative exit with fee estimation
- Message signing and identity verification for agents
- Complete SparkAgent class for easy integration into AI agents and workflows
Quick Start
Install dependencies in the skill directory with npm install
Create or load a wallet using the provided example scripts, e.g. node examples/wallet-setup.js
Configure environment variables (SPARK_MNEMONIC, SPARK_NETWORK) in .env and run balance and payment examples (node examples/balance-and-deposits.js, node examples/payment-flow.js)