I am using bitcoincashjs (Bitcore fork) library to make BCH transaction (actually it is an exchange with ChangeNow API). Source wallet has only one UTXO:


So, then I build the transaction

const bitcoreTransaction = new Bitcore.Transaction()
  .to(toAddress, fromFunction(data.amount)[toFunction]())
  .feePerKb(this.getFeePerKb()) // 4000

and check for serialization error, which says: Dust amount detected in one output. When I debug resulting tx object, I see two outputs and one of them has 0 amount. Skipping of dust check on client does not help as it is checked on API side while publishing the transaction and error is returned.

Any ideas how to avoid this?

closed as off-topic by Andrew Chow Jul 17 at 17:40

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about cryptocurrencies or projects that are not Bitcoin, and are not applicable to Bitcoin, are off-topic. For more information, see this meta-discussion." – Andrew Chow
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Try if it also happens with bitcore-lib. If not, report it. – MCCCS May 22 '18 at 14:07