Exposing Bitcoin Wallet Functions as AI Agent Tools
Research status: Theoretical SDK design. Examples are illustrative and have not been built or tested against the live engine.
Tool design
A tool adapter is a translation layer between a model-facing schema and a typed SDK. It should not expose raw URLs, headers or shell commands. Provide separate tools for balance, receive, transaction status and payment proposals. The executor selects the wallet and network from trusted configuration rather than accepting them from arbitrary conversation text.
Conceptual tool input
{
"name": "propose_bitcoin_payment",
"description": "Create a payment intent without broadcasting",
"parameters": {
"type": "object",
"properties": {
"destination": {"type": "string"},
"amount_sat": {"type": "integer", "minimum": 1}
},
"required": ["destination", "amount_sat"],
"additionalProperties": false
}
}This is an illustrative schema, not an engine endpoint. The adapter validates the address against the configured network and checks the amount against local policy. A model may provide a syntactically valid but unauthorized destination. Schema validation is therefore necessary but insufficient.
Tool outputs
Return a structured outcome with a status, observation time and correlation identifier. Distinguish local intent IDs from engine request IDs and transaction IDs. Do not return credentials or recovery material. Limit and sanitize untrusted text from external services; a transaction memo or error string is data, not an instruction to invoke another tool.
Dispatch and concurrency
Use an explicit allowlist of handlers. Reject unknown operations and extra arguments. Serialize conflicting operations for the same wallet where necessary, and keep a durable record of payment attempts. A model retry must not silently generate a fresh payment intent for the same authorized action.
Acceptance plan
Feed malformed amounts, wrong-network addresses, unexpected fields and adversarial text into the adapter. Assert that rejected calls do not reach the engine. Use fixtures for ambiguous transport outcomes and warming balances, then compare a permitted live testnet operation with the documented API. Tool schemas do not themselves grant spending authority.
Primary reference
https://thamer.org/api
Related reading
https://thamer.org/docs/wab-sdk-idempotency-retry-strategies
https://thamer.org/docs/wab-sdk-authentication-credential-management
https://thamer.org/docs/wab-sdk-ai-agent-design
https://thamer.org/docs/wab-sdk-openai-tool-interfaces
https://thamer.org/docs/wab-sdk-agent-spending-authorization
https://thamer.org/docs/wab-sdk-deterministic-ai-payments
https://thamer.org/docs/wab-sdk-mcp-wallet-tools
