<blockquote>
<p><strong>Python code error : Hash greater than Target</strong></p>
</blockquote>
<p>It's not an error, it is a genuine result from a piece of educational or artistic software. It isn't intended to be a useful piece of software for actual mining.</p>
<hr />
<p>According to <a href="https://github.com/muimota/miniminer" rel="nofollow noreferrer">https://github.com/muimota/miniminer</a></p>
<blockquote>
<p>The objetive of this projects is to write the simplest miner ever to be embeded in different art projects.</p>
</blockquote>
<p>So this is art, not really a serious project for any other purpose. Although I guess it does provide an educational example of how to interact with a mining pool.</p>
<p>As Pieter Wuille noted in a comment, It chooses just one random nonce and calculates a hash and tests to see if it succeeded in finding a hash lower than the target set by the mining pool.</p>
<p>Normally, for real mining, you'd maybe need to run the inner part of this (excluding pool communication) trillions of times every second so that trillions of <em>different</em> nonce values are tested every second. Obviously you can't achieve that rate using python, especially when using only standard PC hardware.</p>
<p>(community wiki, since this answer doesn't add much to the existing comments)</p>

CC BY-SA 4.0
2021-06-21T08:50:08.953Z
Thank you for flashing light on the issue RedGrittyBrick. As i am just a beginner with Python and Blockchain need to educate myself more. I am so glad you guys are taking even small issues on a serious note. Thank you. @Pieter Wuille
Dinkan
CC BY-SA 4.0
2021-06-20T19:48:04.437Z
2021-06-20T19:54:36.020Z
2021-06-20T19:54:36.020Z
RedGrittyBrick
<p>While trying to run a reference code from GitHUb i am getting an error &quot;Cannot Mine-Hash is greater than Target&quot;. As i am just a beginner with coding i am not able to figure this out. Kindly help me to fix this</p>
<p>The code is <a href="https://github.com/muimota/miniminer/blob/master/miner.py" rel="nofollow noreferrer">here</a>.</p>
<p>Any help regarding the same is highly appreciated. Thank you</p>

CC BY-SA 4.0
2021-06-20T15:27:30.353Z
This is entirely expected. The code you link to performs exactly 1 hash attempt. In case the obtained hash does not satsisfy the miner's share difficulty, you will get this error.
Pieter Wuille
<blockchain><bitcoind><api><python>
Python code error : Hash greater than Target
Dinkan
# Python code error : Hash greater than Target

(Asked by: username_0 on 2021-06-20)

While trying to run a reference code from GitHUb i am getting an error "Cannot Mine-Hash is greater than Target". As i am just a beginner with coding i am not able to figure this out. Kindly help me to fix this

The code is [here](https://github.com/muimota/miniminer/blob/master/miner.py).

Any help regarding the same is highly appreciated. Thank you

**Tags:** blockchain, bitcoind, api, python

> **Comments:**
> **username_1**: This is entirely expected. The code you link to performs exactly 1 hash attempt. In case the obtained hash does not satsisfy the miner's share difficulty, you will get this error.  

---

## 1 answers

### Answer by username_2 on 2021-06-20. Score: 2

> **Python code error : Hash greater than Target**

It's not an error, it is a genuine result from a piece of educational or artistic software. It isn't intended to be a useful piece of software for actual mining.

---

According to <https://github.com/muimota/miniminer>

> The objetive of this projects is to write the simplest miner ever to be embeded in different art projects.

So this is art, not really a serious project for any other purpose. Although I guess it does provide an educational example of how to interact with a mining pool.

As username_1 noted in a comment, It chooses just one random nonce and calculates a hash and tests to see if it succeeded in finding a hash lower than the target set by the mining pool.

Normally, for real mining, you'd maybe need to run the inner part of this (excluding pool communication) trillions of times every second so that trillions of *different* nonce values are tested every second. Obviously you can't achieve that rate using python, especially when using only standard PC hardware.

(community wiki, since this answer doesn't add much to the existing comments)

> **Comments:**
> **username_0**: Thank you for flashing light on the issue username_2. As i am just a beginner with Python and Blockchain need to educate myself more. I am so glad you guys are taking even small issues on a serious note. Thank you. @username_1  

---

