Skip to content

feat(wallet): add configurable min_output_value filter#427

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

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

Conversation

@noahjoeris
Copy link
Copy Markdown

Description

Adds a runtime-only min_output_value: Option<Amount> setting to Wallet that filters outputs below a chosen threshold across wallet queries and coin selection. Useful for applications that want to ignore dust/spam outputs without reimplementing BDK's internal logic.

Closes #375

Affected methods: balance, list_unspent, list_output, sent_and_received, net_value, tx_details, and coin selection. get_utxo and fee calculations are intentionally not filtered.

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. The trade-off is that some methods are no longer thin wrappers around bdk_chain. This can be refactored downstream if desired.
  • Happy to discuss any of these decisions and update if necessary.

Changelog notice

  • Added runtime min_output_value support to Wallet, CreateParams, and LoadParams
  • Added Wallet::net_value
  • balance, list_unspent, list_output, sent_and_received, net_value, 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
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 98.43750% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 80.29%. Comparing base (4e202c8) to head (d7e147b).
⚠️ Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
src/wallet/mod.rs 98.07% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #427      +/-   ##
==========================================
+ Coverage   80.04%   80.29%   +0.25%     
==========================================
  Files          24       24              
  Lines        5336     5395      +59     
  Branches      242      245       +3     
==========================================
+ Hits         4271     4332      +61     
+ Misses        987      984       -3     
- Partials       78       79       +1     
Flag Coverage Δ
rust 80.29% <98.43%> (+0.25%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@ValuedMammal ValuedMammal added the new feature New feature or request label Apr 1, 2026
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

2 participants