Monday, December 23, 2024

transactions – What’s the hashTypeCode?

After a transaction is serialised prepared for signature or signature verification, a 4 byte hashTypeCode have to be added (step 9 right here). Because it’s derived from a single byte, it has 256 potential values.

What’s the Hash Sort Code?

What are its origins?

What’s it used for?

Have there ever been proposals to switch or lengthen its that means?

My understanding is that the hashTypeCode signifies which subset of bytes in a transaction is signed. Within the under (randomly chosen) instance transaction, what precisely could be signed for every of the potential hashTypeCode values?

{
    "txid": "22b03b79f996ab7e48fa39e17ae885dfb252733b8fd560361532b0d8b59b9951",
    "hash": "22b03b79f996ab7e48fa39e17ae885dfb252733b8fd560361532b0d8b59b9951",
    "model": 1,
    "measurement": 373,
    "vsize": 373,
    "weight": 1492,
    "locktime": 0,
    "vin": [
        {
            "txid": "9bd1b1beb4e400db962d2930bdd4acb585ccc18e568f62214af67b7f8e928dfb",
            "vout": 1,
            "scriptSig": {
                "asm": "3045022100c61382dc9b8611bd077d9931685321dd8e48f3a0532873d16d5a00e18647ff2402202bbca562ab2f6e01e55f20d3106dabd8a1208a0276bb552720968902385f1e61[ALL] 034e6ae18eda57aa491ae3dd0b49b656fbcdf2282e6d47e0241b875d0122602ac3",
                "hex": "483045022100c61382dc9b8611bd077d9931685321dd8e48f3a0532873d16d5a00e18647ff2402202bbca562ab2f6e01e55f20d3106dabd8a1208a0276bb552720968902385f1e610121034e6ae18eda57aa491ae3dd0b49b656fbcdf2282e6d47e0241b875d0122602ac3"
            },
            "sequence": 4294967295
        },
        {
            "txid": "64891cd6a9771adf75b343367850198633d2865df516533f523ce33fdf8c55c2",
            "vout": 0,
            "scriptSig": {
                "asm": "304402200165a5966fb459ca5f6c4e2b25108b6e187e6ac8e7ca75f302564abd12d37c58022006bd7de403310dd10e0eaade55ca5fbccf24cd3906c0b720096f13db78303175[ALL] 03345e24df2e1f69f2056fe650c8af607659d28795f355f639f894aafacc6ae2cd",
                "hex": "47304402200165a5966fb459ca5f6c4e2b25108b6e187e6ac8e7ca75f302564abd12d37c58022006bd7de403310dd10e0eaade55ca5fbccf24cd3906c0b720096f13db78303175012103345e24df2e1f69f2056fe650c8af607659d28795f355f639f894aafacc6ae2cd"
            },
            "sequence": 4294967295
        }
    ],
    "vout": [
        {
            "value": 1.3536149,
            "n": 0,
            "scriptPubKey": {
                "asm": "OP_DUP OP_HASH160 06f723b0acdefec3b50e7e318951c69dff77bd56 OP_EQUALVERIFY OP_CHECKSIG",
                "desc": "addr(1dq7hWunuA5ogNT88H2gp4vtqygVRDu47)#tqu6fa9f",
                "hex": "76a91406f723b0acdefec3b50e7e318951c69dff77bd5688ac",
                "address": "1dq7hWunuA5ogNT88H2gp4vtqygVRDu47",
                "type": "pubkeyhash"
            }
        },
        {
            "value": 0.16029023,
            "n": 1,
            "scriptPubKey": {
                "asm": "OP_DUP OP_HASH160 5b639f973c812eb23adda40465acabd336c60928 OP_EQUALVERIFY OP_CHECKSIG",
                "desc": "addr(19LDqQtTqn5X6GVvyaaZn57W2PppACt6Dz)#utzsyz9p",
                "hex": "76a9145b639f973c812eb23adda40465acabd336c6092888ac",
                "address": "19LDqQtTqn5X6GVvyaaZn57W2PppACt6Dz",
                "type": "pubkeyhash"
            }
        }
    ],
    "hex": "0100000002fb8d928e7f7bf64a21628f568ec1cc85b5acd4bd30292d96db00e4b4beb1d19b010000006b483045022100c61382dc9b8611bd077d9931685321dd8e48f3a0532873d16d5a00e18647ff2402202bbca562ab2f6e01e55f20d3106dabd8a1208a0276bb552720968902385f1e610121034e6ae18eda57aa491ae3dd0b49b656fbcdf2282e6d47e0241b875d0122602ac3ffffffffc2558cdf3fe33c523f5316f55d86d233861950783643b375df1a77a9d61c8964000000006a47304402200165a5966fb459ca5f6c4e2b25108b6e187e6ac8e7ca75f302564abd12d37c58022006bd7de403310dd10e0eaade55ca5fbccf24cd3906c0b720096f13db78303175012103345e24df2e1f69f2056fe650c8af607659d28795f355f639f894aafacc6ae2cdffffffff02d2731108000000001976a91406f723b0acdefec3b50e7e318951c69dff77bd5688ac5f95f400000000001976a9145b639f973c812eb23adda40465acabd336c6092888ac00000000",
    "blockhash": "000000000000000008b8cebf7b7d28b3677011820a5fdb5bfb206d3b8e46de8e",
    "confirmations": 483036,
    "time": 1433129108,
    "blocktime": 1433129108
}

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles