miner/miner.py
def proof_of_work(last_proof, difficulty):
    """
    Simple Proof of Work Algorithm
    Find a number p such that hash(last_block_string, p) contains 6 leading
    zeroes
    """
    print("starting work on a new proof")
    proof = 0
    guess = f'{last_proof}{proof}'.encode()
    print(hashlib.sha256(guess).hexdigest())
    print(proof)
    
    while valid_proof(last_proof, proof, difficulty) is False:
        
        proof += 1
    
    return proof

    Simple Proof of Work Algorithm
    Find a number p such that hash(last_block_string, p) contains 6 leading
    zeroes
    
Simple Proof of Work Algorithm
Find a number p such that hash(last_block_string, p) contains 6 leading
zeroes
Simple Proof of Work Algorithm Find a number p such that hash ( last_block_string p ) contains 6 leading zeroes
def proof_of_work(last_proof, difficulty):
    print("starting work on a new proof")
    proof = 0
    guess = f'{last_proof}{proof}'.encode()
    print(hashlib.sha256(guess).hexdigest())
    print(proof)
    while valid_proof(last_proof, proof, difficulty) is False:
        proof += 1
    return proof
def proof_of_work ( last_proof , difficulty ) : print ( "starting work on a new proof" ) proof = 0 guess = f'{last_proof}{proof}' . encode ( ) print ( hashlib . sha256 ( guess ) . hexdigest ( ) ) print ( proof ) while valid_proof ( last_proof , proof , difficulty ) is False : proof += 1 return proof
Simple Proof of Work Algorithm
Find a number p such that hash(last_block_string, p) contains 6 leading
zeroes
Simple Proof of Work Algorithm Find a number p such that hash ( last_block_string p ) contains 6 leading zeroes
"""
    Simple Proof of Work Algorithm
    Find a number p such that hash(last_block_string, p) contains 6 leading
    zeroes
    """
last_proof
difficulty