This work boils down to finding a number noncethat when adde to the block data produces a hash starting with a certain number of zeros. Main components Block Data The information we want to store in the block. Nonce The number we will change to change the block hash. Target condition the number of leading zeros in the hash that we want to obtain.
Pseudo code import shashlik def proofed feworkheader difficulty bits target difficultyebits for nonce in range nonce input fheadernonce. Encode hasheresult hashlib. Shainput hex digest printf hasheresult return hasheresult nonce print return nonce header difficulty Slovenia Phone Number bits proofeofe work header difficultyebits difficulty bits determines the difficulty of the task the higher the value the more difficult it is to find a suitable hash.

In this case the system looks for nonce which when adde to header produces a hash corresponding to the given difficulty. Mining farms which use huge amounts of equipment consume large amounts of electricity raising concerns about environmental impact. In response to this alternative consensus mechanisms such as Proof of Stake have recently emerge offering more energyefficient solutions. Proof of Stake The first mention of PoS can be trace back to on the Bitcoin.