Skip to content

Relayer fails to submit transaction due to dust change output (200 < 546 satoshis) #3

@Stakecraft

Description

@Stakecraft

While using a Torram node with a relayer, I encountered an error when attempting to submit a transaction to testnet3. The relayer tries to create a transaction where the change output is 200 satoshis, which is below the dust threshold of 546 satoshis, causing the transaction to be rejected with the error "change would be dust: 200 < 546 satoshis".

Logs

2025-03-25T07:52:14.043782Z error Failed to process and submit batch {"error": "failed to submit to blockchain: change would be dust: 200 < 546 satoshis", "attempt": 6, "max_retries": 50}
2025-03-25T07:52:14.043821Z info Retrying after backoff {"backoff_duration": 60, "attempt": 6}
...

Issue Description

  • The relayer selects a UTXO with an amount of 1200 satoshis (1.2e-05 BTC).
  • After constructing the transaction, the change output is 200 satoshis, which is below the dust threshold (546 satoshis) for a P2PKH output.
  • Bitcoin Core rejects the transaction, as this is standard behavior for dust outputs.
  • The relayer continues to retry sending the transaction (up to 50 attempts) instead of adjusting it or reporting the error and stopping.

Expected Behavior

  • The relayer should check the dust threshold before submitting a transaction.
  • If the change is below 546 satoshis, the relayer should:
    • Either not create a change output and add the remainder to the fee.
    • Or select another UTXO to ensure the change is above the threshold.
    • Or report the error and stop retrying.
  • The error message should be more informative for users.

Suggestion

  • Add a check for the dust threshold in the relayer's logic.
  • Add a configuration option for the minimum change amount.
  • Improve the error message to be more user-friendly.

Environment

  • Torram node (version: 1.0).
  • Bitcoin Core 28.1.0.
  • Network: testnet3.
  • OS: Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions