Why Build a Bitcoin Agent SDK Instead of Another Chatbot?
Why Build a Bitcoin Agent SDK Instead of Another Chatbot?
A chatbot can answer questions, but wallet operations need explicit contracts. WAB ENGINE already exposes a deterministic HTTP JSON boundary. This article belongs to the third WAB ENGINE programming series, which explores portable AI-agent integrations on Bitcoin Testnet.
Why this matters
A Bitcoin agent is not a wallet. A language model can interpret a request and present a result, but it must not replace the deterministic execution boundary. WAB ENGINE remains responsible for wallet operations and its original signed fee law. The adapter is responsible for narrow tool inputs, authorization, timeouts, and evidence-based output. The experimental integration must never modify the engine's existing behavior.
Proposed design
Put the AI model above a tool adapter. The adapter validates arguments and forwards a narrow request to the existing engine; it never signs a transaction itself.
Keep the following boundaries explicit: model output is untrusted input; Go validates and authorizes the operation; WAB ENGINE returns the authoritative JSON result; any generated explanation is a separate, optional step. A successful HTTP response or a TXID is not automatically a block confirmation.
Code example
The companion source is repo/README.md, supplied in this ZIP under repo/. Browse published source examples through https://thamer.org/repo/ after they have been uploaded. The article does not assume that this individual file already has a public URL.
# Run offline Go tests from the accompanying repo/ directory.
cd Repo
go test ./...
go vet ./...
The example is intentionally small. It demonstrates one boundary, not an entire production wallet SDK. For networked operations, use an explicitly configured Testnet endpoint, never silently default to Mainnet, and do not use real credentials in tutorial commands.
Reproducible experiment
Compare a natural-language response with a typed tool result. Mark which fields originate from the engine. Capture the command, exit code, relevant JSON, and test environment. If an LLM is involved, record its model and timeout separately from the engine operation. Mark mock responses as mocks, not on-chain evidence.
Failure modes and trade-offs
- Wrong service or version: a successful CURL response may come from an older process listening on the same port. Verify the running container and binary.
- Unexpected model output: an AI response may invent a fee, a tool name, or a confirmation. Never replace engine facts with generated text.
- Retry after timeout: a new request ID can represent a new transfer. Preserve the ID of the authorized intent until its status is resolved.
- Credential exposure: do not put BTC KEY, BTC SECRET, API keys, or bearer tokens into prompts, articles, traces, or Git repositories.
What this experiment does not prove
Do not claim any agent can spend safely just because it can call an HTTP endpoint. The demonstrated code is preliminary and must undergo API contract validation, agent-framework compatibility testing, and security review before production use. The earlier WAB V3.4 Testnet SEND experiments showed accepted sends with requested_sat=10000 and recipient_sat=9000; those facts describe that wallet's inclusive fee law, not a universal Bitcoin fee formula.
Next step
Start with the offline test, then connect one read-only tool to an isolated Testnet wallet. Only after confirming the tool contract should you attempt an authorized SEND with a deliberately bounded amount and an explicit idempotency key.
Developer resources
- WAB API: https://thamer.org/api
- WAB ENGINE: https://thamer.org/engine
- Source examples and experimental SDKs: https://thamer.org/repo/
All code in this series is a prototype for Bitcoin Testnet, not a production SDK. The engine remains the source of truth; these examples do not establish an official OpenHands, Goose, or OpenCode integration. Never publish BTC KEY, BTC SECRET, session tokens, or live API credentials.
