Summary
When a user initiates a collaborative exit, the SDK submits the intent to arkd without first checking whether the change VTXO left behind would fall below the dust threshold (330 sats). This causes arkd to reject the intent with a dust error that surfaces directly to the user — an error that should never reach them.
Current validation gaps
- `wallet.ts` checks `output.amount <= dustAmount` for explicit outputs ✓
- `ramps.ts` checks if fees exceed the offboard amount ✓
- `vtxo-manager.ts` skips periodic settle if `totalAmount < dustAmount` ✓
Missing: none of the above check whether the change VTXO remaining after a collab exit (`amount - offboard_amount - fees`) would be below dust.
Expected behaviour
Before submitting the intent to arkd, the SDK should compute the expected change amount (total VTXO amount − exit amount − onchain output fee of 200 sats) and, if it falls below dust (330 sats), fail fast with a clear, actionable error — e.g. "Amount too close to dust limit; consider exiting the full balance."
Note: the UX decision of what to show the user (e.g. offer to exit the full balance) belongs in the wallet layer, not the SDK. The SDK should simply reject early with a typed error so the wallet can handle it appropriately.
Steps to reproduce
- Hold a VTXO where `amount - exit_amount - 200` < 330 sats
- Trigger a collab exit for that partial amount
- Observe the SDK submitting to arkd and returning a dust error to the user
Related files
- `wallet.ts`, `ramps.ts`, `vtxo-manager.ts`
Summary
When a user initiates a collaborative exit, the SDK submits the intent to arkd without first checking whether the change VTXO left behind would fall below the dust threshold (330 sats). This causes arkd to reject the intent with a dust error that surfaces directly to the user — an error that should never reach them.
Current validation gaps
Missing: none of the above check whether the change VTXO remaining after a collab exit (`amount - offboard_amount - fees`) would be below dust.
Expected behaviour
Before submitting the intent to arkd, the SDK should compute the expected change amount (total VTXO amount − exit amount − onchain output fee of 200 sats) and, if it falls below dust (330 sats), fail fast with a clear, actionable error — e.g. "Amount too close to dust limit; consider exiting the full balance."
Steps to reproduce
Related files