Skip to content

[feature]: #10294

@pranav-punjabi

Description

@pranav-punjabi

I have a question regarding coin selection and fee estimation in LND.

suppose a merchant, receive payments in sats, which results in many small UTXOs spread across multiple addresses for example, several $100 UTXOs or similar-sized ones.

  • By default, LND seems to prefer picking larger UTXOs for efficient transactions, which makes sense.
  • However, when I explicitly set the coin selection strategy to RANDOM, LND often selects many smaller UTXOs to complete a payment.
  • This increases the overall transaction size and, therefore, the total fee.

Here’s the issue I’m facing:

  1. When I call EstimateFee with CoinSelectionStrategy = RANDOM, the node picks one random combination of UTXOs to estimate the fee.

  2. A few seconds later, when I call SendCoins (also with CoinSelectionStrategy = RANDOM), it picks a different random set of UTXOs.

  3. Because of this, the actual transaction size — and therefore the actual fee — can differ a lot from the estimated value.

So the fee estimation becomes unpredictable.

My question:

  • Would it be possible for the EstimateFee API response to include which UTXOs were used for the estimation (their outpoints), so that we can pass those exact UTXOs in the SendCoins request?

  • That way, we could eliminate this randomness and achieve predictable behavior between estimation and execution.

Additionally :

  1. Do you have any suggestions or recommended practices for UTXO management in this scenario?
    For example, does LND provide a built-in mechanism to consolidate UTXOs automatically when network fees are low or when the number of small UTXOs crosses a threshold?

  2. Or How should we handle consolidation manually (e.g., using SendCoins to self-addresses during low-fee periods) or any other aproch which is best for us?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovements to existing features / behaviour

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions