You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And you're moving the pointer forward by 64 bytes.
This means you move to the byte that is 64 bytes away from the start of the block header.
It will point you to the first byte of the ntime (offset 68), since you've already accounted for the first 64 bytes (4 bytes for Version, 32 bytes for Previous Block Hash, and 32 bytes for Merkle Root).
When looking through the sources, i noticed that the miner does double sha256 hash on
blockheader+64
.But the only thing that changes during the iterations are
nonce
values, which is the last 4 bytes on the blockheader that is 80 bytes long.According to BTC specifications:
So when the miner does (pointer arithmetic:)
header64 = mMiner.bytearray_blockheader + 64;
memcpy(mMiner.bytearray_blockheader + 76, &nonce, 4);
And you're moving the pointer forward by 64 bytes.
This means you move to the byte that is 64 bytes away from the start of the block header.
It will point you to the first byte of the
ntime
(offset 68), since you've already accounted for the first 64 bytes (4 bytes for Version, 32 bytes for Previous Block Hash, and 32 bytes for Merkle Root).It will hash
ntime
nbits
nonce
is16BitShare=nerd_sha256d(&nerdMidstate, header64, hash);
While only
nonce
is changing.Not sure about the performance improvement, but here's pseudocode:
The text was updated successfully, but these errors were encountered: