Describe the enhancement
Floresta currently returns a hardcoded value (0.0001 BTC/kB) for the Electrum blockchain.estimatefee RPC call. This enhancement proposes adding a real fee estimation mechanism to Floresta core, derived from either the mempool or recent block fee rates, and exposing it through libfloresta APIs so downstream consumers can query it.
Use case
Downstream projects such as bdk-floresta and wallets built on top of it need accurate fee rates for transaction building, RBF, and fee bumping. With this feature, bdk-floresta can expose Node::estimate_fee() to wallet applications, replacing the current hardcoded or fallback fee rates.
Additional context
The current hardcoded value is documented in crates/floresta-electrum/src/electrum_protocol.rs with a // TODO: Ask Backend for fees comment. A possible starting point is the existing FeeRateIndexer example in crates/floresta/examples/indexer.rs, which demonstrates tracking the minimum fee rate from recently validated blocks using BlockConsumer::on_block with spent_utxos.
Describe the enhancement
Floresta currently returns a hardcoded value (
0.0001BTC/kB) for the Electrumblockchain.estimatefeeRPC call. This enhancement proposes adding a real fee estimation mechanism to Floresta core, derived from either the mempool or recent block fee rates, and exposing it throughlibflorestaAPIs so downstream consumers can query it.Use case
Downstream projects such as
bdk-florestaand wallets built on top of it need accurate fee rates for transaction building, RBF, and fee bumping. With this feature,bdk-florestacan exposeNode::estimate_fee()to wallet applications, replacing the current hardcoded or fallback fee rates.Additional context
The current hardcoded value is documented in
crates/floresta-electrum/src/electrum_protocol.rswith a// TODO: Ask Backend for feescomment. A possible starting point is the existingFeeRateIndexerexample incrates/floresta/examples/indexer.rs, which demonstrates tracking the minimum fee rate from recently validated blocks usingBlockConsumer::on_blockwithspent_utxos.