this field, we can get a different hash value of the block. The property of a good hash function is if we change the key even if a little bit, the resultant value will be completely different. So, if for a given nonce, we do not get the resultant hash to be less than the difficulty target, then we change the nonce and the hash again. And thus, we repeat the process.
Why do we need the counter?
The counter is a 32-bit parameter. Each time we try with a different nonce field, we increment the value of this counter so that we do not repeat the work.
What is the ‘hashcash function’?
The hashcash function is the core of Bitcoin mining. Like any other cryptographic hash function, it uses a hash function as a building block. The hashcash function can be instantiated with different hash functions like hashcash-SHA1, hashcash-SHA256, etc.
The hashcash algorithm is relatively easier to understand.
Let’s assume for a pre-image x, we get a hash value y.
So, y = H(x)
The task is to find another pre-image x’ so that,
y = H(x’)
So, the overall idea is, you have computed a fixed value of service string, now use the hashcash algorithm to get a nonce value so that the resultant hash is less than the difficulty target.
I hope this helps.








































0 Comments