Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am scharton on github.
  • I am scharton (https://keybase.io/scharton) on keybase.
  • I have a public key ASCcjkyomMZk2oYrsJjVoe1fjttbK5HwKRds7bsaAJsuAgo

To claim this, I am signing this object:

@scharton
scharton / proof_of_work.py
Last active November 30, 2023 15:41
Python proof of work example from Mastering Bitcoin
import hashlib
import time
max_nonce = 2 ** 32 # 4 billion
def proof_of_work(header, difficulty_bits):
# calculate the difficulty target
target = 2 ** (256-difficulty_bits)