Auditing Bitcoin Transactions Requested by AI Agents
THAMER engineering research — November 2026. This article is a design study, not an announcement of a completed integration.
The engineering question
An audit trail should show why a machine proposed a payment and who authorized it.
The interesting part of Bitcoin integration is rarely the HTTP call itself. A wallet can report a balance or broadcast a transaction, but the surrounding software must decide what the transfer means, who may request it, and when it is considered complete. This article examines one narrow design question so developers can reason about that boundary before writing production code.
Proposed architecture
Record proposal creation, policy evaluation, human review, execution request, transaction ID, and confirmation updates as separate events.
A useful reference architecture has four independent parts: an application producing an intent; a validator converting it into a well-defined request; an authorization layer enforcing the operator's policy; and a Bitcoin execution layer handling the actual wallet operation. A separate reconciliation worker should compare application records with the transaction state observed through the Bitcoin node. Keeping these parts independent helps developers test business rules without holding live signing credentials.
For a local deployment, use a private service endpoint and explicit network selection. A testnet prototype is preferable to a mainnet experiment. Define every satoshi amount as an integer, distinguish receiving addresses from identities, and preserve request identifiers across retries. Keep business records outside the wallet engine: a transaction ID is not a complete trade, invoice, tournament result, or employment contract.
Existing Bitcoin foundation versus future application
The WAB project documents a self-hosted Bitcoin wallet engine accessed through authenticated CURL/JSON requests. Tested workflows include receiving addresses, balances, UTXOs, sending Bitcoin, transaction status, and incoming-payment monitoring. SegWit and Taproot are part of the wallet model. The separate Factory creates wallet identity and the signed permanent fee law at birth; the engine operates the wallet under its verified law.
This article does not claim that the proposed ai agents application is already implemented. The existing engine is a Bitcoin execution component. Trading strategies, AI model inference, escrow, exchange matching, game logic, accounting, and commerce workflows require their own software and controls. A self-hosted node also still needs Bitcoin network connectivity.
Security and policy boundary
Redact wallet credentials and private prompts; store stable request identifiers and hash-linked event records where useful.
Sensitive operations should be authorized at the point of execution. Do not rely on a chat prompt, a browser button, a client-side check, or an unsigned event as the sole spending control. Never place BTC KEY, BTC SECRET, or recovery material in a public repository, a model context window, a screenshot, or an analytics event. A model or integration client should receive only the minimum capability needed for its task.
Failure scenario to test
Logs can leak addresses or sensitive business context, and log integrity does not prove the underlying decision was correct.
The integration should explicitly distinguish a request that was rejected, a request whose outcome is unknown, a transaction observed in the mempool, and a transaction confirmed on-chain. Mempool observation is not finality. On retries, use a stable idempotency reference where supported and query transaction status rather than assuming that a timeout means no transfer occurred. Consider network interruption, malformed input, duplicated events, and chain reorganizations as ordinary test cases.
A concrete testnet experiment
Design an append-only audit event schema and a replay test for duplicate requests.
Record the test inputs, expected response shapes, and acceptance criteria before running the experiment. A successful result should include both an application-level state transition and independent wallet-state reconciliation. Publish sanitized sample JSON and a short postmortem of failures; never publish real keys or sensitive addresses. Keep test-only interfaces separate from mainnet configuration.
What this could enable
The broader goal is to make programmable Bitcoin infrastructure useful to independent software developers. Go services, Python automation, Rust CLIs, and Shell scripts can all interact with a stable local interface without reimplementing the wallet's core cryptography. Each application may choose its own business model and interface, provided it respects the wallet's authorization and immutable fee-law boundaries.
That openness is a research direction rather than a product-completeness claim. The best next milestone is a reproducible prototype with clear permissions and honest failure behavior, not a promise that every possible integration already exists.
External references
- Bitcoin developer reference: https://developer.bitcoin.org/reference/
- OWASP LLM prompt injection guidance: https://genai.owasp.org/llmrisk/llm01-prompt-injection/
These are external documentation and background resources, not proof of a WAB integration or an endorsement of this design. Verify the current upstream specifications before implementation.
