I have only recently started delving into the concepts of Blockchain and still trying to get a hang on the process of Mining. In my understanding, a miner has to find a certain nonce, that is a random number, which should produce a hash on combining with the "challenge string" that includes:
- the transactions he want to include in the block
- and the previous block hash
The hash is basically a value having certain number of leading zeroes and this hash becomes the identifier of the block. The other nodes in the network run the said nonce through a hash function, say SHA256, and if it returns the same hash, the block is verified and added to the Blockchain.
My question is, when combining that "challenge string" and the CORRECT nonce, why does the corresponding hash of those values start with the prefix of zeros? How does that work?