Sunday, May 29, 2022

Numeric value of a hash

In the bitcoin network, miners have to compare the hash value during the 'Proof-of-Work' process.

The target hash value is stored in the header and is expressed as a 67-digit number. Miners must find a new hash of the transaction block  that is below the given target. 

To solve the hash puzzle, miners will try to calculate the hash of a block by adding a nonce to the block header repeatedly until the hash value yielded is less than the target.

But how is the value of the hash calculated? In the bitcoin network, the value of a hash is calculated as follows:

  • Hashes are typically represented as a hexadecimal string. Convert the hexadecimal value to decimal value. 
  • Get the base-2 log of the decimal value. 
This is the value that is compared against the target in the block header. 

No comments:

Post a Comment