Skip to content

Is there a way to specify the absolute fee of a transaction? #41

Closed
bitcoindevkit/bdk-tx
#31

Description

@ValuedMammal

Additional Context

bitcoindevkit/bdk_wallet#297 (comment)

I think a straightforward approach is to set a target feerate of 0 and add the fee amount to the output value_sum. The effect is to raise the cost of meeting the target by the amount of the target fee.

bitcoindevkit/bdk_wallet#297 (comment)

I think it's a better to include BOTH a min-feerate target and a min-absolute-fee target and not have the caller choose either-or.

Activity

  1. aagbotemi commented on Oct 28, 2025

    @aagbotemi
    Contributor

    Yes, we can add the absolute_fee field to SelectorParams, and from the target_outputs we can add the absolute fee to the value_sum, then we can set the target_feerate to ZERO

  2. self-assigned this
    on Oct 28, 2025
  3. ValuedMammal commented on Feb 23, 2026

    @ValuedMammal
    Author

    There's probably a less hacky way by providing the appropriate API using the Target type.

  4. murchandamus commented on Feb 23, 2026

    @murchandamus

    I’m curious, @ValuedMammal, what is the underlying use case where you would want to do that? Since you don’t know how many inputs your transaction will use in advance, and your transaction is competing on basis of feerate, wanting to set the absolute fee instead seems inefficient to me.

  5. ValuedMammal commented on Feb 24, 2026

    @ValuedMammal
    Author

    what is the underlying use case where you would want to do that? Since you don’t know how many inputs your transaction will use in advance, and your transaction is competing on basis of feerate, wanting to set the absolute fee instead seems inefficient to me.

    For the sake of discussion maybe you want to make a payment with a round number of sats and don't particularly care about the rate. For CPFP, maybe you know the inputs and want to know the child fee needed to bump the package to a target feerate. Maybe you need to satisfy two constraints simultaneously for some other reason. I hear your point about the case where the input selection is unknown though.

  6. murchandamus commented on Feb 25, 2026

    @murchandamus

    Thanks for satisfying my curiosity.

    (Not on-topic, but if it’s of interest: we added bump fee calculation to Bitcoin Core, so when a user is trying to send a CPFP, it’ll add the necessary fees to the child to make its ancestor package have the requested effective feerate.)

  7. evanlinjin commented on Aug 11, 2026

    @evanlinjin
    Member

    Implemented in #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions