Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
raw transaction tutorial passed by me
[
{
"txid" : "70edfb7e1fd581a9b6c66bc2c964914939c75c3cf53750cfa494d93020eafd0e",
"vout" : 0
}
]
{
"2N8xphn3BkDjmEck9UEZP1mcUYyxkZuv3es" : 49
}
2N8xphn3BkDjmEck9UEZP1mcUYyxkZuv3es
bitcoin-cli -regtest createrawtransaction '[{"txid":"70edfb7e1fd581a9b6c66bc2c964914939c75c3cf53750cfa494d93020eafd0e","vout":0}]' '{"2N8xphn3BkDjmEck9UEZP1mcUYyxkZuv3es":49, "2N7DgmXAmDDynjY49VuWSogoRQ4FbRtGqrX": 0.99}'
02000000010efdea2030d994a4cf5037f53c5cc739499164c9c26bc6b6a981d51f7efbed700000000000ffffffff01001110240100000017a914ac67eb8ee455667ce1ccd6bcaf115d0b29f850968700000000
bitcoin-cli -regtest signrawtransactionwithwallet 02000000010efdea2030d994a4cf5037f53c5cc739499164c9c26bc6b6a981d51f7efbed700000000000ffffffff01001110240100000017a914ac67eb8ee455667ce1ccd6bcaf115d0b29f850968700000000
{
"hex": "02000000010efdea2030d994a4cf5037f53c5cc739499164c9c26bc6b6a981d51f7efbed700000000048473044022053083e1ad958c749406e27346a77dc664027ab6f55d5e38e9dd346777289401202203bac1f8316873b23daceb8ebf851cfb896241776b932a1db958ea7779a845e6e01ffffffff01001110240100000017a914ac67eb8ee455667ce1ccd6bcaf115d0b29f850968700000000",
"complete": true
}
{
"txid": "84f3f1fdff2dc10a745a01861d5324802d656c40215d109b32aa11ae8462e1ea",
"hash": "84f3f1fdff2dc10a745a01861d5324802d656c40215d109b32aa11ae8462e1ea",
"version": 2,
"size": 155,
"vsize": 155,
"weight": 620,
"locktime": 0,
"vin": [
{
"txid": "70edfb7e1fd581a9b6c66bc2c964914939c75c3cf53750cfa494d93020eafd0e",
"vout": 0,
"scriptSig": {
"asm": "3044022053083e1ad958c749406e27346a77dc664027ab6f55d5e38e9dd346777289401202203bac1f8316873b23daceb8ebf851cfb896241776b932a1db958ea7779a845e6e[ALL]",
"hex": "473044022053083e1ad958c749406e27346a77dc664027ab6f55d5e38e9dd346777289401202203bac1f8316873b23daceb8ebf851cfb896241776b932a1db958ea7779a845e6e01"
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 49.00000000,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160 ac67eb8ee455667ce1ccd6bcaf115d0b29f85096 OP_EQUAL",
"hex": "a914ac67eb8ee455667ce1ccd6bcaf115d0b29f8509687",
"reqSigs": 1,
"type": "scripthash",
"addresses": [
"2N8xphn3BkDjmEck9UEZP1mcUYyxkZuv3es"
]
}
}
]
}
dodikk@DESKTOP-MJQ2MP4:~$ bitcoin-cli -regtest getrawchangeaddress
2N7DgmXAmDDynjY49VuWSogoRQ4FbRtGqrX
==================
dodikk@DESKTOP-MJQ2MP4:~$ bitcoin-cli -regtest createrawtransaction '[{"txid":"70edfb7e1fd581a9b6c66bc2c964914939c75c3cf53750cfa494d93020eafd0e","vout":0}]' '{"2N8xphn3BkDjmEck9UEZP1mcUYyxkZuv3es":49, "2N7DgmXAmDDynjY49VuWSogoRQ4FbRtGqrX": 0.99}'
02000000010efdea2030d994a4cf5037f53c5cc739499164c9c26bc6b6a981d51f7efbed700000000000ffffffff02001110240100000017a914ac67eb8ee455667ce1ccd6bcaf115d0b29f8509687c09ee6050000000017a914994748a8b84b091227c3b68773df3921004e61a18700000000
dodikk@DESKTOP-MJQ2MP4:~$ bitcoin-cli -regtest signrawtransactionwithwallet 02000000010efdea
2030d994a4cf5037f53c5cc739499164c9c26bc6b6a981d51f7efbed700000000000ffffffff0200111024010000
0017a914ac67eb8ee455667ce1ccd6bcaf115d0b29f8509687c09ee6050000000017a914994748a8b84b091227c3
b68773df3921004e61a18700000000
{
"hex": "02000000010efdea2030d994a4cf5037f53c5cc739499164c9c26bc6b6a981d51f7efbed70000000004847304402200438ece7a4304ea3115bb51e714e2e99f5f3506e9f8240d493ed41f4555aacf802203b1320202791e8ca9f5fda6e0996d6defeb1a19fab3f5e9fdc8e57aeb0b84d6801ffffffff02001110240100000017a914ac67eb8ee455667ce1ccd6bcaf115d0b29f8509687c09ee6050000000017a914994748a8b84b091227c3b68773df3921004e61a18700000000",
"complete": true
}
dodikk@DESKTOP-MJQ2MP4:~$ bitcoin-cli -regtest sendrawtransaction 02000000010efdea2030d994a4cf5037f53c5cc739499164c9c26bc6b6a981d51f7efbed70000000004847304402200438ece7a4304ea3115bb51e714e2e99f5f3506e9f8240d493ed41f4555aacf802203b1320202791e8ca9f5fda6e0996d6defeb1a19fab3f5e9fdc8e57aeb0b84d6801ffffffff02001110240100000017a914ac67eb8ee455667ce1ccd6bcaf115d0b29f8509687c09ee6050000000017a914994748a8b84b091227c3b68773df3921004e61a18700000000
bca213de3e96254cf0840566ab375c2b1d6640d7bcf045d738c2a444e33f3e26
dodikk@DESKTOP-MJQ2MP4:~$ bitcoin-cli -regtest generate 1
[
"7293bd3d3f9a175a2e2f03c941659e0680a8b7f42a9ba43976ae4f67e64a36e7"
]
dodikk@DESKTOP-MJQ2MP4:~$ bitcoin-cli -regtest listunspent | grep bca213de3e96254cf0840566ab375c2b1d6640d7bcf045d738c2a444e33f3e26
"txid": "bca213de3e96254cf0840566ab375c2b1d6640d7bcf045d738c2a444e33f3e26",
"txid": "bca213de3e96254cf0840566ab375c2b1d6640d7bcf045d738c2a444e33f3e26",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment