Skip to content

feat(wallet): add configurable min_output_value filter#427

Open
noahjoeris wants to merge 2 commits into
bitcoindevkit:masterfrom
noahjoeris:feat/issue375
Open

feat(wallet): add configurable min_output_value filter#427
noahjoeris wants to merge 2 commits into
bitcoindevkit:masterfrom
noahjoeris:feat/issue375

Conversation

@noahjoeris

@noahjoeris noahjoeris commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a runtime-only min_output_value: Option<Amount> setting to Wallet for dust/spam filtering. It filters wallet-visible spendable value in balance, list_unspent, and automatic coin selection without changing accounting functions.

Closes #375

Notes to the reviewers

  • Named min_output_value rather than dust_threshold to avoid confusion with the existing coin selection dust_threshold and Bitcoin's relay dust policy.
  • Not persisted; treated as a runtime filter applied on top of stored wallet state. It can be provided when creating/loading via CreateParams::min_output_value() / LoadParams::min_output_value(), or changed at runtime via Wallet::set_min_output_value().
  • Filtering is applied in bdk_wallet, not pushed down into bdk_chain.

Changelog notice

  • Added runtime min_output_value support to Wallet, CreateParams, and LoadParams
  • balance, list_unspent, and coin selection now honor min_output_value

Checklists

All Submissions:

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

@codecov

codecov Bot commented Apr 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.15%. Comparing base (275406e) to head (b0afce7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #427      +/-   ##
==========================================
+ Coverage   80.96%   81.15%   +0.19%     
==========================================
  Files          24       24              
  Lines        5489     5530      +41     
  Branches      247      247              
==========================================
+ Hits         4444     4488      +44     
+ Misses        968      965       -3     
  Partials       77       77              
Flag Coverage Δ
rust 81.15% <100.00%> (+0.19%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dmenec

Dmenec commented May 28, 2026

Copy link
Copy Markdown
Contributor

Concept ACK. Related with the sent_and_received / net_value approach, why apply min_output_value to transaction accounting methods? A tx already broadcast moved exactly what it moved on-chain. I'd expect the threshold to act as an operational filter for UTXO management, but not change how historical transactions are reported. Maybe I'm ignoring some use case...

Also, #431 rewrites balance() for trusted/untrusted pending classification, worth a look as both touch the same function.

Adds runtime-only min_output_value to Wallet for operational dust filtering on balance, list_unspent, and coin selection. Accounting/history methods (sent_and_received, tx_details, list_output) remain factual.
@noahjoeris

noahjoeris commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Yes agree, thanks. I think I included it because #375 asked for it too. Bit weird in hindsight and can cause inconsistencies. So the key parts to filter are list_unspent, balance, and coin selection. I updated in latest push.
Will rebase once your PR lands

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

Labels

new feature New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Add a global dust filter setting, idealy configurable amount

3 participants