Book a free call

What Is Proof of Work, and How Does It Secure a Blockchain?

Proof of work secures a blockchain by making miners solve a hard puzzle before adding a block. Learn how mining, difficulty and rewards fit together.

Hertiv engineering teamReviewed by a senior engineer
6 min read
What Is Proof of Work, and How Does It Secure a Blockchain?
On this page

Short answer

Proof of work is a consensus mechanism in which computers compete to solve a cryptographic puzzle, and the winner earns the right to add the next block of transactions to the blockchain. The puzzle is expensive to solve but cheap to verify, so rewriting history would cost more than any attacker could gain.

What is proof of work?

Proof of work is a consensus mechanism in which network participants, called miners, spend computing power to solve a puzzle before they can add a block of transactions to a blockchain. The first miner to find a valid solution broadcasts the block, the rest of the network checks it cheaply, and the block becomes part of the chain.

The puzzle is deliberately asymmetric. Finding a solution takes a huge number of guesses, while checking one takes almost no work. That asymmetry is the whole point: anyone can verify that a block was earned, and nobody can fake the work after the fact.

Bitcoin is the best-known proof of work network, and it has run on the mechanism since 2009. The miner who finds a block receives newly created coins plus the transaction fees in that block, which is what pays for the electricity and hardware the puzzle consumes.

Proof of work answers a hard question: in a network with no central authority, who gets to decide which transactions are real? The answer is whoever proves they spent the most work. For the wider context, see what a consensus mechanism is.

How does mining work, step by step?

Mining works by repeatedly changing a number in the block header and hashing the result until the hash falls below a target set by the network. The miner who finds a qualifying hash first wins the block.

The steps in each round:

  1. Collect transactions. A miner gathers pending transactions from the network and checks that each one is valid.
  2. Build a block. The transactions are grouped into a block with a reference to the previous block.
  3. Search for a hash. The miner changes a value called the nonce and hashes the block, trying again and again until the hash is below the target.
  4. Broadcast the block. The winning miner sends the block to the network, and other nodes verify the hash and the transactions.
  5. Collect the reward. The miner receives the block reward and the transaction fees in that block.
  6. Move to the next block. Every miner starts the race again on top of the new block.

There is no shortcut to the search. Each guess is independent, so the only way to guess faster is to run more hardware, which is why mining consumes real energy.

What is the difficulty adjustment?

The difficulty adjustment is a rule that raises or lowers the puzzle target so that new blocks appear at a steady rate, no matter how much computing power joins or leaves the network.

In Bitcoin, blocks are meant to appear about every 10 minutes. Every 2,016 blocks, roughly every two weeks, the network looks at how long those blocks actually took. If miners were faster than 10 minutes a block, the puzzle gets harder. If they were slower, it gets easier.

This self-correction is what keeps the system stable as hardware improves and as miners come and go. Without it, blocks would arrive in seconds when mining is profitable and grind to a halt when miners leave.

The adjustment also sets the economics. When the price of the coin rises, more miners join, difficulty rises, and the cost of each block rises with it. When miners leave, difficulty falls and the remaining miners earn more per unit of work.

Proof of work vs proof of stake

Proof of work and proof of stake solve the same problem, deciding who adds the next block, with different resources at risk. The table below shows the main differences.

Aspect Proof of work Proof of stake
What secures the chain Computing power and electricity Coins locked as stake
Who adds a block The miner who solves the puzzle first A validator chosen by stake and randomness
Energy use High, by design Much lower
Attack cost Buying and running hardware Buying and staking coins
Finality Probabilistic, grows with confirmations Faster, often explicit
Best-known network Bitcoin Ethereum since 2022

Neither is better in every case. Proof of work has the longest track record and a simple security story: attacking it costs real-world resources. Proof of stake uses far less energy and confirms blocks faster. Proof of work vs proof of stake compares the two in more detail.

For the other side of the comparison, see what proof of stake is and how validators are chosen.

Why is proof of work hard to attack?

Proof of work is hard to attack because rewriting history means redoing all the work that went into every block after the one you want to change, while the rest of the network keeps adding new blocks ahead of you.

To change a past transaction, an attacker must produce an alternative chain that is longer than the honest chain. That requires more computing power than all honest miners combined, sustained for as long as it takes to catch up. The hardware, electricity and time involved make the attack more expensive than the value it could steal, on a large network at least.

This is why the security of a proof of work network grows with its size. A small network with few miners is cheap to overwhelm, which is why smaller chains have suffered majority attacks. Bitcoin's scale is what makes its security story credible.

The honest majority assumption matters here. Proof of work does not make attacks impossible; it makes them expensive and visible. An attacker who controls most of the hash power can be seen doing it, and the market reacts.

Example (hypothetical): a miner's share of the rewards

Example (hypothetical): a network produces 144 blocks a day, because a new block appears about every 10 minutes, and each block pays a reward of 3.125 coins. Total rewards are 144 x 3.125, or 450 coins a day.

A miner controls 5% of the network's computing power. Over a long period, that miner should find about 5% of the blocks, which is 144 x 5%, or 7.2 blocks a day. At 3.125 coins a block, that is 7.2 x 3.125, or 22.5 coins a day.

In practice the miner's daily result varies. On a lucky day they might find 10 blocks; on an unlucky day, 4. That variance is why small miners join pools, which combine power and split rewards so each member gets a steadier income. The pool takes a small fee for the service, and the miner trades some independence for predictable pay.

The arithmetic also shows why electricity price decides who mines. If the 22.5 coins are worth less than the power and hardware cost of running 5% of the network, the miner stops, difficulty falls, and the remaining miners earn more.

What are the common mistakes?

The most common proof of work mistakes are thinking miners solve useful problems, assuming one confirmation is final, and ignoring the economics of mining.

  • Thinking the puzzle does useful work. The puzzle exists only to cost resources. It does not fold proteins or render graphics; the work is the security.
  • Treating one confirmation as final. A block can still be replaced by a longer chain. Exchanges and merchants wait for several confirmations for large amounts.
  • Ignoring mining costs. A miner who ignores electricity and hardware costs will mine at a loss when difficulty rises.
  • Assuming all proof of work chains are equally secure. Security scales with network size, so a small chain is far easier to attack than Bitcoin.
  • Confusing hash rate with users. Hash rate measures mining power, not adoption. A network can have high hash rate and few real users.

If you are building on a proof of work chain, the practical questions are confirmation depth, fee levels and mining distribution. Blockchain development covers how those choices shape a product.

Key takeaways

  • Proof of work makes miners spend computing power to earn the right to add a block
  • Finding a solution is expensive; verifying one is cheap, which is what makes the chain trustworthy
  • The difficulty adjustment keeps blocks at a steady rate as miners join and leave
  • Attacking a large proof of work network means redoing all later work, which costs more than it gains
  • Security scales with network size, so small proof of work chains are far easier to attack

Frequently asked questions

How long does a Bitcoin block take?

About 10 minutes on average. The difficulty adjustment retargets every 2,016 blocks, roughly every two weeks, so the average stays near 10 minutes even as mining power changes. Individual blocks can arrive seconds or an hour apart; only the average is controlled.

What happens when all 21 million bitcoins are mined?

Bitcoin has a fixed supply of 21 million coins, and the block reward halves roughly every four years until it reaches zero. After that, miners are paid only from transaction fees. The last coins are expected to be mined around the year 2140.

Can proof of work be used for anything besides Bitcoin?

Yes. Several other networks use proof of work, including Litecoin and Dogecoin, and some new chains still choose it for its simplicity and track record. The mechanism is the same: miners spend computing power to add blocks and earn rewards.

Why does proof of work use so much energy?

Energy use is the security mechanism. The cost of the work is what makes attacks expensive, so a network that used no energy would have no defence against a miner who fakes history. The debate is about whether that security is worth the energy, not about whether the energy does anything.

What is a 51% attack?

A 51% attack is when one miner or group controls more than half of a network's computing power. They can then rewrite recent history, reverse their own transactions and block others. On a large network the hardware and electricity needed make this extremely expensive, which is the main deterrent.

Do miners need special hardware?

For Bitcoin, yes. Mining is done with specialised machines called ASICs, which are built only for hashing. General-purpose computers cannot compete on Bitcoin, though some smaller proof of work networks are still mined with graphics cards.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: blockchain systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Building on a proof of work chain and weighing the trade-offs?

A senior engineer replies within one business day. Or see our Blockchain Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to [email protected].

Prefer email? Write to [email protected]
Estimate costBook a call