Bitcoin Forum
May 02, 2024, 07:05:17 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: change address for raw tx  (Read 951 times)
init1 (OP)
Newbie
*
Offline Offline

Activity: 43
Merit: 0


View Profile
July 18, 2015, 03:32:04 PM
 #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 !
1714676717
Hero Member
*
Offline Offline

Posts: 1714676717

View Profile Personal Message (Offline)

Ignore
1714676717
Reply with quote  #2

1714676717
Report to moderator
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714676717
Hero Member
*
Offline Offline

Posts: 1714676717

View Profile Personal Message (Offline)

Ignore
1714676717
Reply with quote  #2

1714676717
Report to moderator
1714676717
Hero Member
*
Offline Offline

Posts: 1714676717

View Profile Personal Message (Offline)

Ignore
1714676717
Reply with quote  #2

1714676717
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6577


Just writing some code


View Profile WWW
July 18, 2015, 03:52:22 PM
 #2

You have to set the change address when you do createrawtransaction. If you don't it will become a transaction fee.

fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 266


View Profile
July 19, 2015, 01:01:16 AM
 #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.

Bitwasp Developer.
init1 (OP)
Newbie
*
Offline Offline

Activity: 43
Merit: 0


View Profile
July 19, 2015, 03:54:12 PM
 #4

Thanks you, Any examples how to do it with p2sh address ?
I created address like this

createmultisig   <nrequired> <'["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!
coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
July 19, 2015, 04:27:00 PM
 #5

Thanks you, Any examples how to do it with p2sh address ?
I created address like this

createmultisig   <nrequired> <'["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

init1 (OP)
Newbie
*
Offline Offline

Activity: 43
Merit: 0


View Profile
July 20, 2015, 09:24:00 AM
 #6

WoW! cool, thanks a lot!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!