Creating raw transactions

+1 vote
In the createrawtransaction API why have you added the final balance values? e.g. 9 and 80. Shouldn’t it only have the amounts that need to be exchanged? The first time I tired I gave a wrong value and it failed.
asked Aug 17, 2015 by anonymous

1 Answer

0 votes

This is due to the transactional model. From the MultiChain white paper:

The bitcoin blockchain uses a per­-output transactional model, in which every transaction has a set of inputs and a set of outputs. Each input “spends” one output of a previous transaction, with the blockchain ensuring that this output cannot be spent elsewhere. The full history of transactions forms a multi­way connected chain, which terminates at the “coinbase” transactions in which miners are awarded new units of the currency. All of the bitcoin in a transaction’s inputs flow into that transaction, which are then distributed across its outputs in accordance with the quantities written within. As a result most regular payments require two outputs – one with the intended amount for the recipient, and the other containing “change” which goes back to the sender for use in a subsequent transaction. 

answered Aug 17, 2015 by MultiChain
...