<blockquote>
<p>Another source just says that it’s just hash of the block itself, and in that block we specify the hash of the previous block’s hash.</p>
</blockquote>
<p>This is correct. The others are varying degrees of correct and incorrect. But this is the only one that is absolutely correct.</p>
<blockquote>
<p>The concept of Proof of Work is that you have X and you have an output of Z, what is the Y needed, so hash(X + Y) = Z.</p>
<p>If that's the case, can we say that X is the previous block's hash, and Y is the hash of the current block? Or am I looking this wrongly?</p>
</blockquote>
<p>Kind of.</p>
<hr />
<p>The block consists of multiple fields. It can first be broken down into two major parts: the block header, and the transactions themselves. All of the block is hashed in some way.</p>
<p>The hash of the block header is what we call the hash of the block. The hash of the block header is also what is used for the proof of work. When you interpret the block header's hash (also known as the block hash) as a 256 bit little endian integer, it must be less than a calculated target (also a 256 bit integer).</p>
<p>The block header itself can be broken further down into multiple parts. It contains the block version number, the previous block's hash, the hash of all of the transactions in the block, a timestamp, a compact representation of the target value, and a nonce.</p>
<p>Since the block header includes the previous block's hash, the block header's hash is really just the hash of the block (as it contains the hash of all of the block's transaction) in which the previous block's hash is specified within it.</p>
<p>In order to mine blocks, miners will tweak the fields in the block header until they get one that meets the target. Typically they change the nonce value (it's just a number) and the hash of all of the transactions in the block (by changing the coinbase transaction, choosing new transactions, and changing the order of transactions). Miners may also change the timestamp and the version number.</p>

CC BY-SA 3.0
2018-03-11T06:20:52.850Z
Thank you for the answer! If I got this correctly:

A block contains block version number, previous block's hash, information (transactions, timestamp other data) and a nonce. Miners try to tweak nonce (usually) or transactions inside to meet the desired hash. Is that correct?

Who gets to choose the hash that must be met so the new block can be mined?
Nelsen Liu
CC BY-SA 3.0
2018-03-11T09:24:14.937Z
@NelsenLiu yea, you're on the right track! The hash is not required to be a certain value, rather the hash must be within some pre-defined range of values. That range is defined by the current network difficulty, which sets a maximum value for a valid block hash.
chytrik
CC BY-SA 3.0
2018-03-11T15:35:51.890Z
The target value is determined individually by each node. It is a deterministic algorithm so everyone who is using the same blockchain will end up calculating the same difficulty for each block height.
Ava Chow
CC BY-SA 3.0
2018-03-11T04:04:54.683Z
2018-03-11T04:04:54.683Z
2020-06-16T11:10:03.350Z
Ava Chow
<p>I’m bit stuck in the concept of mining.</p>

<p>What are the hashes that need to be created in each block and the chain? Let’s say that we have block A - B - C forming a chain.</p>

<p>One source said that we need to come up with the hash of A and combine it with previous block’s hash forming another has, in other words: hash(A + previous block’s hash).</p>

<p>Another source just says that it’s just hash of the block itself, and in that block we specify the hash of the previous block’s hash.</p>

<p>The concept of Proof of Work is that you have X and you have an output of Z, what is the Y needed, so hash(X + Y) = Z.</p>

<p>If that's the case, can we say that X is the previous block's hash, and Y is the hash of the current block? Or am I looking this wrongly?</p>

<p>Sources:
<a href="https://www.investinblockchain.com/what-exactly-is-blockchain/" rel="nofollow noreferrer">https://www.investinblockchain.com/what-exactly-is-blockchain/</a>
<a href="https://www.youtube.com/watch?v=SSo_EIwHSd4&amp;t=1sAnd" rel="nofollow noreferrer">https://www.youtube.com/watch?v=SSo_EIwHSd4&amp;t=1sAnd</a> other sources.</p>

<blockchain><hash><proof-of-work>
What are the hashes that miners need to do to create a block?
Nelsen Liu
# What are the hashes that miners need to do to create a block?

(Asked by: username_0 on 2018-03-11)

I’m bit stuck in the concept of mining.

What are the hashes that need to be created in each block and the chain? Let’s say that we have block A - B - C forming a chain.

One source said that we need to come up with the hash of A and combine it with previous block’s hash forming another has, in other words: hash(A + previous block’s hash).

Another source just says that it’s just hash of the block itself, and in that block we specify the hash of the previous block’s hash.

The concept of Proof of Work is that you have X and you have an output of Z, what is the Y needed, so hash(X + Y) = Z.

If that's the case, can we say that X is the previous block's hash, and Y is the hash of the current block? Or am I looking this wrongly?

Sources:
<https://www.investinblockchain.com/what-exactly-is-blockchain/>
<https://www.youtube.com/watch?v=SSo_EIwHSd4&t=1sAnd> other sources.

**Tags:** blockchain, hash, proof-of-work


---

## 1 answers

### Answer by username_1 on 2018-03-11. Score: 2

> Another source just says that it’s just hash of the block itself, and in that block we specify the hash of the previous block’s hash.

This is correct. The others are varying degrees of correct and incorrect. But this is the only one that is absolutely correct.

> The concept of Proof of Work is that you have X and you have an output of Z, what is the Y needed, so hash(X + Y) = Z.
>
> If that's the case, can we say that X is the previous block's hash, and Y is the hash of the current block? Or am I looking this wrongly?

Kind of.

---

The block consists of multiple fields. It can first be broken down into two major parts: the block header, and the transactions themselves. All of the block is hashed in some way.

The hash of the block header is what we call the hash of the block. The hash of the block header is also what is used for the proof of work. When you interpret the block header's hash (also known as the block hash) as a 256 bit little endian integer, it must be less than a calculated target (also a 256 bit integer).

The block header itself can be broken further down into multiple parts. It contains the block version number, the previous block's hash, the hash of all of the transactions in the block, a timestamp, a compact representation of the target value, and a nonce.

Since the block header includes the previous block's hash, the block header's hash is really just the hash of the block (as it contains the hash of all of the block's transaction) in which the previous block's hash is specified within it.

In order to mine blocks, miners will tweak the fields in the block header until they get one that meets the target. Typically they change the nonce value (it's just a number) and the hash of all of the transactions in the block (by changing the coinbase transaction, choosing new transactions, and changing the order of transactions). Miners may also change the timestamp and the version number.

> **Comments:**
> **username_0**: Thank you for the answer! If I got this correctly:  A block contains block version number, previous block's hash, information (transactions, timestamp other data) and a nonce. Miners try to tweak nonce (usually) or transactions inside to meet the desired hash. Is that correct?  Who gets to choose the hash that must be met so the new block can be mined?  
> **username_2**: @username_0 yea, you're on the right track! The hash is not required to be a certain value, rather the hash must be within some pre-defined range of values. That range is defined by the current network difficulty, which sets a maximum value for a valid block hash.  
> **username_1**: The target value is determined individually by each node. It is a deterministic algorithm so everyone who is using the same blockchain will end up calculating the same difficulty for each block height.  

---

