Skip to content

Dust Attack Protection: Classification of Already-Spent Dust & Descendant UTXO Marking #6974

Description

@Parsh

Context

Part of #6965 — Dust Attack Protection and Donate Dust.

This issue covers the case where a potential dust UTXO was already spent before Keeper could mark it Do Not Spend. In that case, Keeper should trace the current wallet-owned descendant UTXOs of that spend and mark them Do Not Spend. It also covers labelling the spending transaction in transaction history. See also:


Goal

When Keeper scans wallet history and finds a UTXO that would have met the dust rules but was already spent, it should:

  1. Mark the spending transaction as a Potential dust spend
  2. Trace current wallet-owned descendant UTXOs from that spend
  3. Mark all traceable current affected descendant UTXOs as Do Not Spend with reason: Linked to potential dust spend

This applies across descendant layers where traceable — not only one layer deep.


Detection: Already-Spent Dust

A historical UTXO is considered potential dust if it would have met these rules at the time it was received:

  • Amount under 5,000 sats, AND
  • Received on a reused receive address, OR received on an out-of-order receive address, OR received on a reused change address

If such a UTXO was spent in a transaction, that transaction is a Potential dust spend.


Descendant UTXO Marking

From the Potential dust spend transaction:

  • Identify all current wallet-owned UTXOs that descended from that transaction (outputs that are still unspent and owned by this wallet)
  • Trace through multiple layers where possible
  • Mark each as Do Not Spend
  • Reason: Linked to potential dust spend

These UTXOs should be classified in the same scan pass as normal dust classification.


Scan Points

This classification runs during the same scan points as normal dust classification:

  • wallet creation
  • wallet import / restore
  • wallet opened after app update (classify UTXOs without state)
  • normal wallet refresh
  • pull-to-refresh
  • new incoming transaction scan

No separate global upgrade script is required.


Transaction History Labels

Transaction list item: Show label Potential dust spend on the spending transaction.

Transaction detail:

Show explanation:

This transaction may have spent a suspicious small amount together with other wallet funds. This may have reduced wallet privacy.

This is informational only — no action is shown for the already-spent dust itself.


Red Dot & UI Indicator Rules

  • Show red dot on wallet card / More Options if there are current Do Not Spend coins that descended from a potential dust spend
  • A historical Potential dust spend alone does not show a red dot if there are no current Do Not Spend descendant coins
  • Includes Do Not Spend coins appears in Wallet Details if there are current Do Not Spend descendant coins

UTXO Details for Linked Descendants

For a UTXO marked Do Not Spend due to a linked potential dust spend:

  • Show reason: Linked to potential dust spend
  • Show explanation: Keeper marked this coin Do Not Spend to help protect wallet privacy.
  • Show button: Mark Spendable
  • On action, persist override and stay on UTXO Details
  • Success feedback: Coin marked spendable
  • System-marked Do Not Spend cannot be removed like a normal label — user must use explicit CTA

Acceptance Criteria

  • Already-spent historical dust UTXO marks the spending transaction as Potential dust spend
  • Current wallet-owned descendant UTXOs of that spend are marked Do Not Spend
  • Descendant tracing applies across multiple layers where traceable
  • Reason on descendant UTXOs reads: Linked to potential dust spend
  • Classification runs during wallet creation, import/restore, app update open, normal refresh
  • Transaction list shows Potential dust spend label on the spending transaction
  • Transaction detail shows explanation about possible privacy impact
  • No action is shown for the already-spent dust itself
  • Red dot appears on wallet card only if there are current Do Not Spend descendant coins
  • Includes Do Not Spend coins appears in Wallet Details only if current Do Not Spend descendant coins exist
  • UTXO Details for a linked descendant shows Linked to potential dust spend as reason
  • Mark Spendable override persists after refresh

Copy Requirements

Use these exact labels:

  • Do Not Spend
  • Linked to potential dust spend (reason on UTXO)
  • Potential dust spend (transaction label)
  • Keeper marked this coin Do Not Spend to help protect wallet privacy.
  • This transaction may have spent a suspicious small amount together with other wallet funds. This may have reduced wallet privacy.
  • Mark Spendable
  • Coin marked spendable

Design Requirements

  • Reuse existing transaction list item label/chip component
  • Reuse existing transaction detail info/warning pattern
  • Reuse existing UTXO label/chip component
  • No new assets required
  • Do not create a new dust history screen

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions