Last active
April 24, 2023 09:08
-
-
Save jakiki6/d5563647d62d391559fd152cda43f8f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
best = 0 | |
bhash = 2 ** 256 | |
b1 = bytes.fromhex("0100000000000000000000000000000000000000000000000000000000000000000000003BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A29AB5F49FFFF001D") | |
nonce = 0 | |
while bhash > 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff: | |
block = b1 + nonce.to_bytes(4, "big") | |
hd = hashlib.sha256(hashlib.sha256(block).digest()).hexdigest()[::-1] | |
h = int(hd, 16) | |
if bhash > h: | |
bhash = h | |
best = nonce | |
print(hd, nonce) | |
nonce += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment