<p>The hash is a result of computing two rounds of SHA256 on the block header. If you set the hash yourself, when other nodes try to verify the hash by performing the aforementioned computation, it will not (however, there is an infinitesimal chance) result in "63 zeros followed by a 1". I suggest reading about <a href="https://en.wikipedia.org/wiki/Cryptographic_hash_function" rel="noreferrer">hash functions</a>. </p>

<p>The only reliable way to create a valid hash is to continuously compute the hash on the actual block header, while modifying the contents of the block so that the block is still valid (e.g. nonce, transactions, block version, etc.), but gives you a lot of tries (guesses) until you get an output that is valid. It is basically brute forcing, so having fast, efficient mining hardware is an advantage.</p>

<p>See also: <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="noreferrer">Block Hashing Algorithm</a></p>

CC BY-SA 4.0
2019-08-29T17:01:08.330Z
2019-08-29T17:01:08.330Z
JBaczuk
<p>As @stewbasic succinctly pointed out in a comment: </p>

<blockquote>
  <p><strong><em>The miner does not pick a hash. The miner picks a header, from which the hash is computed.</em></strong></p>
</blockquote>

<p>The block hash is the digest of hashing the block header with SHA-256d. This digest must meet the difficulty requirement when interpreted as a number, and since it's unique is also used as an identifier for the block.</p>

<p>The hash cannot be picked arbitrarily, as that would require you to revert a hash function. This contradicts the <a href="https://en.wikipedia.org/wiki/Cryptographic_hash_function#Properties" rel="nofollow noreferrer">pre-image resistance</a> property of cryptographic hash functions which states:</p>

<blockquote>
  <p>Given a hash <em>h</em>, it is difficult to find a message <em>m</em> that for which <em>h = hash(m)</em>. </p>
</blockquote>

<p>In fact, the proof-of-work puzzle of trying to find a block which has a specific prefix is essentially requiring miners to solve a much easier sub-problem: finding a <em>partial pre-image</em>.</p>

<p>In conclusion, the only practical way for a miner to pick a block hash is by finding a block header whose digest meets the difficulty statement.</p>

CC BY-SA 4.0
2019-08-29T17:50:30.100Z
Not a programmer here, so I'm trying to understand this on simple terms. Let's use numbers 0-9. Target hash is 6. One miner picks number 2, which is below the target hash, is this sufficient?
jack
CC BY-SA 4.0
2019-08-29T17:56:00.683Z
Where does this simple analogy break down?
jack
CC BY-SA 4.0
2019-08-29T18:22:09.247Z
Yes, any number that is smaller than the target hash meets the difficulty. But they cannot just "pick" 2. They have to try many block templates until they find one which happens to hash to 2. :)
Murch
CC BY-SA 4.0
2019-08-30T01:14:52.810Z
@jack to be more explicit, the miner does not pick a hash. The miner picks a header, from which the hash is computed.
stewbasic
CC BY-SA 4.0
2019-08-29T17:38:57.457Z
2019-08-30T21:54:45.797Z
2019-08-30T21:54:45.797Z
Murch
<p>In terms of 'proof of work' my novice understanding is that miners are tying to come up with a 64-digit hexadecimal number, "hash," that is less than or equal to the target hash.</p>

<p>Can't miners always get lower than the target has by inputting "63 zeros followed by a 1?</p>

<p>Beginner here, I apologize for my simplistic understanding.</p>

CC BY-SA 4.0
2019-08-29T20:50:13.220Z
Possible duplicate of [What is preventing me from simply constructing a hash that's lower than the current target?](https://bitcoin.stackexchange.com/questions/85994/what-is-preventing-me-from-simply-constructing-a-hash-thats-lower-than-the-curr)
chytrik
<difficulty><proof-of-work><block-validity><block-hash>
Why can't miners meet the difficulty by picking a low number for the block hash?
jack
# Why can't miners meet the difficulty by picking a low number for the block hash?

(Asked by: username_0 on 2019-08-29)

In terms of 'proof of work' my novice understanding is that miners are tying to come up with a 64-digit hexadecimal number, "hash," that is less than or equal to the target hash.

Can't miners always get lower than the target has by inputting "63 zeros followed by a 1?

Beginner here, I apologize for my simplistic understanding.

**Tags:** difficulty, proof-of-work, block-validity, block-hash

> **Comments:**
> **username_1**: Possible duplicate of [What is preventing me from simply constructing a hash that's lower than the current target?](https://bitcoin.stackexchange.com/questions/85994/what-is-preventing-me-from-simply-constructing-a-hash-thats-lower-than-the-curr)  

---

## 2 answers

### Answer by username_2 on 2019-08-29. Score: 5

The hash is a result of computing two rounds of SHA256 on the block header. If you set the hash yourself, when other nodes try to verify the hash by performing the aforementioned computation, it will not (however, there is an infinitesimal chance) result in "63 zeros followed by a 1". I suggest reading about [hash functions](https://en.wikipedia.org/wiki/Cryptographic_hash_function).

The only reliable way to create a valid hash is to continuously compute the hash on the actual block header, while modifying the contents of the block so that the block is still valid (e.g. nonce, transactions, block version, etc.), but gives you a lot of tries (guesses) until you get an output that is valid. It is basically brute forcing, so having fast, efficient mining hardware is an advantage.

See also: [Block Hashing Algorithm](https://en.bitcoin.it/wiki/Block_hashing_algorithm)


---

### Answer by username_3 on 2019-08-29. Score: 1

As @username_4 succinctly pointed out in a comment:

> ***The miner does not pick a hash. The miner picks a header, from which the hash is computed.***

The block hash is the digest of hashing the block header with SHA-256d. This digest must meet the difficulty requirement when interpreted as a number, and since it's unique is also used as an identifier for the block.

The hash cannot be picked arbitrarily, as that would require you to revert a hash function. This contradicts the [pre-image resistance](https://en.wikipedia.org/wiki/Cryptographic_hash_function#Properties) property of cryptographic hash functions which states:

> Given a hash *h*, it is difficult to find a message *m* that for which *h = hash(m)*.

In fact, the proof-of-work puzzle of trying to find a block which has a specific prefix is essentially requiring miners to solve a much easier sub-problem: finding a *partial pre-image*.

In conclusion, the only practical way for a miner to pick a block hash is by finding a block header whose digest meets the difficulty statement.

> **Comments:**
> **username_0**: Not a programmer here, so I'm trying to understand this on simple terms. Let's use numbers 0-9. Target hash is 6. One miner picks number 2, which is below the target hash, is this sufficient?  
> **username_0**: Where does this simple analogy break down?  
> **username_3**: Yes, any number that is smaller than the target hash meets the difficulty. But they cannot just "pick" 2. They have to try many block templates until they find one which happens to hash to 2. :)  
> **username_4**: @username_0 to be more explicit, the miner does not pick a hash. The miner picks a header, from which the hash is computed.  

---

