Bitcoin Forum
May 24, 2024, 06:12:06 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: non-segwit to segwit raw transactions  (Read 172 times)
samspaces (OP)
Legendary
*
Offline Offline

Activity: 1453
Merit: 1030


View Profile
March 21, 2018, 03:12:22 PM
 #1

Hi,

Weirdly, I'm not able to find easily identifiable info on the title topic. I have an old wallet and want to move coins to segwit addresses. I used to do offline raw transaction signing in the format:

createrawtransaction '[{"txid":"input_tx_number_long_string","vout":number}]' '{"sendtoaddress": amount}'

I've made transactions to a segwit address this way and it shows fine in the balance. Still I'm a bit worried I'm doing something wrong or overlooking something. And do segwit to segwit raw transactions have the same format as stated above?

Thanks.
ranochigo
Legendary
*
Offline Offline

Activity: 2982
Merit: 4193



View Profile
March 21, 2018, 03:31:34 PM
 #2

If the transaction has appeared in your bech32 address, then its definitely fine. It wouldn't appear if the transaction is invalid.

Bitcoin Core supports bech32 addresses since 0.16.0 and it is definitely possible to use that command to send to bech32 addresses. If you're using an older version, you've probably sent it to a P2SH address and that is completely fine.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
samspaces (OP)
Legendary
*
Offline Offline

Activity: 1453
Merit: 1030


View Profile
March 21, 2018, 03:44:42 PM
 #3

If the transaction has appeared in your bech32 address, then its definitely fine. It wouldn't appear if the transaction is invalid.

Bitcoin Core supports bech32 addresses since 0.16.0 and it is definitely possible to use that command to send to bech32 addresses. If you're using an older version, you've probably sent it to a P2SH address and that is completely fine.

Thanks, I sent it to P2SH addresses, since Bitcoin Core 0.16 wasn't out yet. So you're saying that the above raw transaction format works from and to all Bitcoin address types, right?
ranochigo
Legendary
*
Offline Offline

Activity: 2982
Merit: 4193



View Profile
March 21, 2018, 03:53:18 PM
 #4

Thanks, I sent it to P2SH addresses, since Bitcoin Core 0.16 wasn't out yet. So you're saying that the above raw transaction format works from and to all Bitcoin address types, right?
Bitcoin Core 0.16 is already out: https://bitcoin.org/en/download.

Anyways, yup. P2SH addresses has been supported for a very long time and bech32 will work for createrawtransaction as well[1]. It's the same arguments.

[1] https://github.com/bitcoin/bitcoin/pull/11167/

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
samspaces (OP)
Legendary
*
Offline Offline

Activity: 1453
Merit: 1030


View Profile
March 21, 2018, 07:01:34 PM
 #5

Thanks, I sent it to P2SH addresses, since Bitcoin Core 0.16 wasn't out yet. So you're saying that the above raw transaction format works from and to all Bitcoin address types, right?
Bitcoin Core 0.16 is already out: https://bitcoin.org/en/download.

Anyways, yup. P2SH addresses has been supported for a very long time and bech32 will work for createrawtransaction as well[1]. It's the same arguments.

[1] https://github.com/bitcoin/bitcoin/pull/11167/

Great, thanks!
Maybe others out there will find this little thread useful too.
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!