Native currency in raw transactions

+2 votes
Hi Multichain folks,

How can we use native currency in the raw transaction API for paying fees to miners/validators?

Let me give a use case. Address A has the native currency, while Address B wants to exchange Asset 1 for Asset 2 with Address C (atomic exchange).

Is it possible for Address A to add a native currency utxo to the transaction to pay for the fees and get back any change from the fees?
asked Mar 22, 2018 by StevenChan

1 Answer

0 votes

Yes, you can certainly include native currency amounts in raw transactions. When specifying asset quantities, use the empty asset name to specify a quantity of the native currency instead. For example for the second parameter of createrawtransaction:

{"1FKGa8s6bUEX961SUXfvwaZHn1vkGUZ3VM":{"asset1":100, "":0.0003}}

answered Mar 22, 2018 by MultiChain