blockchain.rb
# Simple Proof of Work Algorithm:
# - Find a number p' such that hash(pp') contains leading 4 zeroes, where p is the previous p'
# - p is the previous proof, and p' is the new proof
Simple Proof of Work Algorithm:
Find a number p' such that hash(pp') contains leading 4 zeroes, where p is the previous p'
p is the previous proof, and p' is the new proof
Simple Proof of Work Algorithm : Find a number p ' such that hash ( pp ' ) contains leading 4 zeroes where p is the previous p ' p is the previous proof and p ' is the new proof
def proof_of_work(last_proof)
    proof = 0
    while !valid_proof?(last_proof: last_proof, proof: proof) do
      proof += 1
    end
    proof
  end
def proof_of_work ( last_proof ) proof = 0 while ! valid_proof? ( last_proof : last_proof , proof : proof ) do proof += 1 end proof end
Simple Proof of Work Algorithm:
 Find a number p' such that hash(pp') contains leading 4 zeroes, where p is the previous p'
 p is the previous proof, and p' is the new proof
Simple Proof of Work Algorithm : Find a number p ' such that hash ( pp ' ) contains leading 4 zeroes where p is the previous p ' p is the previous proof and p ' is the new proof
last_proof