Skip to content

Instantly share code, notes, and snippets.

@humbdrag
Created January 27, 2022 21:03
Show Gist options
  • Save humbdrag/778f9671db94de93ea97037e7c25ba79 to your computer and use it in GitHub Desktop.
Save humbdrag/778f9671db94de93ea97037e7c25ba79 to your computer and use it in GitHub Desktop.
Compare with target hash
block_template['merkleroot'] = calc_merkle_root(
[transaction['hash'] for transaction in block_template['transactions']]
)
block_template['nonce'] = 0
block_header = calc_block_header(block_template)
block_hash = sha256_double_hash(block_header)
block_hash < target_hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment