Proof of Work (PoW) is a consensus mechanism used by Bitcoin and many other cryptocurrencies to prevent attacks on the network. Bitcoin’s entire transaction history is stored on the Blockchain, and this Blockchain also records the balances in everybody’s Bitcoin wallet. Satoshi Nakamoto, the inventor of Bitcoin, realized there needed to be some way to keep everybody honest.
If anybody could add a block to the Blockchain, then the network would be vulnerable to attacks by people who wanted to reward themselves with more Bitcoin. Satoshi solved this problem by creating a PoW system called “mining.” Miners have to solve cryptographic puzzles whose difficulty is determined by the number of other people who are mining at the same time. Since mining requires expensive, specialized computers and a great deal of energy usage, miners actually have real money invested in the process.
Once a miner discovers the solution to a puzzle, he is able to publish the block to the Blockchain, where all the other nodes on the network verify its legitimacy. If the network accepts the block, the miner is rewarded with newly created coins. If enough of the network’s nodes reject the block, then it will be orphaned and won’t be added to the Blockchain. With Bitcoin, the longest chain is always considered to be the valid one, meaning that any work done on the “wrong” chain will be wasted. This keeps people from trying to fork the network with an illegitimate series of blocks (unless they have a substantial majority of the mining power on the network). Ultimately, the legitimate miners will reject the invalid chain, and the work of any attackers will be lost.
The exception is a 51 percent attack, in which a large majority of the network’s miners are corrupt. In this case, the miners can begin mining on an illegitimate chain and, if they have enough mining power (hash power), they can overcome the honest actors on the network and create the longest chain. At that point, all the network’s nodes will accept the attacker’s chain as valid.
Proof of Work is often criticized because of the vast amount of energy that’s wasted. The process of mining doesn’t do anything productive; it simply ensures that those who try to add a block to the Blockchain are incentivized, to be honest. Because of the inefficiency of Proof of Work systems, other consensus methods like Proof of Stake have been proposed, but they have their own weaknesses.