Full stack Bitcoin software

Mining Performance

Mining performance of Bitcoin Server (bs) with Bitcoin Core comparisons, block template fees, transaction intake, stratum job latency and mining RPC times.

Template Fees#

Template fee is the total fee of the transactions in a block template, Libbitcoin's relative to Bitcoin Core's from the same transactions. Each of 200 Monte Carlo trials draws a mix of four workloads (independent transactions, chains, conflicts and conflict trees), lognormal fee rates (median 3 sat/vB) and 1.5 to 3 blocks of signed transactions in random arrival order. The same transactions go to both nodes over P2P, both pools settle, and each node gives one getblocktemplate. Libbitcoin's template fee is 4.57% higher on average (95% bootstrap interval +3.90 to +5.29%, median +2.64%), and is higher or equal in 195 of 200 trials. The five Bitcoin Core wins were by at most 17,621 satoshis, against a mean Libbitcoin gain of 673,247. Template weights were nearly identical (3,997,490 and 3,997,487 WU).

The gain rises with the share of conflict trees: +12.45% where they are half or more of the transactions, +0.55% under 10%. Bitcoin Core keeps one transaction per conflicted output, chosen by its replacement rules in arrival order, and rejects the children of those it refused. Libbitcoin keeps every conflicting transaction and chooses the best combination when it builds the template, scoring each branch whole, parent with descendants. Volume makes little difference.

The fixed workloads isolate each kind, five seeds each: 10,000 independent transactions, 10,000 conflicts (4 per output), 10,000 in chains 25 deep, and 9,000 in conflict trees (3 rivals, 3 deep). Independent transactions and chains give identical templates. Conflicts without children are at parity (+0.003%), since each conflicting transaction draws its fee independently and the replacement rules usually end on the highest. Conflict trees gain 20.93% (+18.81 to +25.10%), where Bitcoin Core kept 2,915 of the 9,000 transactions. Every template from both nodes, 400 in the Monte Carlo and 40 in the fixed workloads, passed Bitcoin Core's block validity test.

Transaction Intake#

Each node in turn takes the same signed transactions over loopback P2P, announced by inv and served on getdata. Rate is transactions offered over the time to the last pool change, and CPU is process CPU per pooled transaction. Libbitcoin takes 4,577 to 4,808 transactions per second on every workload, 1.3 to 3.7 times Bitcoin Core's 1,265 to 3,410. On independent transactions and chains it spends more CPU per transaction (349 to 356 µs against 198 to 206). On conflicts and conflict trees, where Bitcoin Core keeps one transaction per conflicted output, Libbitcoin spends less per transaction (369 and 360 µs) than Bitcoin Core spends per transaction it keeps (602 and 730).

The Libbitcoin regtest store has tables sized for the chain, as a mainnet store has. On a store with regtest default tables, holding 3.4 million chain transactions after the Monte Carlo trials, intake fell to 2,000 to 2,300 transactions per second from long hash chains.

Mining Jobs#

A miner works a stale job from the moment a block is found until its pool sends a new one. Libbitcoin serves stratum v1 itself. Bitcoin Core is fronted by ckpool, which learns of a block by Bitcoin Core's interprocess communication (IPC) mining interface, by ZMQ block notification, or by polling every 100 ms. On regtest, a miner mines 20 empty blocks 4 seconds apart, with 3,000 and then 10,000 independent transactions pooled, and each stack's first mining.notify is timed from the miner's generateblock call. Every first job carried the full template. Median, at 3,000 and 10,000 pooled: Libbitcoin 14 and 27 ms, ckpool by IPC 150 and 272 ms, by ZMQ 376 and 1,400 ms, by polling 394 and 1,360 ms.

A Libbitcoin job is the held template's coinbase parts and merkle branch. ckpool must have Bitcoin Core produce the full getblocktemplate, then fetch and parse it; IPC skips only the JSON and HTTP. On 55 mainnet blocks (977,441 to 977,495), Libbitcoin's first job followed its block organized by a median 66 ms, and ckpool's (polling) followed Bitcoin Core's tip update by 1,203 ms, on one probe clock.

Block to Template#

Each mainnet block from organized to template issued, split by Libbitcoin's diagnostic events into pool indexing, chain state, other wait, template computation and issue. The median is 61 ms (40 to 117): pool indexing 19 ms, chain state 0.016 ms, other wait 0.085 ms, computation 28 ms and issue 16 ms. The pool advances its chain state by one header per block and reads the store only at start or on a reorganization. Computation varies from about 12 to 90 ms with the work of packing what lands at the block's tail, scaled by the processor clock, since stratton's frequency governor runs timer-started builds near 1.2 GHz.

Live Mainnet#

Every 10 minutes, getblocktemplate from both nodes on the same machine at the same height. The median template fee difference is +0.013%, Libbitcoin higher or equal in 34 of 57 rounds. The live pool is flat, its template tail near the relay floor, so packing differences are small; the gains appear where conflicts sit near the block boundary.

Median call times at the client: getblocktemplate 144.8 ms Libbitcoin and 160.5 ms Bitcoin Core, getrawmempool 77.9 and 192.7 ms, getmempoolinfo 5.6 and 1.1 ms, and estimatesmartfee 39.9 and 8.0 ms. Bitcoin Core returns estimatesmartfee from a cached estimate, while Libbitcoin computes it in full from the pool on each call.

Methodology#

Libbitcoin and Bitcoin Core 32.1 run on the same machine, stratton (2 x Xeon E5-2683 v4 32C/64T, 256 GB), and both reserve 2,332 WU and 400 sigops for the coinbase (Libbitcoin pool.coinbase_weight = 2000, Bitcoin Core blockreservedweight=2332). Regtest runs use a third Bitcoin Core node as the miner, and run Bitcoin Core without its regtest consistency checks (-checkmempool=0 -checkblockindex=0).

Template validity is tested by Bitcoin Core's generateblock with each template's transactions, not submitted, which checks scripts, spends, order, weight, sigops and fees. Conflicts are transactions spending the same output with no children, of which only one can confirm. Conflict trees are conflicts where each conflicting transaction also has descendants, so each branch is a package, as with a fee bump of a transaction that already has children, child-pays-for-parent on one version while another is broadcast, Lightning commitment variants with anchor spends, or competing coinjoin and payjoin attempts.

Copyright © 2011-2026 libbitcoin developers