delvingbitcoin

Mempool Based Fee Estimation on Bitcoin Core

Mempool Based Fee Estimation on Bitcoin Core

Original Postby ismaelsadeeq

Posted on: March 21, 2024 16:27 UTC

Mempool-based fee estimation is an approach utilized by Bitcoin Core for generating a more accurate fee rate for transactions.

This method leverages the transactions within a node's mempool to create a block template, using the fee rate at the 50th percentile of this template as the recommended fee rate for upcoming transactions. This strategy assumes that miners are crafting their next block templates from their mempools, suggesting that transactions matching this fee rate are likely to be included in the next block. Such an estimation technique is particularly beneficial when the mempool is congested or when there's a significant variance in confirmation times, as it swiftly adapts to these changing conditions.

However, this mempool-based approach does have its limitations. Discrepancies between a node’s mempool and the network miners' mempool can lead to inaccurate estimations. These discrepancies may arise due to differences in policy rules, the level of connectivity a node has within the network, or if miners prioritize transactions through channels outside the peer-to-peer network. Additionally, estimating fees for transactions that aim for confirmation beyond the next block can be unreliable due to potential changes in mempool conditions.

To address the potential misalignment between a node's mempool and those of miners, sanity checks are proposed. These checks involve analyzing previously mined blocks and the transactions within a node's mempool at the time of those blocks' arrival, aiming to ensure the node's mempool is in sync with the miners'. However, it's important to note that such sanity checks might not always accurately reflect the current state of alignment between a node's mempool and that of the miners.

The implementation of mempool-based fee estimation faces technical challenges, particularly concerning the efficiency of building block templates immediately after a new block is connected. While the process is expected to become less resource-intensive with future improvements like Cluster Mempool, concerns remain regarding the potential for slowing down block propagation within the network.

Despite these challenges, the potential for a mempool-based fee estimator is acknowledged. An experimental RPC could offer this feature without the full implementation of sanity checks, allowing users to manually apply this estimation method. This approach is being explored alongside traditional fee estimation methods, with ongoing analysis to compare its accuracy against confirmed transaction fee rates. A mempool-based fee estimator without any sanity check is under development, demonstrating promising results in aligning closely with actual block median fee rates. Further research and development efforts, including contributions from various developers, continue to refine and assess the viability of this mempool-based fee estimation method.