Author

Topic: change address for raw tx (Read 965 times)

jr. member
Activity: 43
Merit: 7
July 20, 2015, 05:24:00 AM
#6
WoW! cool, thanks a lot!
legendary
Activity: 1442
Merit: 1186
July 19, 2015, 12:27:00 PM
#5
Thanks you, Any examples how to do it with p2sh address ?
I created address like this

createmultisig    <'["key,"key"]'>   Creates a multi-signature address and returns a json object

Shoud I add change output with creation raw tx?

Any correct examples ?

BR!
Exactly like knightdk stated you have specify one when creating the transaction.
Just add a comma after the destination address and enter in another address as your change address.

Code:
createrawtransaction '[{"txid":"","vout":}]' '{"1someBitcoinAddress45d1c5":0.001,"1myChangeAddress45d6c1":0.01}'

Here's a video I made on the subject as well https://youtu.be/YN2Vyu9RupU?t=7m30s
jr. member
Activity: 43
Merit: 7
July 19, 2015, 11:54:12 AM
#4
Thanks you, Any examples how to do it with p2sh address ?
I created address like this

createmultisig    <'["key,"key"]'>   Creates a multi-signature address and returns a json object

Shoud I add change output with creation raw tx?

Any correct examples ?

BR!
sr. member
Activity: 412
Merit: 287
July 18, 2015, 09:01:16 PM
#3
^ this is very important.. You can lose bitcoins if you forget about change.

You can set a change address during createrawtransaction. Just add a second output. It's a good idea to randomize the order of the change address, and to use a new change address every time to avoid privacy issues.
staff
Activity: 3458
Merit: 6793
Just writing some code
July 18, 2015, 11:52:22 AM
#2
You have to set the change address when you do createrawtransaction. If you don't it will become a transaction fee.
jr. member
Activity: 43
Merit: 7
July 18, 2015, 11:32:04 AM
#1
Hello!

Can I set change address for raw tx?

For example


1) createrawtransaction
2) addedrawtransactionaddress
3) signrawtransaction
4) sendrawtransaction

or can I set address for the change which I created in the step 1 "1) createrawtransaction"

BR !
Jump to: