Analyzing Mining Pool Behavior to Address Bitcoin Core’s Double Coinbase Reservation Issue

Analyzing Mining Pool Behavior to Address Bitcoin Core’s Double Coinbase Reservation Issue
Pie Chart showing estimation of hashrate distribution amongst the largest mining pools from 2022 to 2024.

Written by Sadiq Ismail

In theory, Bitcoin Core’s block-building algorithm reserves 4,000 WU for miners’ coinbase transactions. This means it should generate a block template with a weight of 3,996,000 WU.

However, in practice, this is not the case due to an accidental double-reservation bug (see #21950). As a result, Bitcoin Core generates block templates with a weight of 3,992,000 WU.

There is an ongoing attempt to fix this issue (see #31384), but there are concerns that fixing the issue could lead to some miners generating invalid block templates.


If the PR were to be merged, mining pools using the updated Bitcoin Core version must ensure the sum of the coinbase transaction weight and the weight of all additional transactions added to the block template does not exceed 4,000 WU. Otherwise, the block will exceed the consensus limit for the maximum block weight (4,000,000 WU) and be invalid.

The proposed PR fixes the double-reservation issue, increasing the block template size by 4,000 WU. This results in blocks with a weight of 3,996,000 WU, aligning with theoretical expectations.

Miners or pools needing more than 4,000 WU for their coinbase transactions should configure bitcoind with a lower -blockmaxweight option. For example, starting Bitcoin Core with -blockmaxweight=3999000 will free up an additional 1,000 WU.

The purpose of this analysis is to examine mining pool behavior and determine the feasibility of this change.

  • Blocks Analyzed: 107,313
  • Period: 24th December 2022 to 23rd December 2024

Methodology

  • I used libbitcoinkernel to read blocks from disk.
  • Each block is deserialized, and bitcoin-data/mining-pools tags are used to match the block to a mining pool. The block weight, coinbase transaction, and mining pool information are then saved to disk.
  • After collecting the data for the entire block interval, I generated the analysis results using this script.
  • Charts were generated using a set of scripts.
  • More details on the methodology can be found on GitHub - ismaelsadeeq/mining-analysis.

Results

Pools Generating Blocks with Coinbase Weight > 4000 WU

Pool NameAvg. Coinbase WeightAvg. Block WeightMin. Coinbase Weight (Height)Min. Block WeightMax. Coinbase Weight (Height)Max. Block Weight
Ocean.xyz69943,988,1375308 (865820)3,986,4899272 (863471)3,990,301
Unknown pool7432958,8317000 (824116)1,887,4377864 (785117)30,225

Figure 1: Box Plot of Coinbase Transaction Weights > 4000 WU

This box plot shows the distribution of coinbase transaction weights for pools generating blocks with coinbase weights greater than 4000 WU.

Large Coinbase Transaction Weights

Pools with Blocks (> 3,996,000 WU)

Pool NameAvg. Block WeightMin. Block WeightMin. Coinbase Weight (Height)Max. Block WeightMax. Coinbase Weight (Height)
F2Pool3,997,8573,994,044 (828959)1724 (800183)3,998,554 (779729)1364 (786721)

Remaining pools with Blocks (< 3,996,000 WU)

Pool NameAvg. Block WeightMin. Block WeightMin. Coinbase Weight (Height)Max. Block WeightMax. Coinbase Weight (Height)
Foundry USA3,993,0303,992,749 (813879)748 (813879)3,993,523 (874770)1192 (874770)
Binance Pool3,993,3483,992,753 (784937)748 (784937)3,993,768 (846996)1440 (846996)
MARA Pool3,993,0173,992,721 (802653)720 (802653)3,994,944 (859968)904 (859968)
Luxor3,993,4343,992,782 (768718)780 (768718)3,993,811 (841510)1480 (841510)
AntPool3,993,5543,992,868 (814783)732 (814783)3,993,918 (873367)1612 (873367)
ViaBTC3,993,3243,992,881 (782955)880 (782955)3,993,612 (872513)1284 (872513)
Poolin3,993,3083,992,987 (855538)904 (855538)3,993,613 (795979)1336 (795979)
Braiins Pool3,993,2513,992,695 (853433)684 (853433)3,993,416 (853776)1124 (853776)
SBI Crypto3,992,9113,992,717 (796840)716 (796840)3,993,047 (834797)716 (834797)
Ultimus Pool3,993,4073,993,076 (852748)1056 (852748)3,993,768 (842345)1440 (842345)
BTC.com3,993,3993,992,745 (796409)740 (796409)3,993,781 (806063)1472 (806063)
SpiderPool3,993,1903,992,912 (856599)892 (856599)3,993,616 (864899)1288 (864899)
WhitePool3,993,0723,992,677 (825268)676 (825268)3,993,631 (872281)1304 (872281)
Ocean.xyz3,988,1373,986,489 (865820)5308 (865820)3,990,301 (863471)9272 (863471)
EMCDPool3,993,2733,993,081 (781934)1080 (781934)3,993,428 (796046)1304 (796046)
Pega Pool3,992,8943,992,690 (783729)688 (783729)3,993,018 (781576)688 (781576)
Titan3,992,9743,992,926 (768641)696 (768641)3,993,020 (769939)696 (769939)
KuCoin Pool3,993,2823,993,101 (781030)1092 (781030)3,993,504 (796188)1316 (796188)
Terra Pool3,993,0323,992,863 (776927)844 (776927)3,993,172 (780396)844 (780396)
CleanIncentive3,992,9463,992,748 (823029)728 (823029)3,993,038 (822604)728 (822604)
1THash3,993,2763,993,085 (837937)1084 (837937)3,993,412 (814830)1084 (814830)
NiceHash3,992,9873,992,782 (789503)780 (789503)3,993,148 (785085)820 (785085)
CKPool3,993,1023,992,897 (863890)856 (863890)3,993,181 (822636)856 (822636)

Figure 2: Line Chart of Coinbase Transaction Weights

This line chart shows the average, minimum, and maximum coinbase transaction weights for various mining pools.

Large Coinbase Transaction Weights

Figure 3: Line Chart of Mining pool block Weights

This line chart shows the average, minimum, and maximum block weights for various mining pools.

Block Weights for Pools

Key Observations

  • Most mining pools adhere to Bitcoin Core’s default setup, keeping coinbase transaction weights well below 4,000 WU. However, two pools stand out:
    • Ocean.xyz consistently uses larger coinbase transactions, with an average weight of 6,994 WU. Their smallest coinbase weight was 5,308 WU (in block 865820), and their largest reached 9,272 WU (block 863471). This suggests Ocean.xyz configures its node with a reduced -blockmaxweight setting, as their average block size is 3,986,489 WU, well below the default template size.
    • An unknown pool/miner also exceeded the default coinbase weight, averaging 7,432 WU, with a maximum of 7,864 WU. However, their very low block weight average is unusual behavior.
  • F2Pool blocks have an average weight of 3,997,857 WU. For instance, block 779729 reached 3,998,554 WU with a coinbase weight of just 1,588 WU, showcasing F2 optimal use of the available block weight.
  • The majority of pools—such as Foundry USA, Binance Pool, and AntPool—produce blocks averaging around 3,993,000 WU, consistent with Bitcoin Core’s current behavior. However, this depicts underutilization, which is a direct result of the double-reservation bug.
  • The small increase in the weights of the blocks after selecting the transactions is accounted for the block headers, as noted by @0xB10C here

If the double-reservation issue is fixed, block templates will increase to 3,996,000 WU, aligning theoretical and actual limits. This change benefits pools by allowing full utilization of the block weight while preserving 4000 WU for coinbase transactions and other small additions.

Miners who need more space, such as Ocean.xyz, can still configure their nodes with a reduced -blockmaxweight. For example, setting it to 3,999,000 WU frees up 1000 WU for larger coinbase transactions, ensuring compliance with consensus rules.

In conclusion, addressing this bug will enhance fairness across the mining pools and fix the ambiguity for developers working with the bitcoin core codebase.