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 Payment Throughput Benchmark

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

Bitcoin Agent Payment Throughput Benchmark

Method and scope

Measure completed synthetic requests per second over a bounded batch. Count rejected and unknown outcomes separately; accepted requests are not confirmed payments. Use identical workload and worker count when comparing runs.

Independent reference implementation

Python · 20 lines
1from concurrent.futures import ThreadPoolExecutor
2from collections import Counter
3from time import perf_counter_ns
4
5def benchmark(handler, count=1000, workers=4):
6    if count < 1 or workers < 1:
7        raise ValueError("invalid workload")
8    start = perf_counter_ns()
9    with ThreadPoolExecutor(max_workers=workers) as pool:
10        outcomes = Counter(pool.map(handler, range(count)))
11    elapsed = max(1, perf_counter_ns()-start)
12    if set(outcomes) - {"accepted", "rejected", "unknown"}:
13        raise ValueError("unexpected outcome")
14    return {"counts": dict(outcomes), "elapsed_ns": elapsed,
15            "requests_per_second": count*1e9/elapsed}
16
17if __name__ == "__main__":
18    result = benchmark(lambda i: ("accepted", "rejected", "unknown")[i%3], 300)
19    assert result["counts"] == dict(accepted=100, rejected=100, unknown=100)
20    print(result)

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