Bitcoin Agent Tool Execution Security
Bitcoin Agent Tool Execution Security
Design and trust boundary
Use a fixed operation registry rather than shell commands or model-provided URLs. A read-only role cannot invoke SEND even if a model requests it. The handlers here are offline stubs; production must authenticate the role and validate the complete request schema before dispatch.
Independent reference implementation
1def dispatch(role, operation, handlers):
2 allowed = {'reader': frozenset({'balance', 'receive'}), 'observer': frozenset({'balance'})}
3 if operation not in allowed.get(role, frozenset()):
4 raise PermissionError('operation denied')
5 return handlers[operation]()
6
7if __name__ == '__main__':
8 handlers = {'balance': lambda: 42, 'receive': lambda: 'fixture'}
9 assert dispatch('reader', 'balance', handlers) == 42
10 for role, op in [('reader', 'send'), ('observer', 'receive'), ('unknown', 'balance')]:
11 try:
12 dispatch(role, op, handlers)
13 except PermissionError:
14 continue
15 raise AssertionError('unexpected permission')Operational boundaries
This offline research example uses synthetic data. It does not execute SEND or modify the wallet birth fee law. A production deployment requires authenticated callers, durable state, tested failure handling and independent security review.
Related research
https://thamer.org/learn/bitcoin-for-ai-agents-open-integration-guide
https://thamer.org/api
