| Algorithm 2 Proof-of-Work (PoW) consensus |
|
Input: Candidate block with transactions Output: Valid block with valid nonce 1: procedure PROOF_OF_WORK() 2: Nonce ← 0 3: while TRUE do 4: HashVal ← H(, Nonce) 5: if HashVal < DifficultyTarget then 6: return (, Nonce, HashVal)//Valid block found 7: else 8: Nonce ← Nonce + 1 9: end if 10: end while 11: end procedure |