How can I define the change address of a transaction using createrawtransaction?

2

This question is almost the opposite of How to find the change / sender address given a txid?

If I am making a transaction using createrawtransaction how can I define the change (sender) address?

Felipe

Posted 2014-06-28T04:06:41.423

Reputation: 1 511

Answers

3

In Bitcoin, change is a normal output which sends the remaining money to one of your addresses. When creating a transaction with createrawtransaction, you have to add change output manually (just like any other output), otherwise that money would go to the miners.

abacabadabacaba

Posted 2014-06-28T04:06:41.423

Reputation: 918

i came with the same question because im not sure how to define the 2nd output. the example shows the output as a single object, not an array.Sonic Soul 2018-09-01T16:12:43.517