Wallet builds oversized transactions from mining dust; needs smarter coin selection and optional auto-consolidation #55
Labels
No labels
do-not-open-till-X-Day
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SubGeniusFinance/dobbscoin-source#55
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version: dobbscoin-qt 0.14.1 (protocol 70005), Windows 10
Problem
Wallets that receive regular mining payouts pile up thousands of small coins. The wallet then builds needlessly large transactions from them, and normal users have no way to know why or what to do about it. Manual consolidation, or Coin Control (hidden behind a setting), is expert-only knowledge.
Real-world example (2026-11-14)
Wallet contents:
Nearly all of the small coins are pool payouts to a single address: 3,058 payouts averaging about 4 BOB since a manual consolidation on 2026-10-10.
A send of 1,000 BOB (tx
ce91a7ba322b848d493a2436c6556745565ace40a925a07c35f43dd194cb64a9) used 23 inputs (22 payouts of about 8.5 BOB plus one 808 BOB coin), 4,208 bytes, with change of only 0.01004906, even though either of the two large coins could have covered it alone. The keys are uncompressed, so each input is about 180 bytes.Cause
Coin selection is the pre-0.17 Bitcoin knapsack (
ApproximateBestSubsetinsrc/wallet.cpp): it prefers a near-exact match from many small coins over one larger coin, in order to avoid change. Fees on this chain are cheap, but transaction size still makes sends slow to propagate, more likely to get stuck, and dangerous at scale. A wallet with 3,000+ small coins cannot be swept in one transaction under the 100,000-byte standard size limit (MAX_STANDARD_TX_SIZE).Proposal
Part A: coin selection (the main fix)
Part B: optional auto-consolidation (backstop for mining wallets)
Privacy note
Combining coins from different addresses publicly links them to one owner. Offer a "same-address only" mode. In the example above it would still cover nearly all of the small coins, since they sit on one payout address.
Related
Both parts are in EndTimes 0.21.2 beta 3: https://git.subgenius.finance/SubGeniusFinance/dobbscoin-source/releases/tag/v0.21.2-beta3
Part A, coin selection: when the knapsack's pick would take more than 20 coins and one larger coin covers the amount, the wallet spends the larger coin. On a copy of the wallet from this report, a 5,000 BOB send went from 1,059 inputs (about 157 KB, unrelayable) to 1 input, 119 bytes.
Part B, automatic merging: when more than 500 confirmed coins under 10 BOB sit on one address, the wallet merges up to 400 of them back onto that same address, one batch at a time, waiting for each to confirm. Same address only by default, so nothing gets linked (
-consolidatealllifts that); it pays back to the coins' own address rather than a fresh one, so a copy of a non-HD 0.14 wallet never moves coins out of the original's sight. Locked wallets wait for unlock, and it waits until the wallet has caught up with the chain. Shown in the list as "Auto coin merge (to yourself)"; off switch in Options > Wallet or-consolidate=0. Live test: 400 coins, 71,644 bytes, fee 0.00072219, confirmed in block 1,953,087.Leaving this open until the final 0.21.2 release.