This question has been asked many times, but none of the answers I have found explains a reproducible algorithm that can be used to actually create a valid block header that hashs to a reasonable hash value. In fact, all attempts generate hashes that start and end with non-zero hexadecimal numbers. I’m using JSON data from a S19 Bitmain Antminer connected to a mining pool. The shares are not only filed, but are accepted as shown in JSON Exchange. Additionally, the web interface to the pool agrees with the results. The only conclusion from that is that these exchanges must result in valid, acceptable hashs that I cannot replicate.
There are many problems – whether the Merkle root should be calculated using a binary tree or linearly. I’ve heard that it’s different from when mining actual blocks. Do you use the “6th” field, “extraNonce3” or ignore it?
I was fortunate to find a share submitted with relatively few entries in the Merkel branch.
(“070369F3B9E71BD07BA58ECEE5F7769F582A137DBA7AA3A315E546D2A355”, “17DF59C62159F5092D8B3C67242111CE2278C60C534A100ED59DEEEE5251F9B”, “E61529AF81428A67D0A2A0E25D5B244BFB67249704126526990D3284FC12A61”, “2F783FD110EC6920F9F974A6FFE2AF34790683FA590ADC9854BCA1135A9F6E”, 10433A89763F6A3D2DF844D028BDA3E660BFA300A0527EDCE1728AE208513381″, C4975154ACF6646147041945C72792E0DF34DB75DFAFCBC3AF78E3F6F903D77F1″, “8FD8B923680FAD7FD3CD87CCE33261BEEAAA7AC50526E5D621CF72643CFC2C44”, F0AC98AC08F29C37BAD7E3506D584A39FF185676770BFB008268600502B8D5 “、2A74468E8E8B02328B15097301C20F28329081200777777776A96AC230237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237C237
Now I think all of this is currently displayed in big endian, how can I tell?
Here are other parameters that can be estimated from minor/pool exchanges.
Predictions: “B672EF88428684BA8F9AFD4F79DC17A7250204520001DF9A000000000”
Coinbase1: “010000000100000000000000000000000000000000000000000000000000000000000000FFFFFFF5A030C8A0D1D106F7765726564206279204C7 5786F72205465636868007105E1F5BCD6FABE6D6D8F91C003E19A3777112CA3B0E19F15A5CC26BA53D696E6BD482A06933A90B7999100000000000000000000000000000000000000年000年
coinbase2: “fffffffff05220200000000000017A914BF73AD4CF3A107812BAD3DEB3106111BEE49A3C7987C17CB7120000000017A914056ADE53E BC396A1B3B678BB0D3A5C116FF430C8700000000000000266A24AA21A9EDDDDDDBC02A37F33C0FB04B32AF121BD6892E481307B36F2224F2AAE103 D44584FBB000000000000000000002F6A2D434F524501A21CBD3CAA4FE89BCCD1D716C92CE45333E4D4733F459CC4CA322222D298304FF163B2A360D756C5 DB8400000000000000002B6A2952534B424C4F434B3ABFE8DB1D3E3C680C9BF1623EB701CA3279A6A025F9D9F8E563FB12006FDA0200000000 “
And the rest:
Version = ‘2000000’; nbits = “17028bb1”; ntime = “67c28154”; nonce = “16384721”; extrance1 = ’00 ‘; ExtraNONCE2 = ‘EC10000000000’; extrance2_size = “07”;
Mystical sixth field from Mining.Submit:
extrance3 ?? = ’09b66000′;
I was able to collect similar bits and pieces from the actual mining block, calculate the hash of Coinbase, hashed the Merkel root (using binary tree hash) and generate a valid block header. I know I’m doing this right. Because when you get the result of the last 80 bytes and get Double Sha256, you get the exact same hash that exists in the block in Blockchain Explorer. However, this is a block mined from the blockchain.
I tried this with the above data from a minor/pool exchange, but can’t come up with a decent hash. I already know that the first Merkle entry is at the back and I have to reverse endian to find the corresponding block in the blockchain. The other entries are intermediate hashes that are not associated with the block, so you can’t validate them, but if you have to turn them over first, I think you have to turn them all over. Do you include or exclude the sixth field when trying to create a Coinbase? who knows?
For Merkel Trees I tried the same binary tree hash that I use in the actual mining blocks, but also tried the linear method. The only part of the 80-byte header in question is the Merkel route.
So I say everything to ask it all, does anyone know exactly how to do this and how to get the right hash? Maybe a crytpo mining engineer who actually works with these low-level details? I spent 3 weeks going on to four and exploring the internet, but I can’t find a fully functional end-to-end that shows exactly how to do this. -gt-
Discover more from Earlybirds Invest
Subscribe to get the latest posts sent to your email.