Proof of Work is an IT entity that has been difficult to produce – because it costs money, because it takes ook a lot of time – to meet specific requirements. This entity must be created in such a way that it does not take time to verify that it meets these criteria: the purpose of the proof of work is that there is no longer a need to take time to check these things.To create proof of work, a random process can be used with low probabilities, so that a large amount of testing is required before satisfactory proof of work can be obtained. Bitcoin uses the so-called “Hashcash” proof of work.
One of Hashcash’s applications is to check that this or that email address is not spam. To do this, the owner of the e-mail address is asked to provide a “proof of work” that requires manual action on his part. This is not difficult for a human being, but for an algorithm that automatically generates a lot of email addresses, it would take a lot of effort to provide the necessary proof of work.Blocks of the blockchainThe same idea is used for Bitcoin, precisely for the generation of new blocks of the blockchain. This proof of work validates a block as having been correctly built, as having successfully archived all Bitcoin transactions. To the proof of work corresponds a difficulty that is adjusted every 2016 blocks so that the rate of creation of a new block remains around 10 minutes.
Creating a new block is an outright exploit as it is unlikely to succeed (that’s why we are talking lottery about block mining), which computer on the Bitcoin network will arrive is perfectly unpredictable.For a block to be valid, its hash must be less than or equal to the target value. If so, then it will mean that each block has been correctly generated – as a reminder, each new block in the blockchain must contain information from all previous blocks.
The most commonly used proof of work system is the SHA-256, which relies on a 256-bit encryption system.The target valueThe target value is an incredibly large 256-bit number that all Bitcoin clients share. The hash says SHA-256 for the header of a block of a being less than or equal to the current target of the network so that it is accepted by the latter. The lower the target value, the harder it is to generate a block.
Generating a block is not really an equation to solve but rather a lottery. Each hash provides a random digit between 0 and the maximum value of a 256-bit number (whose size is impossible to imagine, literally). If your hash is less (or equal) than the target value, you “win”: you create a new block, create bitcoins and receive as a reward.
If your hash is greater than the target value, then it is said that you increment a nuncio. This strange jargon means that an empty number of information (so it does not change the block data) is added to your hash; this action has the effect of completely changing the hash digit. As long as you do not find the right number, you will continue to increment this nuncio.Each 2016 block (which takes, in optimal conditions, 2 weeks), each Bitcoin client compares the real time it took to generate these blocks with the ideal 2 week time, and will change the target value by a percentage equivalent to the difference between the two times. This makes the proof of work more, or less difficult. However, there is never a change of more than a factor of 4 for each difficulty revision to avoid large differences.
What is proof-of-stake?Proof-of-stake (PoS) is a method by which a chain of blocks aims to reach a distributed consensus.While Proof-of-Work (PoW) requires users to run the hash algorithms multiple times by adding a random alphanumeric string to the block data until the set’s fingerprint is below a given threshold, the proof of interest requires the user to prove possession of a certain amount of e-money (their “participation”) to pretend to validate additional blocks in the blockchain and to receive the reward.Peercoin was the first cybermoney to use the proof of stake.
Other implementations have been attempted using different methods including BitShares, ShadowCash, Nxt, BlackCoin, NuShares / NuBits and Qora. Ethereum has planned a transition from Proof of Work (PoW) to Proof of Issue (PoS) in its final deployment. Peercoin and Decred use a hybrid PoW / PoS approach to try to take advantage of both systems and create a more robust consensus.The main advantage of Proof-of-stake is that it avoids the phenomenal energy expenditure of Proof-of-Work. On the other hand, many people generally believe that the blockchain thus forged does not have the same robustness and the same level of immutability of Bitcoin Proof-of-Work.
Some research efforts focus on a hybrid Proof-of-work / Proof-of-stake mechanism.Are there alternatives?Proof of Importance: selection based on blockchain usage, seniority, amount of currency owned and / or other criteria.Proof of Activity: selection based on the actual activity of the miner, to encourage use of the blockchain.Proof of Capacity: selection according to the storage capacity of the minerEach consensus method has its advantages and disadvantages.
It is even possible to combine several protocols!