Skip to main content
. 2026 Feb 19;26(4):1326. doi: 10.3390/s26041326
Algorithm 2 Proof-of-Work (PoW) consensus
Input: Candidate block B with transactions
Output: Valid block with valid nonce
1: procedure PROOF_OF_WORK(B)
2:   Nonce ← 0
3:   while TRUE do
4:     HashVal ← H(B, Nonce)
5:     if HashVal < DifficultyTarget then
6:       return (B, Nonce, HashVal)//Valid block found
7:     else
8:       Nonce ← Nonce + 1
9:     end if
10:   end while
11: end procedure