"Hash of previous block" from stratum protocol

454 views Asked by At

When I receive mining.notify from pool (Stratum mining protocol), previous block hash not exists in blockchain.

Can someone explain this?

For example, I received this data from pool:

{
        ExtraNonce1: '849409a3',
        ExtraNonce2_size: 4,
        previousblockhash: '852ab3acf6baeb51e883cc88f49ef03ae17ed8110009a5fb0000000000000000',
        coinbase: [
            '01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5c03e7420a192f5669614254432f4d696e6564206279206c6576616d75732f2cfabe6d6ddfad6fb1792a227710fa21eb53e9664813efb4dd0928111be83e78973f35ad32100000000000000010b40fd717cd7b9ec1',
            'ffffffff0479ea912a000000001976a914536ffa992491508dca0354e52f32a3a7a679a53a88ac00000000000000002b6a2952534b424c4f434b3a00b8dedb0ea9e1f81651377346c755d4e05d8ca0b9560adf528f9d28002ff5f70000000000000000266a24b9e11b6d88d3d1c922f8fcdaad85a93a12f093732b1d5108107af224e6cd16ba7772af950000000000000000266a24aa21a9eda1cf7b0087a17891942bc1375cde699540d0ce75e17c4f40a8224eb77bf8103100000000'
        ],
        merkleTree: [
            'f2e751916a979c8f5c6e6e455ed6a7486806bc0f4461dd69b3ca7ff997e1b996',
            '4a58c7d29b63e0392959529669167a022dcb7842d3ca887dd5f7bc016f8bf61f',
            '60bc408ce79b45feb3bd766c33ccdc58b226f61633622fb2f26149a8c1f8de6f',
            'daeba6aa2194259fc8ff18f5fc0ed1fcaac756077ad3415c425f9da06fe3bd05',
            'dbe7942d0a8cb8daa4a07b06ce890b2d8b9c217bee2aac1352baa9cfdc6ed9a3',
            'c74d2e1b1860cadcb03b53e82c39f6273e70c194d5ac52f09e77b745e88254db',
            '004fa6b6f3efc01579fd34a6b1481a8580b233e88f4a73ccaebf8e832cd2a9e6',
            'ca729fb1c4b7d03753c877a0c81529b7240b05f7b0a1d07b35c4e89829eb0c30',
            '2a93783af9811663c532ccb34534eb218951cafc854411ce81a17a9753b3c248',
            'b39333007fa1179b8a116dd790e2cc4cba151b8ff10e3ccccf19816962cc803f',
            'e77c8fdc22907f11c74dd545e84a1094ef34342825a37bdcbc91d0b85a1bd7f4',
            'f7995ac6c21bf3f3b2990152f748db87e93e4f6e9f38ac785eb5f3d84450ba3b'
        ],
        blockVersion: '20000000',
        nBits: '170cf4e3'
    }

Swap endian for previousblockhash is 0000000000000000fba5090011d87ee13af09ef488cc83e851ebbaf6acb32a85 and such block not exists.

1

There are 1 answers

1
Levan Abashidze On BEST ANSWER

I found answer. Previous block hash inside "mining.notify" is 8 x 4-Byte-string expressed as little endian.

in my case byte array: 852ab3ac_f6baeb51_e883cc88_f49ef03a_e17ed811_0009a5fb_00000000_00000000

This array is a collection of eight 4-Bytes words that, when converted to big endian, produce "00000000_00000000_0009a5fb_e17ed811_f49ef03a_e883cc88_f6baeb51_852ab3ac", which is Block 672486