1

I believe there are around 3 types of overall hashes that we deal with in Bitcoin.

  1. block hashes
  2. Merkle tree hashes (makes transactions tamper proof by hashing them up to the Merkle root)
  3. public-private key hashes (used as part of the UTXO model to generate addresses derived from the public key)

I get the functionality of all hashes other than 1st. Is it only there for reference ?? We could have used block height as block reference and traversal and added nonce in that for our POW requirement.

2

on functionality:

from Andreas book "Mastering Bitcoin", Chapter 7:

The primary identifier of a block is its cryptographic hash, a digital fingerprint, made by hashing the block header twice through the SHA256 algorithm. The resulting 32-byte hash is called the block hash but is more accurately the block header hash, because only the block header is used to compute it...

This block hash is a reference to a previous block hash, which connects this block to the previous block in the blockchain.

Is it only there for reference ??

no, it's a pointer to the previous block, so the chain can be established. As in the linked article:

one can not simply create a block "isolated" from the blockchain and then just "insert" it in the blockchain to win the reward it's necessary that a previous block is known before a new valid one is created.

using block height?

again from Andreas book: A block’s block hash always identifies a single block uniquely. A block also always has a specific block height. However, it is not always the case that a specific block height can identify a single block. Rather, two or more blocks might compete for a single position in the blockchain.

Further down, he mentions, that this comes into play when discussing forks.

  • So, the main purpose is to create a unique previous reference only right ?? And the reason why we are using SHA256 here is just to make sure that it is collision resistant? – Piyush Chittara Sep 2 '17 at 20:36
  • unique reference: yes, this is how I got it as well. SHA256: I think it has the very good "reputation", that you can go quickly in one direction, but it is extremly hard to reverse. So collision "proof" might only be the second idea... – pebwindkraft Sep 4 '17 at 9:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.