Skip to content

[Enhancement] Add real fee estimation to Floresta core and expose it via libfloresta APIs #1141

Description

@4xvgal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Fields

    No fields configured for Feature.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions