**PROOF OF WORK did not appear with the Bitcoin. Its main purpose is to secure the network while it membres find an agreement on the order of the transactions that will be added to the blockchain.**

**The concept of “proof of work” exists since a long time.** The first modern application, submitted in 1996 by Adam back under the name of **“Hashcash”**, used a mechanism of “proof of work” based on the algorithm SHA256 (such as the one used by the protocol Bitcoin), as an anti-spam by associating the reception of an email to a mechanism of proof-of work. As we will see, one of the main features of proof-of-work is its cost, due to the operations that must be realized and therefore of computing capacity and energy sectors which are required.

In a decentralized network such as those based on a blockchain, the difficulty is to find an agreement among membres on the order of transactions which must be added. It is the whole question of the** Conensus on the network**. **Proof of work is one of the mechanisms that allows to reach this agreement while ensuring the security of the network**. And for this no matter which must not be able to add blocks to the blockchain as he hears and get the reward. It must first demonstrate its involvement by putting at the disposal of the members of the network the computing capacity of its computer (today a computer is no longer sufficient to undermine the bitcoin, only the farms of minages and mining pools may still participate).

The proof of work allows the minors to say to the rest of the network, “Look I have used a lot of capacity of calculation (CPU), lots of equipment and lots of energy at the service of the network, I went through the POW process and I have the evidence that I finished first, so now I can add the block and receive the reward who is going to pay for all these costs.”

It is generally considered that the bitcoin network consumes as much energy as a country like Ireland, but what is not being said enough, is that this energy is used to run the machines for an absurd exercise, the proof of work, which just serves to determine which of the minors will have the right to add the block to the blockchain. This is also why many new systems of consensus have recently appeared such that the proof of stake or the delegated Proof of stake in view to limit this consumption of energy.

**Try to define the mechanism of the POW**

The mechanism of “proof of work” can be explained in relatively simple terms: it is the fact for a participant of the network (in the case of the bitcoin, a minor) to submit to all other members of the network, the result of the calculations that he has done. The operations to be carried out are not in themselves complicated, but must be carried out such an important number of times that the minor must incur significant computing capacity (CPU). The minor must indeed find a random figure. For this he will try its chance until he find the number. It will apply the hashing algorithm on a same group of data until he obtains the result that it seeks.

What is an hashing algorithm?It is a mathematical formula which is applied to a variable number of data (the “input”) in order to transform them into a fixed number of data corresponding to the digital borrows data (“output”). In the case of the algorithm SHA256 the size of the code is always 256 bits. The hashing system is used in many other areas that bitcoin to check that the initial data (“input”) have not been changed. In fact two different input may not give an identical output identical. For example if we submit the phrase “Bitcoin is a currency of the future” to the algorithm SHA256, we will get a code of 256 bits, which will look like the following code: “0F7becfd3bcd1a82E06663C97176ADD89E7DEE0268of46F94e7e11BC3863E148”. Now if we add a point to the sentence and the re-submit it to the algorithm, the code obtained will be completely different (even if it will always be 256-bit). In other words, it is impossible to find two different inputs which would give the same output. It is also important to remember that the algorithm of hash only works in one direction and that it is impossible to find the input from the output.

**More zero in the result means increased difficulty**

More concretely the minor must find a result starting with a number of zero. The greater the number of zero, the more difficult it is for the minor to find the result and the more it will have to try his luck before finding it.

**Yet the number of zero (and therefore the difficulty) is adjusted to the number of minors on the network (and their computer capacity or hashing power) to be sure that it will take an average of 10 minutes to find the solution**. Once it has found this figure, the other members of the network can instantly check the solution.

**How a minor manages to find the result of a hash containing a number of zero, if he does not know the input data that must be submitted to the hash?** Since the minor may not find the Input data (“input”) from the result (“output”), he is going to try his luck until he located the Input data enabling him to obtain the output data corresponding to the objective of difficulty required, which is the number starting with a number of zero sufficient to be validated by the Protocol Bitcoin and thus be added to the blockchain.

To do this it will always use the same data to which he will add a “Nonce”, which will change in each test, until he locates the Nonce allowing him to find the good result.

If we take the example mentioned above, the minor shall compute as follows:

Bitcoin is a currency of the future1 = 0FDG155sd1fgsd5133D5fgdfgdbtnnjd3x5g4m3f5H4GZS3Dg5….

Bitcoin is a currency of the future2 = 0wnjsbfd4yj35zs4EGN35Y4bzs3E5F43ZN57has3d5nx3t5b73…..

Bitcoin is a currency of the future3 = 00asefnjj574DM3dm5y4MH3d54d3DMH43d54GDF35H4S486…

(…..)

Bitcoin is a currency of the future4635445614 = 000sdrgf7n3a547sd3BA5s4nj3S54FB3a54a3a45……

in yellow this are the “Nonce” applied by the minor to the same input data (“Bitcoin is a currency for the Future”). The minor test them one by one. In Green, it is the number of zero in the result of the hashing algorithm, required to validate the block. If the level of difficulty required by the Protocol Bitcoin is three zero, then the minor tries the “Nonce” randomly until he obtains a result with three zero. It is important to note that the level of difficulty is constantly adjusted to the number of minors present on the network and their level of sophistication to ensure that a nonce is found all the 10 minutes.

Once the minor has found the nonce of the block to validate this block, the latter shall transmit to the other minors for validation. The latter who now have the complete input data will be able to check instantly that the minor has carried out the research work of the Nonce and thus validate the block.

To give an order of idea, at present time, taking into account the level of difficulty, it is necessary to count up to 150 000 billion of attempts to find the correct input. This represents 600 trillons of calculation of the algorithm SHA256 made every second around the world. We are far from the beginning where the level of difficulty allowed to mine bitcoin from a laptop, minors are now data center dedicated solely to this activity.

**THANK YOU for having read this article. If you interested, please do not hesitate to the LIKER and share!! If you have questions, you can add them in the comments and we will answer you.**

[…] So to mitigate this block chains have something that is called proof of work, it’s a mechanism that slows down the creation of new blocks in bitcoins case it takes about minutes to calculate the required proof of work and add a new block to the chain this mechanism makes it very hard to tamper with the blocks because, if you tamper with one block you’ll need to recalculate the proof of work for all the following blocks so the security of a block gene comes from its creative use of hashing and the proof of work mechanism. […]