Welcome to TechUnder5 — where tech meets simplicity in just under 5 minutes!
Today, we’ll break down one of the most fascinating parts of cryptocurrency: How Bitcoin mining works. From verifying transactions to solving complex puzzles, we’ll cover it all in a clear, visual journey — featuring Alice and Bob.


Table of Contents

  1. What is the Consensus Mechanism in Bitcoin?
  2. Alice Sends 1 Bitcoin to Bob – Step-by-Step
  3. Why the “Puzzle”? – Proof-of-Work
  4. Who Sets the Puzzle — and Why It’s Fair
  5. What’s Inside a Bitcoin Block Header?
  6. Why Bitcoin Is Secure
  7. Conclusion

What is the Consensus Mechanism in Bitcoin?

Consensus Mechanism

The consensus mechanism is the rulebook that ensures everyone in the Bitcoin network agrees on a single version of truth — like which transactions are valid and in what order they happened.

Bitcoin uses a type of consensus called Proof of Work (PoW). Here’s how it works in simple terms:

Imagine a Giant Shared Ledger

Everyone (called nodes) keeps a copy of Bitcoin’s ledger — a record of all transactions.

But what if two people try to add conflicting records at the same time?
Who decides which one is true?

That’s where consensus comes in.

Proof of Work: Let the Computers Decide

In Proof of Work, miners compete to solve a math puzzle.
The first one to solve it gets to propose the next valid block of transactions.

Once a miner solves the puzzle and shares the block:

This shared agreement is called reaching consensus.


Why This System Works:


Alice Sends 1 Bitcoin to Bob – Step-by-Step

Let’s walk through a simple transaction example:

  1. Alice wants to send 1 Bitcoin to Bob. She creates a transaction with Bob’s wallet address and broadcasts it to the Bitcoin network.
  2. Transaction Pool (Mempool): Her transaction joins a waiting area called the mempool, along with others.
  3. Block Proposal: Miners (nodes) gather several transactions (including Alice’s) into a candidate block.
  4. Nonce and Hashing: Miners add a random number (called a nonce) to the block and hash the data repeatedly.
  5. Solving the Puzzle: The first miner to find a hash that matches the network’s difficulty level announces it to the network.
  6. Verification: Other nodes verify the miner’s solution and confirm the validity of all transactions in the block.
  7. Adding the Block: Once approved, the block is permanently added to the blockchain.
  8. Bob Receives Bitcoin: The transaction is now recorded, and Bob sees 1 Bitcoin in his wallet.
  9. The first miner to solve the puzzle earns a reward in the form of a bitcoin for solving the puzzle and adding it to the blockchain.
Blockchain Puzzle Solved

Why the “Puzzle”? – Proof-of-Work

The puzzle that miners solve isn’t just for fun — it’s the heart of Bitcoin’s Proof-of-Work consensus system. It’s objective is to decide which transactions are added to the blockchain — without trusting a central authority.

Puzzle Mechanics:

Why This Matters:


Who Sets the Puzzle — and Why It’s Fair

The puzzle’s difficulty is set by Bitcoin’s protocol. It adjusts automatically to keep block times around 10 minutes.
Miners don’t coordinate — they simply guess over and over, changing the nonce until the correct hash is found.

It’s like a global lottery: more powerful miners have better odds, but even small players can occasionally win.


What’s Inside a Bitcoin Block Header?

Every time a miner guesses a solution, they’re hashing just the 80-byte block header, which includes:

Blockchain Header

Why Bitcoin Is Secure

Bitcoin’s security comes from how blocks are chained together. Each block includes:

This structure, secured by the SHA256 algorithm, means that if someone tries to tamper with one block, they’d have to re-solve all the puzzles for every following block — a near-impossible task given the massive computing power required.

Bottom line:
Altering a single block breaks the entire chain — making Bitcoin virtually tamper-proof.


Conclusion

That’s Bitcoin mining in a nutshell — simplified and visualized with Alice and Bob!

If you found this explanation helpful Subscribe to TechUnder5 for < 5 mins explainers.

Thanks for reading — TechUnder5: Making complex tech simple.