I'm trying to learn more about bitcoin and I'm trying to decode a transaction I made to myself on testnet and I can't seem to figure out a couple of things
Here is the output of getrawtransaction:
getrawtransaction 'f013fd7f27a8c78fd52ad95253e7330dd7e5c6490f480cecd95359cfb1abcbdd' true
{
"txid": "f013fd7f27a8c78fd52ad95253e7330dd7e5c6490f480cecd95359cfb1abcbdd",
"hash": "f6f699d7587a455e516be97b81b79d318d40ca9a8cc4f3382e4ba355808f7c83",
"version": 2,
"size": 223,
"vsize": 142,
"weight": 565,
"locktime": 2133079,
"vin": [
{
"txid": "246f7eb126789462a13b56658fc8095118ea9499b0c41ca5402fa38f97681d2b",
"vout": 0,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinwitness": [
"304402200eb3153139da95c29755baaddb1f8038ad1bd850f46b56d467875d91eb49599502204a19b6798bbdbd019f0bcf63a3412d4f99f923b19a33377c714d06a6f77a71fa01",
"036abeb6881115996db7d8fc9845adf6dabc66e03ca04ff9ff6d15d64fed1cf4b1"
],
"sequence": 4294967293
}
],
"vout": [
{
"value": 0.00009858,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160 07a715962bfe8aec6637ea4abe38e412aa8f9f77 OP_EQUAL",
"hex": "a91407a715962bfe8aec6637ea4abe38e412aa8f9f7787",
"address": "2MswgsrCPRvvB6umFyCYJB6L5FFjnoce2AS",
"type": "scripthash"
}
},
{
"value": 0.00010000,
"n": 1,
"scriptPubKey": {
"asm": "0 f864afee2f6d17a22c420ee61ea21aff5d76ebd4",
"hex": "0014f864afee2f6d17a22c420ee61ea21aff5d76ebd4",
"address": "tb1qlpj2lm30d5t6ytzzpmnpags6lawhd675fh8265",
"type": "witness_v0_keyhash"
}
}
],
"hex": "020000000001012b1d68978fa32f40a51cc4b09994ea185109c88f65563ba162947826b17e6f240000000000fdffffff02822600000000000017a91407a715962bfe8aec6637ea4abe38e412aa8f9f77871027000000000000160014f864afee2f6d17a22c420ee61ea21aff5d76ebd40247304402200eb3153139da95c29755baaddb1f8038ad1bd850f46b56d467875d91eb49599502204a19b6798bbdbd019f0bcf63a3412d4f99f923b19a33377c714d06a6f77a71fa0121036abeb6881115996db7d8fc9845adf6dabc66e03ca04ff9ff6d15d64fed1cf4b1578c2000"
}
Questions:
- The address I sent some test BTC to is
2MswgsrCPRvvB6umFyCYJB6L5FFjnoce2AS
. But, I don't know what07a715962bfe8aec6637ea4abe38e412aa8f9f77
is and I can't seem to duplicate it. I can't even duplicate2MswgsrCPRvvB6umFyCYJB6L5FFjnoce2AS
. By duplicate I mean I can't seem to recreate that label given the public key from my wallet. The public key is02381296c094c7284621bf3b25fb086a531d5035b7982604d15f9223cda758c7bc
, so from that shouldn't I be able to take the RIPEMD160 HASH, prepend add0x6f
, take the double hash, take the first 4 bytes, then encode that into base-58 (version + hash + checksum) and get the above address? What am I doing wrong because I'm not getting that. - What are the 2 bytes after the first 4 bytes (Version)? Bytes 5-6, which is
0001
? - What about bytes 113-114? Which is
0247
(in the raw hex dump)? What does that represent?
Edit: output from testnet wallet:
getaddressinfo "2MswgsrCPRvvB6umFyCYJB6L5FFjnoce2AS"
{
"address": "2MswgsrCPRvvB6umFyCYJB6L5FFjnoce2AS",
"scriptPubKey": "a91407a715962bfe8aec6637ea4abe38e412aa8f9f7787",
"isscript": true,
"iswitness": false,
"script": "witness_v0_keyhash",
"hex": "00145ec830fe309c79964f739c66bdc0619d754a4e33",
"pubkey": "02381296c094c7284621bf3b25fb086a531d5035b7982604d15f9223cda758c7bc",
"embedded": {
"isscript": false,
"iswitness": true,
"witness_version": 0,
"witness_program": "5ec830fe309c79964f739c66bdc0619d754a4e33",
"pubkey": "02381296c094c7284621bf3b25fb086a531d5035b7982604d15f9223cda758c7bc",
"address": "tb1qtmyrpl3sn3uevnmnn3ntmsrpn4655n3npp07k4",
"scriptPubKey": "00145ec830fe309c79964f739c66bdc0619d754a4e33"
},