THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

OpenAI Responses API and Function Calling for a Local Bitcoin Agent

permalink THAMER
#bitcoin-engine#function-calling#openai-responses-api#wab

The proposed first implementation of WAB agents uses the OpenAI Responses API and function calling. It does not require creating an OpenAI-hosted agent in the Agents dashboard.

A model is not an executor

A language model can return a structured request such as RECEIVE, BALANCE, or SEND. The model does not directly possess a Bitcoin RPC credential, a shell, or the BTC KEY. A local Go program parses the request, validates it against a role-specific allowlist, and decides whether any action is authorized.

A simplified conceptual loop is:

User -> Local Agent -> Responses API
                       -> Proposed function call
Local Go -> Validate role, arguments, authorization
         -> Existing Bitcoin Engine HTTP JSON
         -> Tool result -> GPT response to user

The actual Responses API tool-call exchange must follow the currently documented request and response schema; this diagram is an architectural contract, not a copy-and-paste API payload.

Narrow function definitions

PAY exposes RECEIVE, BALANCE, and SEND. SELLER exposes payment monitoring rather than spending. The tool list is generated from the compiled role and local policy, not from an editable system prompt alone. Unexpected function names or malformed arguments fail closed.

For SEND, the executor requires the owner's separate authorization, spending limits, idempotency, and careful handling of ambiguous broadcast results. A conversational statement like 'yes, send it' should not be treated as a substitute for the local authorization path.

Why not begin with hosted Agents API?

The Agents API is a distinct orchestration approach involving managed agents, environments, sessions, and events. WAB's initial goal is simpler: the operator owns a Docker container and runs a bounded .so agent locally. Direct Responses API calls allow the Go runtime to retain control over state, secrets, and wallet operations.

Hosted orchestration could be evaluated later if it provides concrete value without weakening the local security boundary.

Operational checks

Test unknown tool names, prompt injection, invalid Bitcoin addresses, duplicate calls, provider outages, retries, timeouts, and attempted disclosure of secrets. Record tool outcomes without logging sensitive credentials.

Status: Proposed implementation plan. No production integration is asserted here.

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects