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?

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