0

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.

Any help regarding the same is highly appreciated. Thank you

1
  • 2
    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. Jun 20, 2021 at 15:27

1 Answer 1

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

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)

1
  • 1
    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
    Jun 21, 2021 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.