What is proof of work (PoW)?
Proof of Work (PoW) describes a system that requires a not insignificant but feasible amount of effort to deter frivolous or malicious uses of computing power, such as spamming or launching denial of service attacks. The concept was later adapted to secure digital money by Hal Finney in 2004 through the idea of ”reusable proof of work” using the SHA-256 hashing algorithm.
Following its introduction in 2009, Bitcoin became the first widely adopted application of Finney’s PoW idea (Finney was also the recipient of the first bitcoin transaction). Proof of work also forms the foundation of many other cryptocurrencies, allowing for secure and decentralized consensus.
- Proof of work (PoW) is a decentralized consensus mechanism that requires members of a network to put effort into solving an arbitrary mathematical puzzle to prevent anyone from messing with the system.
- Proof of work is widely used in cryptocurrency mining, to validate transactions and mine new tokens.
- Due to the proof of work, Bitcoin and other cryptocurrency transactions can be processed securely peer-to-peer without the need for a trusted third party.
- Proof of work at scale requires large amounts of power, which only increases as more miners join the grid.
- Proof of Stake (POS) was one of several novel consensus mechanisms created as an alternative to proof of work.
Understanding proof of work
This explanation will focus on proof of work as it works on the bitcoin network. Bitcoin is a digital currency backed by a kind of distributed ledger known as a “blockchain.” This ledger contains a record of all bitcoin transactions, organized in sequential “blocks” so that no user can spend any of their holdings twice. To avoid alteration, the ledger is public or “distributed”; other users would quickly reject a modified version.
The way users detect tampering in practice is through hashing, long strings of numbers that serve as proof of work. Put a given data set through a hash function (bitcoin uses SHA-256), and it will only generate a hash. However, due to the “avalanche effect”, even a small change in any part of the original data will result in a totally unrecognizable hash. Whatever the size of the original data set, the hash generated by a given function will be the same length. The hash is a one-way function: it cannot be used to get the original data, only to verify that the data that generated the hash matches the original data.
Generating any hash for a set of bitcoin transactions would be trivial for a modern computer, so to turn the process into “work”, the bitcoin network sets a certain level of “difficulty”. This setting is adjusted so that a new block is “mined”, which is added to the blockchain by generating a valid hash, approximately every 10 minutes. Setting the difficulty is accomplished by setting a “target” for the hash: the lower the target, the smaller the set of valid hashes, and the harder it is to generate one. In practice, this means a hash that starts with a very long string of zeros.
Proof of work was initially created as a proposed solution to the growing problem of spam.
Since a certain dataset can only generate one hash, how do miners ensure they generate a hash below the target? They alter the input by adding an integer, called a nonce (“number used once”). Once a valid hash is found, it is broadcast to the network and the block is added to the blockchain.
Mining is a competitive process, but it is more of a lottery than a race. On average someone will generate an acceptable proof of work every ten minutes, but who it will be is anyone’s guess. Miners group together to increase their chances of mining blocks, resulting in transaction fees and, for a limited time, a reward of newly created bitcoins.
Proof of work makes it extremely difficult to alter any aspect of the blockchain as such alteration would require re-mining all subsequent blocks. It also makes it difficult for one user or group of users to monopolize the computing power of the network, since the machinery and power required to complete hash functions are expensive.
If part of a mining network begins to accept an alternative proof of work, it is known as a hard fork.
Example of proof of work
The proof of work requires a computer to randomly participate in hash functions until it reaches an output with the correct minimum number of leading zeros. For example, the hash for block # 660000, extracted on December 4, 2020 is 00000000000000000008eddcaf078f12c69a439dde30dbb5aac3d9d94e9c18f6. The block reward for that successful hash was 6.25 BTC.
That block will always contain 745 transactions involving just over 1,666 bitcoins, as well as the header from the previous block. If someone tried to change the amount of a transaction even by 0.000001 bitcoins, the resulting hash would be unrecognizable and the network would reject the fraud attempt.
Proof of work FAQ
What does proof of work mean?
PoW requires nodes in a network to provide evidence that they have expended computational power (i.e. work) to achieve consensus in a decentralized manner and prevent bad actors from taking over the network.
How does proof of work validate a crypto transaction?
The work itself is arbitrary. For Bitcoin, it involves iterations of SHA-256 hashing algorithms. The “winner” of a hash round, however, adds and records the transactions of the mempool in the next block. Because the “winner” is chosen randomly in proportion to the work done, it encourages everyone on the network to act honestly and record only true transactions.
Why do cryptocurrencies need proof of work?
Because they are decentralized and peer-to-peer by design, blockchains like cryptocurrency networks require some way of achieving consensus and security. Proof of work is one of those methods that makes it too resource intensive to try to get past the network. There are also other testing mechanisms that are less resource intensive, but have other drawbacks or flaws, such as Proof of Stake (PoS) and Burn Test. Without a testing mechanism, the network and the data stored on it would be vulnerable to attack or theft.
Does Bitcoin use proof of work?
Yes. It uses a PoW algorithm based on the SHA-256 hash function to validate and confirm transactions, as well as to issue new bitcoins in circulation.
How is Proof of Stake (PoS) different from PoW?
PoS is a consensus mechanism that randomly assigns the node that will mine or validate bulk transactions according to the number of coins that node contains. The more tokens a wallet has, the more mining power it will be awarded. While PoS consumes far fewer resources, it has several other flaws, including a 51% higher chance of an attack on smaller altcoins and incentives to accumulate tokens and not use them.