Deterministic Bitcoin Execution for AI Agents
Research scope
This is Stage 01, study 01, of Bitcoin for AI Agents. It is an educational reference design, not a live-tested integration or production SDK. The WAB Engine remains independent; wallet creation belongs to the Factory.
Architecture and rationale
Separate model reasoning from wallet execution. A model proposes a named operation; trusted code selects the route. Never interpret model output as shell commands. A successful model response is not evidence of a successful Bitcoin transaction.
Reference implementation
The example uses a closed route catalog. The HTTP transport is intentionally absent: this isolates the architectural decision from credentials and network effects.
1package architecture
2
3import "fmt"
4
5// Route selects a fixed read-only endpoint, not a model-supplied URL.
6func Route(tool string) (string, string, error) {
7 switch tool {
8 case "health": return "GET", "/api/v5/btc/health", nil
9 case "balance": return "POST", "/api/v5/btc/wallet/balance", nil
10 case "utxos": return "POST", "/api/v5/btc/wallet/utxos", nil
11 default: return "", "", fmt.Errorf("unsupported tool %q", tool)
12 }
13}Security and limitations
A malicious or mistaken model might invent a route or request recovery. Unknown tools must fail closed. The catalog is not authorization; wallet-specific policy is still required.
Applying the pattern
Keep the model-facing interface separate from trusted execution. Review the current engine API before mapping fields or response data. Use a dedicated test wallet and explicit network configuration for any future live evaluation. The example does not change the engine, its signed fee law, or Bitcoin Core.
