First I
listed my unspent transactions and picked this one:
{
"txid":
“a5c882ee895b4983b7fef6f6a91d214965df124956269d568f976b5854c7c1f7”,
"vout": 0,
"address":
“2MuZFcnDYT5AVnvMkXQjZiiBLqxPdtDFSzK”,
"label": "",
"redeemScript":
“0014fb660c11feb2e6a4ba4ace215599ac7dbe984e4a”,
"scriptPubKey":
“a91419591952119e85d4186b24496bbb1c842edffbc587”,
"amount": 25.00000000,
"confirmations": 101,
"spendable": true,
"solvable": true,
"desc":
“sh(wpkh([ecf267e4/0’/0’/2’]0344dd2eb0e908cd0624e18281a2aeccde1de8a20b4e06279a78657c31708ca9d9))#gasgq3jv”,
"safe": true
},
Then I used
the command getnewaddress:
2NCKJydykRGfCvG7bNuJtAnQ1emGSEhkYEr
Then I made
the string in Atom and input txid and new wallet address into string:
‘[{“txid”:
“a5c882ee895b4983b7fef6f6a91d214965df124956269d568f976b5854c7c1f7”,“vout”:
0}]’ ‘{“2NCKJydykRGfCvG7bNuJtAnQ1emGSEhkYEr”: 10}’
Then I:
createrawtransaction using the string above and got:
0200000001f7c1c754586b978f569d26564912df6549211da9f6f6feb783495b89ee82c8a50000000000ffffffff0100ca9a3b0000000017a914d13037de674c958f20a19468264bd462cb0614ac8700000000
I then used
the signtransactionwithwallet and got:
02000000000101f7c1c754586b978f569d26564912df6549211da9f6f6feb783495b89ee82c8a50000000017160014fb660c11feb2e6a4ba4ace215599ac7dbe984e4affffffff0100ca9a3b0000000017a914d13037de674c958f20a19468264bd462cb0614ac870247304402200cc9f29abcca9eb3d4c1f86284944727e5e6cce698cb7a40afbec42994016dc302203e99b78da69bbd07f1dcd36f891f331d314c453986f69d33deafcf37116c545b01210344dd2eb0e908cd0624e18281a2aeccde1de8a20b4e06279a78657c31708ca9d900000000
I then
decoded the transaction after signing it:
PS
F:\Bitcoin Core\Bitcoin\daemon> ./bitcoin-cli -regtest decoderawtransaction
02000000000101f7c1c754586b978f569d26564912df6549211da9f6f6feb783495b89ee82c8a50000000017160014fb660c11feb2e6a4ba4ace215599ac7dbe984e4affffffff0100ca9a3b0000000017a914d13037de674c958f20a19468264bd462cb0614ac870247304402200cc9f29abcca9eb3d4c1f86284944727e5e6cce698cb7a40afbec42994016dc302203e99b78da69bbd07f1dcd36f891f331d314c453986f69d33deafcf37116c545b01210344dd2eb0e908cd0624e18281a2aeccde1de8a20b4e06279a78657c31708ca9d900000000
{
“txid”:
“d04b336a2963ab3d5aced77edb6a967af8eae3d8f402dcee2b2d5e3537313ed5”,
“hash”: “941c5cc29bf1da825f1646413e5d8d86c8f47a1bd9b7d77a0ef96952a4f82c8e”,
“version”: 2,
“size”: 215,
“vsize”: 134,
“weight”: 533,
“locktime”: 0,
“vin”: [
{
"txid":
“a5c882ee895b4983b7fef6f6a91d214965df124956269d568f976b5854c7c1f7”,
"vout": 0,
"scriptSig": {
"asm":
“0014fb660c11feb2e6a4ba4ace215599ac7dbe984e4a”,
"hex":
“160014fb660c11feb2e6a4ba4ace215599ac7dbe984e4a”
},
"txinwitness": [
“304402200cc9f29abcca9eb3d4c1f86284944727e5e6cce698cb7a40afbec42994016dc302203e99b78da69bbd07f1dcd36f891f331d314c453986f69d33deafcf37116c545b01”,
“0344dd2eb0e908cd0624e18281a2aeccde1de8a20b4e06279a78657c31708ca9d9”
],
"sequence": 4294967295
}
],
“vout”: [
{
"value": 10.00000000,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160
d13037de674c958f20a19468264bd462cb0614ac OP_EQUAL",
"hex":
“a914d13037de674c958f20a19468264bd462cb0614ac87”,
"reqSigs": 1,
"type": "scripthash",
"addresses": [
“2NCKJydykRGfCvG7bNuJtAnQ1emGSEhkYEr”
]
}
}
]
}
Here`s
where your vin scriptsig “asm” is much longer than my and without the [ALL] at
the end.
My thougth
is that this is my unlocking script since it`s the vin “asm”, is it not?
“vin”: [
{
"txid":
“a5c882ee895b4983b7fef6f6a91d214965df124956269d568f976b5854c7c1f7”,
"vout": 0,
"scriptSig": {
"asm":
“0014fb660c11feb2e6a4ba4ace215599ac7dbe984e4a”,
“vout”:
[
{
"value": 10.00000000,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160
d13037de674c958f20a19468264bd462cb0614ac OP_EQUAL",
Then I put
the original txid into the gettxout:
PS
F:\Bitcoin Core\Bitcoin\daemon> ./bitcoin-cli -regtest gettxout
“a5c882ee895b4983b7fef6f6a91d214965df124956269d568f976b5854c7c1f7”, 0
{
“bestblock”:
“2d03fe757d5dd3670b044e83702c4a9bc526993e560aa3808521e4e085f16bd9”,
“confirmations”: 101,
“value”: 25.00000000,
“scriptPubKey”: {
"asm": "OP_HASH160
19591952119e85d4186b24496bbb1c842edffbc5 OP_EQUAL",
"hex":
“a91419591952119e85d4186b24496bbb1c842edffbc587”,
"reqSigs": 1,
"type": "scripthash",
"addresses": [
“2MuZFcnDYT5AVnvMkXQjZiiBLqxPdtDFSzK”
]
},
“coinbase”: true
I put the
the locking script below from the gettxout “asm” command, did I misunderstand
this? This does not look right, but I can not tell why
UNLOCKING: 0014fb660c11feb2e6a4ba4ace215599ac7dbe984e4a
LOCKING: OP_HASH160
19591952119e85d4186b24496bbb1c842edffbc5 OP_EQUAL