Part 2: How Bitcoin Works — Blockchain, Keys, and Transactions
Bitcoin is just magic internet money, right? Actually, it’s better. It’s the first system in history where thousands of strangers, all over the world, can agree on who owns what — without trusting each other.
In Part 1, we covered what Bitcoin is — a decentralized digital currency with no middlemen. Now it’s time for the how.
This is the part where most guides lose people. They toss around words like “cryptographic hash” and “distributed ledger” and “asymmetric encryption” until your eyes glaze over.
I’m not going to do that.
Here’s the truth: Bitcoin’s core ideas are surprisingly simple. You already use the same concepts every day — just with different names. By the end of this post, you’ll understand the blockchain better than most people who own Bitcoin.
Let’s start with the most important piece.
The Blockchain: A Town Ledger for the Digital Age
Imagine an old-fashioned town ledger. A big leather-bound book sitting on the mayor’s desk. Every time someone in town trades a cow, a bag of grain, or a plot of land, the mayor writes it down:
“Alice gave Bob 1 cow on June 3.”
“Bob gave Charlie 10 bags of grain on June 4.”
“Charlie gave Alice a plot of land on June 5.”
The ledger is the source of truth. If a dispute arises — “Hey, I paid you already!” — the town checks the book. Simple.
But there’s a problem. The mayor controls the book. What if the mayor is corrupt? What if a fire burns the ledger? What if someone sneaks in at night and changes a page?
The blockchain is a ledger that solves all of these problems at once.
Instead of one book sitting in one place, the blockchain is a book that every single participant in the Bitcoin network owns a copy of. Thousands of copies, all identical, all being constantly cross-checked against each other.
And here’s the magic: no one can rewrite past pages. You can only add new ones. And once a page is added, it’s there forever — mathematically locked in place.
That’s why it’s called a blockchain. Every “page” is a block containing a batch of transactions. Blocks are linked together in chronological order — chained, so that each one depends on the one before it.
Analogy: Think of the blockchain like a stack of transparent lockboxes. Every time a transaction happens, we add a new box on top that everyone can see inside. To change an old transaction, you’d have to break every box above it — which everyone would notice immediately.
Private Keys and Public Keys: The Email Analogy
Now we know where transactions are recorded — the blockchain. But how do you prove you own Bitcoin? And how do you send it securely?
This is where keys come in.
Every Bitcoin wallet generates two keys:
- A public key (usually shortened to an address) — think of this as your email address
- A private key — think of this as the password to your email account
Let’s use the email analogy:
- Your email address (public key): You give this to anyone who wants to send you a message. It’s safe to share. The world can see it.
- Your email password (private key): You never share this with anyone. It’s how you prove you’re the owner of that email address. It’s how you access and control your account.
Bitcoin works almost exactly the same way.
- Your Bitcoin address (derived from your public key): You share this with anyone who wants to send you Bitcoin. It’s safe to post online, put on your website, or tweet about.
- Your private key: You guard this with your life. It’s a long string of numbers and letters (or a 12-24 word “seed phrase” that encodes it) that proves you own the Bitcoin at that address.
Here’s the critical difference from a bank account: no one else has a copy of your private key. Not the bank. Not the government. Not Bitcoin’s developers. Only you. If you lose your private key, your Bitcoin is gone forever. There is no “forgot password” button.
But if you keep it safe, here’s what this system gives you…
Powerful consequence: When you check your balance on the blockchain, you’re not asking a bank “how much money do I have?” You’re proving to the world “I control this much Bitcoin” by showing you know the private key — without ever revealing it.
How a Transaction Works: Alice Pays Bob
Let’s walk through a real transaction. Meet Alice and Bob — the most famous pair in cryptography since Romeo and Juliet.
Step 1: Alice wants to send Bob 0.1 Bitcoin.
Alice opens her wallet app. She enters Bob’s Bitcoin address (a string like bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf9v6k) and the amount: 0.1 BTC.
Step 2: Her wallet creates a transaction message.
Under the hood, the wallet builds a small piece of data that says:
“I, the owner of address X, authorize the transfer of 0.1 BTC to address Y (Bob).”
But this message is useless without proof that Alice actually owns address X.
Step 3: Alice signs the transaction with her private key.
Here’s the beautiful part. Alice uses her private key to create a digital signature — a unique mathematical stamp that only someone knowing the private key could create. It’s like signing a check, but impossible to forge.
The signature doesn’t reveal Alice’s private key. But anyone can use Alice’s public key to verify: “Yes, this signature matches. Alice really did authorize this.”
Analogy: It’s like a wax seal. Alice has a unique signet ring (private key). She presses it into hot wax on a letter. Anyone who knows what her seal looks like (public key) can see the letter came from her. But no one can forge the seal itself.
Step 4: Alice broadcasts the signed transaction to the network.
Her wallet sends the transaction — the message + the digital signature + her public key — to every Bitcoin node it’s connected to. Like shouting in a crowded room: “Hey everyone, Alice is sending Bob 0.1 Bitcoin!”
Step 5: The network verifies the transaction.
Here’s where the magic of decentralization kicks in. The transaction doesn’t go to some central server. It goes to thousands of independent computers around the world, each running the Bitcoin software.
Every node checks:
- Is the signature valid? — Does the signature prove Alice owns this address?
- Does Alice have enough Bitcoin? — The node checks the blockchain to confirm Alice’s address has at least 0.1 BTC available to spend.
- Is Alice trying to double-spend? — Has she already tried to send this same 0.1 BTC to someone else? The nodes check for conflicting transactions.
If all checks pass, the transaction is added to the node’s “mempool” — a waiting area for unconfirmed transactions.
Step 6: Miners include the transaction in a block.
Miners gather transactions from the mempool, bundle them into a new block, and compete to add it to the blockchain. (We’ll cover mining in depth in Part 3, but for now: miners solve a difficult math puzzle, and the first one to solve it gets to add the next block.)
Step 7: The block is added, and the transaction is confirmed.
Once a miner successfully adds the block, the transaction has 1 confirmation. After 6 blocks (about an hour on average), it’s considered irreversible.
Bob now has 0.1 BTC. Alice’s balance is reduced. The blockchain has a permanent, public record:
“Transaction abc123… sent 0.1 BTC from address X to address Y.”
Anyone, anywhere, can look this up on a block explorer (like blockchain.info) and see it happened. No bank. No middleman. Just math.
How the Network Verifies: Trust Through Independence
Here’s the question beginners always ask: Why can’t someone just cheat?
Let me show you why cheating is practically impossible.
Imagine Alice tries to cheat. She sends her 0.1 BTC to Bob (receiving a digital download), then immediately tries to send the same 0.1 BTC to herself at another address she controls. This is the double-spend attack.
Here’s what happens:
- Alice broadcasts transaction A (“pay Bob”) to some nodes, and transaction B (“pay myself”) to other nodes.
- The network detects both transactions. Every node sees that Alice only has 0.1 BTC and both transactions try to spend the same coin.
- The nodes accept only the first transaction they saw and reject the second as invalid.
- A miner includes transaction A in a block. When that block propagates across the network, all nodes agree that transaction A is the valid one. Transaction B is dead.
- Even if Alice’s miner friend tried to mine a block with transaction B instead, when the network sees two competing versions of history, it follows the longest chain — the one with the most proof-of-work. The honest chain (with transaction A) will almost certainly grow faster than any attacker’s secret chain.
The key insight: The network doesn’t trust anyone. It verifies everything independently. Every node checks every transaction against its own copy of the blockchain. To successfully cheat, Alice would need to control more than 50% of the network’s computing power — which, for a practical attacker, costs hundreds of millions of dollars in hardware and electricity.
What Is a Hash? (The Simple Explanation)
I’ve mentioned that blocks are “chained” together. But how? What actually links them?
The answer is a hash function — the unsung hero of Bitcoin.
A hash function is like a mathematical blender. You throw in any data — a word, a sentence, an entire novel, a video file — and it outputs a fixed-length string of numbers and letters, called a hash. Something like:
000000000000000000063b4379f39b39e93e9eac867d9536f5bcc7f8b237bc2f
Here are the three properties that make hashes magical for Bitcoin:
1. Deterministic: Same input always gives the same output
If you hash the word “hello” with SHA-256 (Bitcoin’s hashing algorithm), you’ll always get:
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
Send “hello” through the blender again, you get the exact same result. Every time.
2. One-way: You can’t go backwards
Given the hash above, can you figure out the original input? No — short of trying every possible word until you find one that produces the same hash. That’s by design. A hash is a fingerprint, not a code.
3. Avalanche effect: A tiny change produces a completely different hash
Hash “Hello” (capital H) and you get:
185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
Now hash “hello” (lowercase h):
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
Completely different! One letter changed and the output is unrecognizable.
Analogy: Think of a hash like a fingerprint. A fingerprint identifies you uniquely, but you can’t reconstruct a person from their fingerprint. Change one tiny detail about yourself (a scar, a missing finger), and your fingerprint changes completely.
How Bitcoin Uses Hashes
Here’s the brilliant part. Every block in the blockchain contains:
- A list of transactions
- A timestamp
- The hash of the previous block
Because of the avalanche effect, if anyone tries to alter a single transaction in block #500,000, that block’s hash changes completely. But block #500,001 contains the original hash of block #500,000 — so it no longer matches. The entire chain from that point forward is broken.
To successfully tamper, you’d have to recalculate every single block that came after your changed block — and do it faster than the entire Bitcoin network is producing new blocks.
That’s computationally impossible. Not “really hard.” Impossible in any practical sense.
Why the Blockchain Is Immutable
Let’s tie this all together.
The blockchain is immutable — meaning once data is written to it, it cannot be altered. Here’s a summary of why:
| Property | How Bitcoin Achieves It |
|---|---|
| Hash chaining | Each block contains the hash of the previous block. Changing one block breaks every block after it. |
| Proof of work | Miners expend massive computing power to create each block. Re-creating a chain of blocks costs more than anyone can afford. |
| Distributed copies | Thousands of independent nodes each hold a complete copy of the blockchain. There’s no single server to hack or corrupt. |
| Consensus rules | Nodes automatically reject blocks that don’t follow the rules. Even if a miner wanted to create a fraudulent block, the network would ignore it. |
| Economic incentives | Miners are rewarded in Bitcoin for following the rules. Attempting to cheat would cost them their mining rewards, their equipment investment, and the value of their Bitcoin holdings. |
The bottom line: Bitcoin doesn’t achieve immutability through laws or police or trust. It achieves it through math, physics, and economics. Anyone can try to cheat — but they’d lose more than they’d gain, and the network would still have the true history.
What This Means for You
Here’s what you should take away from all of this:
-
The blockchain is just a public ledger. It’s not magic. It’s a shared record book that everyone can see but no one can rewrite.
-
Your private key is everything. Lose your private key, lose your Bitcoin. Share your private key, lose your Bitcoin. Guard it like the password to your entire financial life — because that’s exactly what it is.
-
Transactions are irreversible. Once confirmed on the blockchain, no one — not a bank, not a government, not even Satoshi Nakamoto — can reverse a Bitcoin transaction. This makes Bitcoin powerful for final settlement but also means you must be careful who you send it to.
-
You don’t need to trust anyone. The beauty of Bitcoin is that you can verify everything independently. Download a full node, check the blockchain, and know for yourself that your transactions are real.
Summary: Bitcoin’s Engine Room
Let’s recap the key concepts:
- Blockchain — A distributed, public ledger where every transaction is recorded permanently. Shared across thousands of computers worldwide.
- Public key (address) — Your Bitcoin “email address.” Safe to share. Where people send you Bitcoin.
- Private key — Your Bitcoin “password.” Never share it. Proves you own your Bitcoin.
- Digital signature — A mathematical proof that you authorized a transaction, created with your private key and verified with your public key.
- Transaction — A signed message that moves Bitcoin from one address to another, broadcast to the network and recorded in a block.
- Hash — A one-way cryptographic fingerprint. Links blocks together and makes the blockchain tamper-proof.
- Immutability — Once recorded, data on the blockchain cannot be changed, deleted, or reversed.
What’s Next?
Now that you understand how Bitcoin works on a technical level, we’re ready to talk about the engine that drives it all — mining.
In Part 3, we’ll cover:
- What mining actually is (it’s not just “solving math problems”)
- Proof of work and why it matters
- Why miners spend millions on electricity
- How mining keeps the network secure
Continue to [Part 3: Mining & Proof of Work →](Part 3 - Mining and Proof of Work.md)
Part 2 of the Bitcoin for Beginners series. Next up: the machines that power the network, and why they burn so much energy.