Skip to content

bump_fee --shrink sends the wallet's change to the address instead of reducing that output #399

Todo

Description

@tvpeter

Describe the bug

bump_fee --shrink <ADDRESS> is documented as "Allows the wallet to reduce the amount to the specified address in order to increase fees." It doesn't do that. The handler only calls drain_to with the address's script:

let mut tx_builder = wallet.build_fee_bump(self.txid)?;
if let Some(address) = &self.shrink_address {
    tx_builder.drain_to(address.script_pubkey());
}

build_fee_bump removes the wallet's change output and keeps every other output as a recipient with its original, fixed amount. drain_to only changes where the leftover after the new fee goes. So --shrink really means "send the change to this address": no recipient output is ever reduced.

This causes two problems:

  • The change goes to the recipient. Passing the recipient's own address, as the help text suggests, adds a second output to that recipient containing the wallet's entire change.
  • The intended use doesn't work. A send-all transaction has no change output, so its recipient output can't be shrunk and the bump fails with Insufficient funds.

To Reproduce

Regtest, a bdk-cli wallet with two 1 BTC UTXOs, synced through the rpc backend. R, O and R2 are addresses from another wallet.

Case 1: a transaction with change

bdk-cli -n regtest wallet -w w create_tx --to <R>:100000 --fee_rate 1

Then sign, broadcast and sync, and bump:

bdk-cli -n regtest wallet -w w bump_fee --txid <TXID> --fee_rate 10 --shrink <R>

With --shrink R, R's original output is unchanged and R also receives the wallet's change, about 0.999 BTC.

Case 2: a send-all transaction (no change)

bdk-cli -n regtest wallet -w w create_tx --send_all --to <R2>:0 --fee_rate 1

Then sign, broadcast and sync, and bump:

bdk-cli -n regtest wallet -w w bump_fee --txid <TXID> --fee_rate 10 --shrink <R2>

Error: Create transaction error: Insufficient funds: 1.99899859 BTC available of 1.99901456 BTC needed

The output is the same without --shrink. R2's output is never reduced.

Expected behavior

--shrink <ADDRESS> should take the extra fee out of the original output that pays <ADDRESS>:

  • If the original transaction has no output paying , the command should fail with a clear error instead of quietly redirecting the change.
  • For a send-all transaction, the bump should succeed, with the recipient's output reduced by the fee difference.

Build environment

  • BDK-CLI tag/commit: 06191e5
  • OS+version: macOS 27.2.1,
  • Rust/Cargo version: rustc 1.100.1 (20ddd0171 2026-11-25)
  • Rust/Cargo target: aarch64-apple-darwin

Activity

  1. added
    bug
    on Dec 3, 2026
  2. self-assigned this
    on Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

  • Status
    Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions