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 Failure Recovery Benchmark

permalink THAMER
#ai-agents#benchmarking#bitcoin#python

Bitcoin Agent Failure Recovery Benchmark

Method and scope

Inject a lost response after a synthetic commit, reopen durable state, and measure reconciliation time. Unknown evidence must remain unresolved; absence of a local record does not prove a Bitcoin payment failed. No retry or broadcast is performed.

Independent reference implementation

Python · 22 lines
1import sqlite3
2from pathlib import Path
3from tempfile import TemporaryDirectory
4from time import perf_counter_ns
5
6def recover(path, request_id):
7    start = perf_counter_ns()
8    with sqlite3.connect(path) as db:
9        row = db.execute("SELECT evidence FROM outcomes WHERE id=?", (request_id,)).fetchone()
10    return (row[0] if row else "unknown", perf_counter_ns()-start)
11
12if __name__ == "__main__":
13    with TemporaryDirectory() as directory:
14        path = Path(directory)/"outcomes.db"
15        with sqlite3.connect(path) as db:
16            db.execute("CREATE TABLE outcomes(id TEXT PRIMARY KEY, evidence TEXT)")
17            db.execute("INSERT INTO outcomes VALUES (?,?)", ("r1", "synthetic-committed"))
18        # Simulate lost acknowledgement by discarding the original response.
19        evidence, elapsed = recover(path, "r1")
20        assert evidence == "synthetic-committed"
21        assert recover(path, "missing")[0] == "unknown"
22        print({"reconciliation_ns": elapsed, "evidence": evidence})

Reproducibility

Run the example with Python 3. Record the Python version, host resources and workload parameters. Repeat measurements on an idle host and report variation rather than selecting the fastest run. The assertions verify synthetic behavior only. No wallet credentials, live SEND or changes to the immutable fee law are involved.

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