Running the Exchange · Part 4On-chain Optimization

The Dust Problem: Crypto’s Hidden Operational Cost

Every transaction leaves a remainder. Across hundreds of millions of addresses on multiple chains, those remainders accumulate into a problem that compounds silently, costs real money, and never gets smaller as blockchain adoption grows.

6 min read📅June 23, 2026⚙️Engineering📈On-chain Optimization
Raajeev Reddy
Raajeev Reddy

Engineering leader with 15 years leading engineering organizations across blockchain, digital health, and media platforms.

In Part 3, we covered how the engineering team’s coin selection algorithm determines throughput, cost, and compliance long before any customer withdrawal arrives. Every design decision at restore time has consequences. One of those consequences, if the design is not deliberate, is dust.

Dust is one of those problems that seems minor until you see it at scale. At the scale I operated at Coinbase, the aggregate stranded value sitting in unrecoverable micro-balances across hundreds of millions of addresses was significant enough to make building a dedicated automated recovery system a company-wide engineering priority. The number was not a rounding error. It was a direct financial consequence of billions of transactions each leaving small remainders over time.

Hundreds of millions of addresses.
Each one a potential dust accumulation point. Built up one transaction at a time, across every chain the platform supports, forever.

What dust is and where it comes from

Dust is not a Bitcoin-specific problem. It occurs on Bitcoin through UTXO fragmentation, and on multiple other chains through the same fundamental dynamic: transactions leave remainders in addresses, and over time those remainders become too small to move economically.

On Bitcoin, every transaction that does not perfectly consume an input leaves a change output. That change output sits in an address. If the address is used again and again, the balance shrinks with each transaction until what remains is worth less than what it costs to move. On Ethereum and multiple other account-based chains, the same dynamic plays out differently but arrives at the same destination. Partial spends, failed transactions that return partial gas, and micro-balances left after fee deductions all leave residual value sitting in addresses that may never be economically worth touching again.

The root cause in every case is the same: the cost of executing a transaction on chain is not zero, and at some point the cost of moving a balance exceeds the value of that balance. At that threshold, the funds do not disappear. They sit on the books as an asset the platform cannot deploy. The gap between what the ledger says and what is actually movable is dust.

The gas economics that create the trap

The simplest way to understand dust is through the economics at a single address. Imagine an address holds roughly $0.70 worth of a token. The gas cost to move it is $0.80. It does not make sense to move it. You would be paying more to recover the funds than the funds are worth. That balance sits in the address indefinitely.

The good news is that Ethereum gas prices are significantly more predictable and cheaper today than they were during the 2021 and 2022 cycles. Following the Dencun upgrade in 2024 and the growth of Layer 2 adoption, average gas prices dropped by roughly 95%. A simple ETH transfer on mainnet in 2025 typically costs a few cents under normal conditions, compared to tens of dollars during peak congestion in earlier years. This predictability makes automated dust recovery systems more reliable than they used to be, because the fee market is less likely to spike unpredictably between the time a sweep is queued and when it confirms.

That said, gas is never fully static. During periods of sudden network demand, such as a major token launch, a DeFi liquidation cascade, or a popular NFT mint, fees can still rise meaningfully in a short window. An address worth sweeping at $0.05 gas may not be worth sweeping at $0.50 gas if the balance itself is only $0.70. The window can open and close within minutes.

Platforms develop internal recovery rules to make this tractable. A common approach is to only attempt recovery when the address balance is at least three times the current gas cost. At that ratio, even if gas moves against you during confirmation, the sweep still nets positive value. The specific multiplier varies by platform, chain, and risk tolerance. The principle is consistent: do not attempt recovery unless the economics provide enough margin to absorb fee market movement between broadcast and confirmation.

Diagram 1 — Address Recovery Snapshot: Same Balance, Different Gas Conditions
ADDRESSBALANCEGAS COSTRATIOSTATUS0x4f2a...8e91Same address · normal gas$0.70$0.800.9×STRANDED0x4f2a...8e91Same address · low-fee window$0.70$0.0514×RECOVERABLEsame address0x4f2a...8e91Same address · congestion spike$0.70$0.501.4×STRANDEDbc1q7x...km9zBTC address · larger balance$15.00$0.8018.75×RECOVERABLEbc1q9m...7xz2BTC address · exactly at threshold$2.40$0.803.0×AT THRESHOLDRatio = balance value ÷ gas cost. Minimum threshold for sweep: 3× (to absorb fee movement during confirmation).

This dynamic plays out simultaneously across hundreds of millions of addresses, on multiple chains, each with its own fee market moving independently. An address that is economically recoverable on Ethereum today may not be tomorrow. An address on Polygon that crosses the threshold at 10am UTC may fall back below it by noon. The recovery window is narrow, chain-specific, and constantly moving.

Important distinction: An unconfirmed transaction that never executes on chain does not consume gas. If a sweep is broadcast with insufficient gas and dropped from the mempool, the sender pays nothing. The risk is not wasted gas on failed attempts. The risk is operational: submitting too many competing sweep transactions at once can cause nonce conflicts on EVM chains, mempool congestion on UTXO chains, and monitoring complexity that obscures the true state of pending sweeps. A well-designed system does not fire-and-forget. It tracks every pending sweep, cancels or replaces transactions that have been waiting too long, and never queues a new sweep for an address that already has a pending transaction in flight.

Why the problem never shrinks

Here is the uncomfortable truth about dust: it is structurally permanent and grows with adoption.

Every new user creates new addresses. Every deposit creates a new address. Every withdrawal that does not perfectly consume a balance leaves a remainder. Every change output on a UTXO chain creates a new micro-balance. Every partial spend on an account-based chain leaves residual value. None of those addresses disappear. Blockchain state is permanent. The dust accumulates in addresses that will exist on chain forever, regardless of whether the platform ever recovers the value inside them.

As blockchain adoption grows, the number of addresses grows. As the number of addresses grows, the aggregate dust value grows. The only way to reduce it is to recover it faster than it accumulates, which requires a continuously running, economically aware, multi-chain sweep system that monitors fee markets in real time and acts within recovery windows that may last minutes.

At the scale I operated at Coinbase, hundreds of millions of addresses across multiple chains meant that even a small average dust balance per address aggregated into a number that the business could not ignore. The first time we ran a systematic sweep manually to understand the shape of the problem, the results were significant enough to make building an automated system a priority from that point forward.

How automated dust recovery works

A well-designed dust recovery system monitors three signals simultaneously and acts only when all three align.

Asset price. As the price of the underlying asset rises, the dollar value of micro-balances rises with it. An address holding 0.001 BTC that was worth $0.60 at $60,000 per BTC is worth $1.00 at $100,000 per BTC. The same balance, the same gas cost, but a different economic outcome. Rising asset prices open recovery windows that did not exist at lower prices.

Network gas price. Fee markets are cyclical. Ethereum gas tends to be lowest during off-peak hours in global trading sessions. Bitcoin mempool congestion follows transaction volume patterns. Monitoring gas price trends and predicting low-fee windows gives the system the ability to queue sweeps in advance and execute at the optimal moment rather than reacting after the fact.

Net recovery value after fees. Before any sweep is triggered, the system calculates the expected net recovery: balance value minus estimated gas cost at current prices, with a safety margin for gas price movement during confirmation. If the expected net recovery does not clear the threshold, the sweep does not fire. The system waits. This is the single most important guard against making the problem worse through failed or uneconomical sweep attempts.

Diagram 2 — Automated Dust Recovery Decision Flow
Asset Price FeedBTC / ETH / token pricesreal-time oracleGas Price Oraclemempool / fee market dataper-chain, per-blockBalance Scanneraddress balance indexhundreds of millions of addressesNet recovery checkBalance value − gas cost − safety margin ≥ threshold?evaluated per address, per cycleClears thresholdBelow thresholdQueue sweepBatch eligible addressesSign → broadcast → trackDo not sweepEconomics not favorable yet.Wait for gas or price to shift.Funds recoveredAggregated to usable addressAddress flaggedRe-evaluated on next cyclere-evaluatedDashed feedback loop: flagged addresses re-enter the check on each monitoring cycle.

When the conditions align, the system does not sweep one address at a time. It batches hundreds or thousands of addresses into consolidated transactions, aggregating micro-balances into a single usable output in one on-chain operation. This batching is critical: sweeping addresses individually at the cost of one transaction per address would consume more in gas than the dust is worth. The economics of recovery only work at scale when batching is maximized.

Diagram 3 — Batching Economics: Why Individual Sweeps Fail
WITHOUT BATCHING500 individual transactions500 addresses500 transactions(one per address)Gas per tx$0.80Total fees$400500 × $0.80Value to recover$350500 × $0.70 avgNET: −$50 (loss)Paying more in fees than the dust is worth.vsWITH BATCHING1 transaction, 500 outputs500 addresses1 transaction(500 outputs in one tx)Estimated gas~$2base + per-output overheadTotal fees~$299.5% reduction vs individualValue to recover$350500 × $0.70 avgNET: +$348 (gain)Same 500 addresses. Batching makes the economics work.Example uses $0.70 avg balance × 500 addresses and simplified gas estimates to illustrate the leverage.

How to reduce dust creation proactively

Recovery is necessary but not sufficient. The more important discipline is reducing the rate at which dust accumulates in the first place. Three practices make the biggest difference.

🎯Precise coin selection

The coin selection algorithm covered in Part 3 directly determines how much change is created with each transaction. An algorithm that selects inputs producing minimal change output reduces the number of new micro-balances created with every withdrawal. On UTXO chains this means preferring exact-match or near-exact inputs where possible. On account-based chains it means designing spend patterns that leave clean balances rather than fractional remainders.

📦Batching outputs

Rather than sending multiple small withdrawals as separate transactions, batching combines them into a single transaction with multiple outputs. One transaction serving ten withdrawals costs roughly the same in gas as one transaction serving one withdrawal, but creates one tenth of the change outputs. At exchange scale, batching is one of the highest-leverage tools for reducing both dust creation and overall transaction fee costs simultaneously.

📊Consolidation during low-fee windows

Periodically consolidating fragmented address pools during low gas periods reduces the number of active addresses the platform has to monitor and manage. Fewer addresses mean fewer dust accumulation points. This is the maintenance pass equivalent of garbage collection: running it during off-peak hours when the cost is low, clearing accumulated fragmentation before it compounds further.

The operational insight: Dust management is not a cleanup task. It is a continuous engineering discipline that spans coin selection design, transaction batching, fee market monitoring, and automated sweep execution across multiple chains simultaneously. Every shortcut in address design creates dust faster than any recovery system can clean it up.
Next in this series: Transaction prioritization at millisecond scale. When restores, sweeps, retail withdrawals, and institutional transactions all compete for the same queue simultaneously, how does the platform decide what goes first and what happens when a restore needs to jump the line to unblock thousands of customer withdrawals waiting behind it.
Raajeev Reddy
Raajeev Reddy

Engineering leader with 15 years leading engineering organizations across blockchain, digital health, and media platforms.

← All writing