# Proof of work

Proof of work (also written as proof-of-work, an abbreviated PoW) is a form of cryptographic proof in which one party (the prover) proves to others (the verifiers) that a certain amount of a specific computational effort has been expended. Verifiers can subsequently confirm this expenditure with minimal effort on their part. The concept was first implemented in Hashcash by Moni Naor and Cynthia Dwork in 1993 as a way to deter denial-of-service attacks and other service abuses such as spam on a network by requiring some work from a service requester, usually meaning processing time by a computer. The term "proof of work" was first coined and formalized in a 1999 paper by Markus Jakobsson and Ari Juels. The concept was adapted to digital tokens by Hal Finney in 2004 through the idea of "reusable proof of work" using the 160-bit secure hash algorithm 1 (SHA-1).
Proof of work was later popularized by Bitcoin as a foundation for consensus in a permissionless decentralized network, in which miners compete to append blocks and mine new currency, each miner experiencing a success probability proportional to the computational effort expended. PoW and PoS (proof of stake) remain the two best known Sybil deterrence mechanisms. In the context of cryptocurrencies they are the most common mechanisms.
A key feature of proof-of-work schemes is their asymmetry: the work – the computation – must be moderately hard (yet feasible) on the prover or requester side but easy to check for the verifier or service provider. This idea is also known as a CPU cost function, client puzzle, computational puzzle, or CPU pricing function. Another common feature is built-in incentive-structures that reward allocating computational capacity to the network with value in the form of cryptocurrency.
The purpose of proof-of-work algorithms is not proving that certain work was carried out or that a computational puzzle was "solved", but deterring manipulation of data by establishing large energy and hardware-control requirements to be able to do so. Proof-of-work systems have been criticized by environmentalists for their energy consumption.

## Background

The concept of Proof of Work (PoW) has its roots in early research on combating spam and preventing denial-of-service attacks. One of the earliest implementations of PoW was Hashcash, created by British cryptographer Adam Back in 1997. It was designed as an anti-spam mechanism that required email senders to perform a small computational task, effectively proving that they expended resources (in the form of CPU time) before sending an email. This task was trivial for legitimate users but would impose a significant cost on spammers attempting to send bulk messages.
Hashcash's system was based on the concept of finding a hash value that met certain criteria, a task that required computational effort and thus served as a "proof of work." The idea was that by making it computationally expensive to send large volumes of email, spamming would be reduced.
One popular system, used in Hashcash, uses partial hash inversions to prove that computation was done, as a goodwill token to send an e-mail. For instance, the following header represents about 2$^{52}$ hash computations to send a message to calvin@comics.net on January 19, 2038:
It is verified with a single computation by checking that the SHA-1 hash of the stamp (omit the header name X-Hashcash: including the colon and any amount of whitespace following it up to the digit '1') begins with 52 binary zeros, that is 13 hexadecimal zeros:
Whether PoW systems can actually solve a particular denial-of-service issue such as the spam problem is subject to debate; the system must make sending spam emails obtrusively unproductive for the spammer, but should also not prevent legitimate users from sending their messages. In other words, a genuine user should not encounter any difficulties when sending an email, but an email spammer would have to expend a considerable amount of computing power to send out many emails at once. Proof-of-work systems are being used by other, more complex cryptographic systems such as bitcoin, which uses a system similar to Hashcash.

## Evolution of Proof-of-Work Algorithms

Proof of work traces its theoretical origins to early efforts to combat digital abuse, evolving significantly over time to address security, accessibility, and broader applications beyond its initial anti-spam purpose. The idea first emerged in 1993 as a deterrent for junk mail, but it was Satoshi Nakamoto’s 2008 whitepaper, "Bitcoin: A Peer-to-Peer Electronic Cash System," that solidified proof of work's potential as a cornerstone of blockchain networks. This development reflects the rising demands for secure, trustless systems.
The earliest appearance of proof of work was in 1993, when Cynthia Dwork and Moni Naor proposed a system to curb junk email by requiring senders to perform computationally demanding tasks. In their paper, "Pricing via Processing or Combatting Junk Mail," they outlined methods such as computing modular square roots, designed to be challenging to solve yet straightforward to verify, establishing a foundational principle of proof of work’s asymmetry. This asymmetry is the crucial to the effectiveness of proof of work, ensuring that tasks like sending spam are costly for attackers, while verification remains efficient for legitimate users.
This conceptual groundwork found practical use in 1997 with Adam Back’s Hashcash, a system that required senders to compute a partial hash inversion of the SHA-1 algorithm, producing a hash with a set number of leading zeros. Described in Back’s paper "Hashcash: A Denial of Service Counter-Measure," Hashcash imposed a computational cost to deter spam while allowing recipients to confirm the work effortlessly, laying a critical foundation for subsequent proof of work implementations in cryptography and blockchain technology.
Bitcoin, launched in 2009 by Satoshi Nakamoto, marked a pivotal shift by adapting Hashcash’s proof of work for cryptocurrency. Nakamoto’s Bitcoin whitepaper outlined a system using the SHA-256 algorithm, where miners compete to solve cryptographic puzzles to append blocks to the blockchain, earning rewards in the process. Unlike Hashcash’s static proofs, Bitcoin’s proof of work algorithm dynamically adjusts its difficulty based on the time taken to mine the previous block, ensuring a consistent block time of approximately 10 minutes, creating a tamper-proof chain. This innovation transformed proof of work from a standalone deterrent into a consensus mechanism for a decentralized network, emphasizing financial incentives over computational effort.
However, Bitcoin was not perfect. Miners began exploiting Bitcoin's proof of work with specialized hardware like ASICs. Initially mined with standard CPUs, Bitcoin saw a rapid transition to GPUs and then to ASIC, which vastly outperformed general hardware in solving SHA-256 puzzles. This gave ASICs miners an overwhelming advantage, rendering casual participants insignificant, which undermines Bitcoin's initial vision of a decentralized network accessible to all.
To address Bitcoin’s increasing reliance on specialized hardware, proof of work evolved further with the introduction of Litecoin in 2011, which adopted the Scrypt algorithm. Developed by Colin Percival and detailed in the technical specification "The scrypt Password-Based Key Derivation Function," Scrypt was designed as a memory-intensive algorithm, requiring significant RAM to perform its computations. Unlike Bitcoin’s SHA-256, which favored powerful ASICs, Scrypt aimed to level the playing field by making mining more accessible to users with general-purpose hardware through heightened memory demands. However, over time, advancements in hardware led to the creation of Scrypt-specific ASICs, shifting the advantage back toward specialized hardware and reducing the algorithm's goal for decentralization.

## Variants

There are two classes of proof-of-work protocols.
* Challenge–response protocols assume a direct interactive link between the requester (client) and the provider (server). The provider chooses a challenge, say an item in a set with a property, the requester finds the relevant response in the set, which is sent back and checked by the provider. As the challenge is chosen on the spot by the provider, its difficulty can be adapted to its current load. The work on the requester side may be bounded if the challenge-response protocol has a known solution (chosen by the provider), or is known to exist within a bounded search space.
* Solution–verification protocols do not assume such a link: as a result, the problem must be self-imposed before a solution is sought by the requester, and the provider must check both the problem choice and the found solution. Most such schemes are unbounded probabilistic iterative procedures such as Hashcash.
Known-solution protocols tend to have slightly lower variance than unbounded probabilistic protocols because the variance of a rectangular distribution is lower than the variance of a Poisson distribution (with the same mean). A generic technique for reducing variance is to use multiple independent sub-challenges, as the average of multiple samples will have a lower variance.
There are also fixed-cost functions such as the time-lock puzzle.
Moreover, the underlying functions used by these schemes may be:
* CPU-bound where the computation runs at the speed of the processor, which greatly varies in time, as well as from high-end server to low-end portable devices.
* Memory-bound where the computation speed is bound by main memory accesses (either latency or bandwidth), the performance of which is expected to be less sensitive to hardware evolution.
* Network-bound if the client must perform few computations, but must collect some tokens from remote servers before querying the final service provider. In this sense, the work is not actually performed by the requester, but it incurs delays anyway because of the latency to get the required tokens.
Finally, some PoW systems offer shortcut computations that allow participants who know a secret, typically a private key, to generate cheap PoWs. The rationale is that mailing-list holders may generate stamps for every recipient without incurring a high cost. Whether such a feature is desirable depends on the usage scenario.

## List of proof-of-work functions

Here is a list of known proof-of-work functions:
* Integer square root modulo a large prime
* Weaken Fiat–Shamir signatures
* Ong–Schnorr–Shamir signature broken by Pollard
* Partial hash inversion This paper formalizes the idea of a proof of work and introduces "the dependent idea of a bread pudding protocol", a "re-usable proof-of-work" (RPoW) system.
* Hash sequences
* Puzzles
* Diffie-Hellman–based puzzle
* Moderate
* Mbound
* Hokkaido
* Cuckoo Cycle
* Merkle tree–based
* Guided tour puzzle protocol
* partial match od a hash function

## Proof of useful work (PoUW)

At the IACR conference Crypto 2022 researchers presented a paper describing Ofelimos, a blockchain protocol with a consensus mechanism based on "proof of useful work" (PoUW). Rather than miners consuming energy in solving complex, but essentially useless, puzzles to validate transactions, Ofelimos achieves consensus while simultaneously providing a decentralized optimization problem solver. The protocol is built around Doubly Parallel Local Search (DPLS), a local search algorithm that is used as the PoUW component. The paper gives an example that implements a variant of WalkSAT, a local search algorithm to solve Boolean problems.

## Bitcoin-type proof of work

In 2009, the bitcoin network went online. Bitcoin is a proof-of-work digital currency that, like Finney's RPoW, is also based on the Hashcash PoW. But in bitcoin, double-spend protection is provided by a decentralized P2P protocol for tracking transfers of coins, rather than the hardware trusted computing function used by RPoW. Bitcoin has better trustworthiness because it is protected by computation. Bitcoins are "mined" using the Hashcash proof-of-work function by individual miners and verified by the decentralized nodes in the P2P bitcoin network. The difficulty is periodically adjusted to keep the block time around a target time.

### Energy consumption

Since the creation of bitcoin, proof-of-work has been the predominant design of Peer-to-peer cryptocurrency. Studies have estimated the total energy consumption of cryptocurrency mining. The PoW mechanism requires a vast amount of computing resources, which consume a significant amount of electricity. 2018 estimates from the University of Cambridge equate bitcoin's energy consumption to that of Switzerland.

### History modification

Each block that is added to the blockchain, starting with the block containing a given transaction, is called a confirmation of that transaction. Ideally, merchants and services that receive payment in the cryptocurrency should wait for at least one confirmation to be distributed over the network, before assuming that the payment was done. The more confirmations that the merchant waits for, the more difficult it is for an attacker to successfully reverse the transaction in a blockchain—unless the attacker controls more than half the total network power, in which case it is called a 51% attack.

### ASICs and mining pools

Within the bitcoin community there are groups working together in mining pools. Some miners use application-specific integrated circuits (ASICs) for PoW. This trend toward mining pools and specialized ASICs has made mining some cryptocurrencies economically infeasible for most players without access to the latest ASICs, nearby sources of inexpensive energy, or other special advantages.
Some PoWs claim to be ASIC-resistant, i.e. to limit the efficiency gain that an ASIC can have over commodity hardware, like a GPU, to be well under an order of magnitude. ASIC resistance has the advantage of keeping mining economically feasible on commodity hardware, but also contributes to the corresponding risk that an attacker can briefly rent access to a large amount of unspecialized commodity processing power to launch a 51% attack against a cryptocurrency.

### Security Weaknesses
#### Majority Attack (51% attack)

By design, Bitcoin's Proof of Work consensus algorithm is vulnerable to Majority Attacks (51% attacks). Any miner with over 51% of mining power is able to control the canonical chain until their hash power falls below 50%. This allows them to reorg the blockchain, double-spend, censor transactions, and completely control block production..

#### Asymmetric Economic Security

Bitcoin has asymmetric security where Bitcoin miners control its security, but they aren't the same people who hold Bitcoin. Unlike with Proof of Stake, there is much weaker economic incentive for those who control security to protect the network under Proof of Work. Historically, many Proof of Work networks with low security budgets have fallen under 51% attacks., which highlights PoW's asymmetric security.
The amount of protection provided by PoW mining is close to the security budget of the network, which is roughly equal to the total block reward. As of Feb 2024, the cost of attacking Bitcoin was estimated to be between $5B to $20B due to the cost of acquiring sufficient ASIC mining rigs. With each additional halving, Bitcoin's security budget continues to fall relative to its market cap. In the past, Bitcoin developers were hopeful that transaction fees would rise to replace the declining block subsidy, but this has not been the case as transaction fees still only generate 1% of the total block reward.. There are concerns that Bitcoin's security is unsustainable in the long run due to the declining security budget caused by its halvings.

## Environmental concerns

Miners compete to solve crypto challenges on the bitcoin blockchain, and their solutions must be agreed upon by all nodes and reach consensus. The solutions are then used to validate transactions, add blocks and generate new bitcoins. Miners are rewarded for solving these puzzles and successfully adding new blocks. However, the bitcoin-style mining process is very energy intensive because the proof of work is shaped like a lottery mechanism. The underlying computational work has no other use but to provide security to the network that provides open access and has to work in adversarial conditions. Miners have to use a lot of energy to add a new block containing a transaction to the blockchain. The energy used in this competition is what fundamentally gives bitcoin its level of security and resistance to attacks. Also, miners have to invest computer hardwares that need large spaces as fixed cost.
In January 2022 Vice-Chair of the European Securities and Markets Authority Erik Thedéen called on the EU to ban the proof of work model in favor of the proof of stake model due its lower energy emissions.
In November 2022 the state of New York enacted a two-year moratorium on cryptocurrency mining that does not completely use renewable energy as a power source for two years. Existing mining companies will be grandfathered in to continue mining without the use of renewable energy but they will not be allowed to expand or renew permits with the state. No new mining companies that do not completely use renewable energy will be allowed to begin mining.