Proof-of-Work (proof of work) is a consensus based on the necessity to perform long—term work (finding a solution to the problem) on the client side. the result of this work can be easily and quickly verified by the server.
The peculiarity of the calculations used lies in the asymmetry of time spent: they are significant for finding a solution and still too small for verification.
The purpose of Proof-of-Work is to verify that the required calculations were actually performed when creating a new block.
For the first time, the description of proof of work was given in the article entitled Pricing via Processing or Combatting Junk Mail of 1993.
The authors proposed the following idea to combat spam: to access a shared resource, the user must calculate some complex function. The client-side process should be much more complicated than checking the result on the server side. According to the authors, complex calculations do not create obstacles for sending several letters from a user`s computer but the necessity for constant calculations still makes this very resource intensive.
"In 1997, Adam Beck launched the Hashcash project dedicated to spam protection.
In 1999, the term Proof-of-Work appeared. It was used in the article "Proofs of Work and Bread Pudding Protocols".
"On August 16, 2004, Hal Finney, in his letter on the cypherpunks forum, suggested using reusable proof of work to organize electronic currency. Soon Satoshi Nakamoto proposed the "bitcoin" cryptocurrency in which proof of work protocol is used to significantly complicate double spending.
Mining of each block represents, in essence, a search for the function solution. The complexity of the task varies to control the frequency of finding blocks. The system is programmed in such a way that the average frequency of finding is one block in 10 minutes. Each block contains a hash of the previous block, forming a chain. It is impossible to change the block — you can only create a block at the same height, which will contain the hash of the previous block. To carry out such a process, it is necessary to do work on finding all the previous blocks. The high complexity of this process protects the block chain (blockchain) from unauthorized access and double-spending attacks.
"For 11 years of the Bitcoin network's existence, no one has been able to break the system and take advantage of its vulnerabilities."
In the early stages of its existence, Bitcoin, like many other cryptocurrencies, is vulnerable to a "51% attack". If more than a half of the computing power is concentrated in the hands of attacker, then he has the opportunity to confirm only his own blocks, while ignoring others, and this allows him to receive 100% of all bitcoins produced, as well as block any transactions. Alternatively, an attacker can rewrite the entire block generation history starting from a certain point in the past. As a result, he can catch up and overtake the current blockchain chain, making his version valid. As a result, the money stored in users' wallets for a long period will disappear.
Double spending is the repeated transfer of the same assets. This attack is divided into several subtypes.
Race type attack The attacker commits transaction X, paying for the purchase of goods, while transferring the same money to another account with transaction Y. If the seller did not wait for confirmation of the transaction and shipped the goods, then he took a big risk: there is a 50 percent chance that transaction Y can get into the true chain.
Finney Attack The attacker is trying to find the block that contains his transaction Y. However, as soon as the block is detected, the attacker sends transaction X, after which he buys the goods. The seller waits for the confirmation of transaction X and ships the goods. If a block with transaction Y appears at this moment, then a fork situation is created in which miners must choose one of two blocks to continue the blockchain chain. When concentrating a large amount of computing resources in the hands of an attacker, he can significantly increase the probability of choosing a block with operation Y. Thus, a confirmed transaction is not guaranteed to be valid.
Disadvantages of PoW
Mining using PoW algorithms consumes an extremely large amount of electricity, as it requires a constant increase in computing power. Therefore, the PoW approach is not the best solution in terms of energy efficiency.
"In 2017, one transaction on the Bitcoin network required the same amount of energy that meets the needs of a family consisting of three people and living in a small one-story house for five and a half days.
The results of calculating hash functions are not needed anywhere except in the network itself. Since the advent of technology, the community has been trying to come up with a way to direct all the computing resources of the network to solving some useful mathematical or industrial problem, but it has not been possible to implement it in its pure form.
Attempts to get rid of the disadvantages of PoW have led to the emergence of PoS and numerous hybrid variants.