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

Bitcoin Agent Spending Policy Revocation

permalink THAMER
#ai-agents#bitcoin#python#spending-policy

Bitcoin Agent Spending Policy Revocation

Design and trust boundary

Use a monotonically increasing policy epoch to invalidate queued approvals after a policy change. Recheck at the trusted execution boundary. Revocation cannot undo a broadcast or guarantee cancellation of an in-flight request; serialize policy changes and dispatch where possible and reconcile uncertain outcomes.

Independent reference implementation

Python · 15 lines
1"""Offline educational example; no wallet calls."""
2def can_dispatch(policy, approval, intent_digest):
3    return (policy["enabled"] is True and
4            type(policy["epoch"]) is int and type(approval["epoch"]) is int and
5            policy["epoch"] == approval["epoch"] and
6            policy["wallet"] == approval["wallet"] and
7            type(intent_digest) is str and bool(intent_digest) and
8            approval["digest"] == intent_digest)
9
10p = dict(enabled=True,epoch=3,wallet="w")
11a = dict(epoch=3,wallet="w",digest="fixture")
12assert can_dispatch(p,a,"fixture")
13assert not can_dispatch(dict(p,epoch=4),a,"fixture")
14assert not can_dispatch(dict(p,enabled=False),a,"fixture")
15assert not can_dispatch(p,a,"other")

Operational boundaries

All amounts are integer satoshis. This offline example assumes trusted policy inputs and does not authenticate a caller or execute SEND. Production requires durable state, exact intent binding, stable idempotency and reconciliation of uncertain broadcasts. The external policy must not modify the immutable wallet fee law.

Related research

https://thamer.org/learn/bitcoin-for-ai-agents-open-integration-guide

https://thamer.org/api

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