<p>on functionality:</p>

<p>from Andreas book "Mastering Bitcoin", Chapter 7:</p>

<blockquote>
  <p>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...</p>
</blockquote>

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

<blockquote>
  <p>Is it only there for reference ??</p>
</blockquote>

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

<blockquote>
  <p>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.</p>
  
  <p>using block height?</p>
</blockquote>

<p>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.</p>

<p>Further down, he mentions, that this comes into play when discussing forks.</p>

CC BY-SA 3.0
2017-09-02T20:36:33.587Z
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
CC BY-SA 3.0
2017-09-04T09:16:48.323Z
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
CC BY-SA 3.0
2017-09-02T19:03:16.627Z
2017-09-02T19:03:16.627Z
pebwindkraft
<p>I believe there are around 3 types of overall hashes that we deal with in Bitcoin.</p>

<ol>
<li>block hashes</li>
<li>Merkle tree hashes (makes transactions tamper proof by hashing them up to the Merkle root) </li>
<li>public-private key hashes (used as part of the UTXO model to generate addresses derived from the public key)</li>
</ol>

<p>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. </p>

CC BY-SA 3.0
2017-09-01T17:58:16.110Z
maybe this: https://bitcoin.stackexchange.com/questions/18996/why-are-blocks-hashed?rq=1
pebwindkraft
CC BY-SA 3.0
2017-09-02T07:58:13.183Z
I read that answer, and that isnt helping me understand.
Piyush Chittara
<blockchain><hash><bitcoin-core-development>
Why do we need block hashes in blockchain?
Piyush Chittara
# Why do we need block hashes in blockchain?

(Asked by: username_0 on 2017-09-01)

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.

**Tags:** blockchain, hash, bitcoin-core-development

> **Comments:**
> **username_1**: maybe this: https://bitcoin.stackexchange.com/questions/18996/why-are-blocks-hashed?rq=1  
> **username_0**: I read that answer, and that isnt helping me understand.  

---

## 1 answers

### Answer by username_1 on 2017-09-02. Score: 2 | Accepted answer

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.

> **Comments:**
> **username_0**: 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?  
> **username_1**: 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...  

---

