<p>A deanonymizing dust attack works by sending dust to large amounts of addresses. The assumption is that when people send transactions/perform consolidations in the future, dust from multiple addresses will be grouped into a single transaction, thus revealing many addresses controlled by a single entity, since the dust would be swept in a single tx. </p>

<p>(this is somewhat of a simplification, since most parties interested in performing such attacks will also be using other data to group together multiple independent txs).</p>

<p>The best way to prevent against this attack is to:</p>

<ol>
<li>Never spend dust in a transaction that consumes inputs from addresses that have not previously been linked by a transaction.</li>
<li>Don't spend dust at all.</li>
</ol>

<p>This will lead to some utxo bloat, but if you are reusing your addresses, you can spend the dust when spending another utxo from the same address. If you are not reusing addresses, simply never spend it. </p>

<p>Some wallets, such as the Samourai Wallet (no affiliation), provide an option to mark dust as unspendable. For systems that you build, you will have to ignore such outputs yourself.</p>

CC BY-SA 4.0
2018-11-30T20:57:27.757Z
re: *If you are not reusing addresses, simply never spend it.* Note: as a user, even if you have a wallet that never re-uses an address you are still susceptible to this attack. Raghav's answer is sort of written from the perspective of the **code** enforcing single spends from an address. The vast majority of user-wallets will not behave this way, and will spend the dust UTXOs received to older, already-used addresses. In other words: "even if your wallet gives you a new address for each transaction, that will not protect you from this attack"
chytrik
CC BY-SA 4.0
2019-12-26T07:05:24.673Z
Could the wallet remind the user to "clear the dust", by separately sending the dust to the miners ,at randomized time? Then the UTXO bloat issue could be relieved.
Chris Chen
CC BY-SA 4.0
2019-12-26T07:12:56.303Z
Frankly speaking, I doubt whether this "attack" (which has been tweeted by Samourai devs repeatedly) really exists. It seems to be costly, however, it doesn't seem to be able to efficiently reveal linkages, and furthermore, as the whitepaper had already outlined in the beginning, there would always be some publicly exposed linkages - this is the inherent nature of UTXO model, isn't it?
Chris Chen
CC BY-SA 4.0
2019-12-26T07:15:41.370Z
AFAIK, Samourai Wallet has a doubtable reputation: https://www.reddit.com/r/Bitcoin/comments/9r9344/slp29_samourai_wallet_bitcoin_privacy_software/e8fm1v8/
Chris Chen
CC BY-SA 4.0
2018-11-30T06:50:30.453Z
2018-11-30T06:50:30.453Z
Raghav Sood
<p>To add to Raghav's answer:</p>

<p>Practically, as a typical user, it can be difficult to deal with a dust attack. There is no way to stop or disallow the receiving of a transaction, so the user can only react to the attack after it has occurred. The good thing is, by taking the proper actions a user can easily and effectively mitigate against the attack. In a perfect world of well-informed users and good wallet software, the attack would be futile, and a waste of resources to attempt. </p>

<p>On the downside, the attack can be very effective if not mitigated. The more addresses a wallet has used in the past, the more damaging the attack can be, as an attacker stands to potentially link a great number of addresses all to one user, destroying anonymity.</p>

<p>As Raghav mentioned, some wallets allow the user to manually select UTXOs for spending, or to mark inputs as 'unspendable dust', but <strong>many wallets have no such option</strong>. In many cases, the UTXO selection is completely hidden from the end user, in an effort to make the wallet more simple to use. </p>

<p>If you receive some dust to one or more of your addresses, your wallet does not allow for manual UTXO selection, and you'd like to counter the attack, then you'll need to import your seed phrase into some new wallet software that allows you to select UTXOs manually. If you'd like to continue using the original wallet software afterwards, you could follow this workflow:</p>

<ol>
<li>Receive dust attack transactions </li>
<li>Do research to find a reputable wallet that allows for UTXO selection, and download that software onto a secure device</li>
<li>Import the seed phrase from your dust-attacked wallet into the new wallet software, to recreate your dust-attacked wallet in the new wallet software</li>
<li>Using your old wallet software, create a new wallet and copy the receiving address (this will be your new wallet, after you've completed all these steps)</li>
<li>Use the new UTXO-selecting wallet software to send the non-dust UTXOs from your dust-attacked wallet, to your new wallet (created in step 4). As Gabriele mentioned in the comments, creating a single transaction to do this will be detrimental to your privacy (it will link all addresses in the wallet, via the common input ownership heuristic). A privacy-conscious user may thus choose to craft many transactions to transfer the funds to the new wallet (using a ~minimal number of UTXOs as input to each transaction).</li>
</ol>

CC BY-SA 4.0
2019-12-24T21:11:20.397Z
Step 5 will make obvious to the external observer that ALL the addresses used in the old wallet belongs to the same person (typical problem of massive consolidation). Am I missing something or the last step seems to be just a bad advice?
Gabriele Domenichini
CC BY-SA 4.0
2019-12-24T21:24:40.830Z
@GabrieleDomenichini that is a great point, I've edited the answer to account for this. Thanks.
chytrik
CC BY-SA 4.0
2018-11-30T21:10:25.787Z
2019-12-24T21:23:18.510Z
2019-12-24T21:23:18.510Z
chytrik
<p>What is the counter measure against dust attack, in case somebody tries to deanonymize me?</p>

<ol>
<li><p>Is there a possibility how to prevent somebody to send you intentional small dust, so that he can track your UTXOs?</p></li>
<li><p>I think there is no counter measure to 1. So if 1 already happens, how to deal with this in the most possible clean way and with as little leaked information as possible?</p></li>
</ol>

<privacy><dust><forced-address-reuse>
Deanonymizing dust attack
boldi
# Deanonymizing dust attack

(Asked by: username_0 on 2018-11-30)

What is the counter measure against dust attack, in case somebody tries to deanonymize me?

1. Is there a possibility how to prevent somebody to send you intentional small dust, so that he can track your UTXOs?
2. I think there is no counter measure to 1. So if 1 already happens, how to deal with this in the most possible clean way and with as little leaked information as possible?

**Tags:** privacy, dust, forced-address-reuse


---

## 2 answers

### Answer by username_1 on 2018-11-30. Score: 8

A deanonymizing dust attack works by sending dust to large amounts of addresses. The assumption is that when people send transactions/perform consolidations in the future, dust from multiple addresses will be grouped into a single transaction, thus revealing many addresses controlled by a single entity, since the dust would be swept in a single tx.

(this is somewhat of a simplification, since most parties interested in performing such attacks will also be using other data to group together multiple independent txs).

The best way to prevent against this attack is to:

1. Never spend dust in a transaction that consumes inputs from addresses that have not previously been linked by a transaction.
2. Don't spend dust at all.

This will lead to some utxo bloat, but if you are reusing your addresses, you can spend the dust when spending another utxo from the same address. If you are not reusing addresses, simply never spend it.

Some wallets, such as the Samourai Wallet (no affiliation), provide an option to mark dust as unspendable. For systems that you build, you will have to ignore such outputs yourself.

> **Comments:**
> **username_2**: re: *If you are not reusing addresses, simply never spend it.* Note: as a user, even if you have a wallet that never re-uses an address you are still susceptible to this attack. username_1's answer is sort of written from the perspective of the **code** enforcing single spends from an address. The vast majority of user-wallets will not behave this way, and will spend the dust UTXOs received to older, already-used addresses. In other words: "even if your wallet gives you a new address for each transaction, that will not protect you from this attack"  
> **username_3**: Could the wallet remind the user to "clear the dust", by separately sending the dust to the miners ,at randomized time? Then the UTXO bloat issue could be relieved.  
> **username_3**: Frankly speaking, I doubt whether this "attack" (which has been tweeted by Samourai devs repeatedly) really exists. It seems to be costly, however, it doesn't seem to be able to efficiently reveal linkages, and furthermore, as the whitepaper had already outlined in the beginning, there would always be some publicly exposed linkages - this is the inherent nature of UTXO model, isn't it?  
> **username_3**: AFAIK, Samourai Wallet has a doubtable reputation: https://www.reddit.com/r/Bitcoin/comments/9r9344/slp29_samourai_wallet_bitcoin_privacy_software/e8fm1v8/  

---

### Answer by username_2 on 2018-11-30. Score: 4

To add to username_1's answer:

Practically, as a typical user, it can be difficult to deal with a dust attack. There is no way to stop or disallow the receiving of a transaction, so the user can only react to the attack after it has occurred. The good thing is, by taking the proper actions a user can easily and effectively mitigate against the attack. In a perfect world of well-informed users and good wallet software, the attack would be futile, and a waste of resources to attempt.

On the downside, the attack can be very effective if not mitigated. The more addresses a wallet has used in the past, the more damaging the attack can be, as an attacker stands to potentially link a great number of addresses all to one user, destroying anonymity.

As username_1 mentioned, some wallets allow the user to manually select UTXOs for spending, or to mark inputs as 'unspendable dust', but **many wallets have no such option**. In many cases, the UTXO selection is completely hidden from the end user, in an effort to make the wallet more simple to use.

If you receive some dust to one or more of your addresses, your wallet does not allow for manual UTXO selection, and you'd like to counter the attack, then you'll need to import your seed phrase into some new wallet software that allows you to select UTXOs manually. If you'd like to continue using the original wallet software afterwards, you could follow this workflow:

1. Receive dust attack transactions
2. Do research to find a reputable wallet that allows for UTXO selection, and download that software onto a secure device
3. Import the seed phrase from your dust-attacked wallet into the new wallet software, to recreate your dust-attacked wallet in the new wallet software
4. Using your old wallet software, create a new wallet and copy the receiving address (this will be your new wallet, after you've completed all these steps)
5. Use the new UTXO-selecting wallet software to send the non-dust UTXOs from your dust-attacked wallet, to your new wallet (created in step 4). As username_4 mentioned in the comments, creating a single transaction to do this will be detrimental to your privacy (it will link all addresses in the wallet, via the common input ownership heuristic). A privacy-conscious user may thus choose to craft many transactions to transfer the funds to the new wallet (using a ~minimal number of UTXOs as input to each transaction).

> **Comments:**
> **username_4**: Step 5 will make obvious to the external observer that ALL the addresses used in the old wallet belongs to the same person (typical problem of massive consolidation). Am I missing something or the last step seems to be just a bad advice?  
> **username_2**: @username_4 that is a great point, I've edited the answer to account for this. Thanks.  

---

