Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
From my knowledge a header hash will be calculated like this:
- serialize all header fields, including "the nonce"
- hash the serialized header once
- hash the hashed serialized header again
- check if the result is below the target
- if no: choose a different nonce and start over
I'm referring to this site that allows you to enter some header data and calculate the header hash:
The site already calculates the serialized header that I have to use for the hashing process:
00000020382b11f859c9c16e2c6e9d81426021e4ca97e694efea01000000000000000000bddddb7ef2729a5c2d0ce4e6d567e532467ea9302d798b44bdd3134fab3994ebea380462b48b0a173b283000
So running this serialized header through SHA256 for two times gives me this hash after the first iteration:
969d0e7028705a4ca408430f5d2bcb05acbcd6c3350f43a838714a2ba5db94f0
And hashing this again would return:
9fe2e96559673ba8e038452cc161e2da87636567d95ef7ae6be800770a5cbf9f
But this is not the actual hash for this block header. Apparently, because starting with a 9 seems not be very difficult. That is the correct header:
000000000000000000055730c92292ebd5c5851e7d24ab3ba2efc1cea0b5fe81
So I'm wondering, what additional step I'm missing here?
Thank you
The problem is that you are hashing the header as a string, not as the bytes that the hex represents. If you hash it as bytes, you will get the expected hash. Both the header, and the first hash, must be treated as bytes, not a hex string.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments