<blockquote>
<p><strong>Why miners looking for zeros?</strong></p>
</blockquote>
<p>They aren't.</p>
<blockquote>
<p><strong>Is it true that miners are looking for a number of zeros ...</strong></p>
</blockquote>
<p>No.</p>
<blockquote>
<p><strong>... because if they needed to find the complete hash ...</strong></p>
</blockquote>
<p>It is nothing to do with partial or complete hashes. All hashes computed by miners are complete hashes of the hashed data.</p>
<blockquote>
<p><strong>... they will be able to see the content of the transaction?</strong></p>
</blockquote>
<p>No, miners don't need a hash in order to see the contents of the transactions.</p>
<blockquote>
<p><strong>Besides that, it is probably impossible to find a complete hash?</strong></p>
</blockquote>
<p>No. it is easy to compute a complete hash. A single modern hardware device can compute 100,000,000,000,000 complete hashes every second.</p>
<p>A hash is an unpredictable number between 0 and roughly 11579208923731619542357098500869123456789012345678901234567890123456789
Therefore most hashes will be very very big numbers and so it is difficult to find a set of data whose hash is in some small part of that range (e.g. within 0 to 21)</p>
<hr />
<p>Miners are using a brute-force trial-and-error method of finding a set of data whose hash is numerically less than the current network target value.</p>
<p><strong>For example, if the network target was 21, then a hash of 33 would be too big but a hash of 17 would be a winner.</strong> In Bitcoin the target numbers are currently much larger than 21 but the comparison is still numeric.</p>
<p>To find a set of data that hashes to a value smaller than the target they vary a part of the block data which is known as the nonce. For each variation they compute the hash and see if the hash is less than the target. There are other things the miners can change that also affect the value of the computed hash. Miners have to resort to changing these other things after they have tried every possible value of nonce.</p>
<p>The target is set by Bitcoin rules such that a hash less than the target will, on average, be found every ten minutes.</p>
<p>This is a lot of work. The arrangement of data whose hash is less than the target is proof of this work having been done. Hence the phrase proof-of-work.</p>

CC BY-SA 4.0
2021-11-04T10:37:22.923Z
2021-11-04T10:56:28.317Z
2021-11-04T10:56:28.317Z
RedGrittyBrick
<p>A hash is just a number (often encoded in hex). If you take arbitrary input data and run it through a hash function, you'll get back the 'hash' of that data. In the case of SHA256, the hash will be a number somewhere in the range of 0 to 2^256. There is no way to guess what the output will be for a given input, other than just running the hash function to see what happens.</p>
<p>What bitcoin miners are doing is trying to create a block template that includes a block header that will hash to a number that is under some network-defined value (the 'target'). In practice, this means that the valid hashes they find will start with a bunch of zeros, since the goal is to find a hash output that is less than the target. Miners will already know the transactions that they included in the block are valid, finding a valid hash does not change their ability to see or validate transactions. A valid hash is simply the 'proof of work' to show that the miner spent some amount of energy to create the block.</p>

CC BY-SA 4.0
2021-11-03T19:56:57.297Z
Thank you both! Really appreciate it :) I don't know why but somehow I was assuming that based on the content (the transactions) in the blockchain there was already a hash and miners needed to guess this hash by increasing the nonce. If I understand it correctly it is the miner that creates the hash?
Timo
CC BY-SA 4.0
2021-11-03T20:04:37.647Z
Transactions are hashed (hashes are used for various things in Bitcoin) but the miners don't change the transaction to try to get a particular hash like they do with the nonce in the block header. Transactions (and hence the transaction hash) don't get changed by the miner.
Michael Folkson
CC BY-SA 4.0
2021-11-03T19:21:35.330Z
2021-11-03T19:21:35.330Z
chytrik
<p>Miners are looking for hash with a number of leading zeros because if they do they can announce it and claim the coinbase (or mining reward). They can already see the content of every transaction that they have received through network gossip.</p>
<blockquote>
<p>it is probably impossible to find a complete hash?</p>
</blockquote>
<p>I'm not sure what you mean by &quot;complete&quot;. If you mean a hash of all zeros that is answered <a href="https://bitcoin.stackexchange.com/questions/83231/mining-what-is-the-lowest-possible-target-could-it-be-a-block-hash-of-all-zero">here</a>.</p>

CC BY-SA 4.0
2021-11-03T18:13:24.160Z
2021-11-03T18:13:24.160Z
Michael Folkson
<p>I am trying to understand how miners work.</p>
<p>Is it true that miners are looking for a number of zeros because if they needed to find the complete hash they will be able to see the content of the transaction?
Besides that, it is probably impossible to find a complete hash?</p>
<p>Please let me know if the question is unclear, thank you in advance :)</p>

<mining-theory><hash><hashpower>
Why miners looking for zeros?
Timo
# Why miners looking for zeros?

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

I am trying to understand how miners work.

Is it true that miners are looking for a number of zeros because if they needed to find the complete hash they will be able to see the content of the transaction?
Besides that, it is probably impossible to find a complete hash?

Please let me know if the question is unclear, thank you in advance :)

**Tags:** mining-theory, hash, hashpower


---

## 3 answers

### Answer by username_1 on 2021-11-04. Score: 3

> **Why miners looking for zeros?**

They aren't.

> **Is it true that miners are looking for a number of zeros ...**

No.

> **... because if they needed to find the complete hash ...**

It is nothing to do with partial or complete hashes. All hashes computed by miners are complete hashes of the hashed data.

> **... they will be able to see the content of the transaction?**

No, miners don't need a hash in order to see the contents of the transactions.

> **Besides that, it is probably impossible to find a complete hash?**

No. it is easy to compute a complete hash. A single modern hardware device can compute 100,000,000,000,000 complete hashes every second.

A hash is an unpredictable number between 0 and roughly 11579208923731619542357098500869123456789012345678901234567890123456789
Therefore most hashes will be very very big numbers and so it is difficult to find a set of data whose hash is in some small part of that range (e.g. within 0 to 21)

---

Miners are using a brute-force trial-and-error method of finding a set of data whose hash is numerically less than the current network target value.

**For example, if the network target was 21, then a hash of 33 would be too big but a hash of 17 would be a winner.** In Bitcoin the target numbers are currently much larger than 21 but the comparison is still numeric.

To find a set of data that hashes to a value smaller than the target they vary a part of the block data which is known as the nonce. For each variation they compute the hash and see if the hash is less than the target. There are other things the miners can change that also affect the value of the computed hash. Miners have to resort to changing these other things after they have tried every possible value of nonce.

The target is set by Bitcoin rules such that a hash less than the target will, on average, be found every ten minutes.

This is a lot of work. The arrangement of data whose hash is less than the target is proof of this work having been done. Hence the phrase proof-of-work.


---

### Answer by username_2 on 2021-11-03. Score: 2

A hash is just a number (often encoded in hex). If you take arbitrary input data and run it through a hash function, you'll get back the 'hash' of that data. In the case of SHA256, the hash will be a number somewhere in the range of 0 to 2^256. There is no way to guess what the output will be for a given input, other than just running the hash function to see what happens.

What bitcoin miners are doing is trying to create a block template that includes a block header that will hash to a number that is under some network-defined value (the 'target'). In practice, this means that the valid hashes they find will start with a bunch of zeros, since the goal is to find a hash output that is less than the target. Miners will already know the transactions that they included in the block are valid, finding a valid hash does not change their ability to see or validate transactions. A valid hash is simply the 'proof of work' to show that the miner spent some amount of energy to create the block.

> **Comments:**
> **username_0**: Thank you both! Really appreciate it :) I don't know why but somehow I was assuming that based on the content (the transactions) in the blockchain there was already a hash and miners needed to guess this hash by increasing the nonce. If I understand it correctly it is the miner that creates the hash?  
> **username_3**: Transactions are hashed (hashes are used for various things in Bitcoin) but the miners don't change the transaction to try to get a particular hash like they do with the nonce in the block header. Transactions (and hence the transaction hash) don't get changed by the miner.  

---

### Answer by username_3 on 2021-11-03. Score: 0

Miners are looking for hash with a number of leading zeros because if they do they can announce it and claim the coinbase (or mining reward). They can already see the content of every transaction that they have received through network gossip.

> it is probably impossible to find a complete hash?

I'm not sure what you mean by "complete". If you mean a hash of all zeros that is answered [here](https://bitcoin.stackexchange.com/questions/83231/mining-what-is-the-lowest-possible-target-could-it-be-a-block-hash-of-all-zero).


---

