Concurrent Bitcoin Agent Wallet Request Benchmark
Concurrent Bitcoin Agent Wallet Request Benchmark
Method and scope
Exercise a bounded concurrent read workload with a synthetic wallet snapshot. Verify that every request returns the expected immutable result. This does not measure Bitcoin Core RPC concurrency or exercise SEND.
Independent reference implementation
1from concurrent.futures import ThreadPoolExecutor
2from time import perf_counter_ns
3
4def run(read, expected, count=200, workers=8):
5 if count < 1 or workers < 1:
6 raise ValueError("invalid workload")
7 def check(i):
8 start = perf_counter_ns()
9 try:
10 valid = read(i) == expected
11 except Exception:
12 valid = False
13 return valid, perf_counter_ns()-start
14 with ThreadPoolExecutor(max_workers=workers) as pool:
15 results = list(pool.map(check, range(count)))
16 return {"requests": count, "mismatches": sum(not ok for ok, _ in results),
17 "max_ns": max(t for _, t in results)}
18
19if __name__ == "__main__":
20 snapshot = ("test", 12000)
21 assert run(lambda _: snapshot, snapshot)["mismatches"] == 0
22 assert run(lambda _: None, snapshot)["mismatches"] == 200
23 print(run(lambda _: snapshot, snapshot))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
