FIG. 1 · SYSTEM SCHEMATIC
HOW BITCOIN WORKS
A peer-to-peer electronic cash system. Data flows left to right: keys sign transactions, the network relays them, miners commit them to the chain.
SUPPLY CAP21,000,000 BTC
BLOCK INTERVAL~10 MIN
BLOCK SUBSIDY3.125 BTC
Wire labels Glossary
Tap a stage or any underlined term for details · Run transaction plays the flow and scrolls you through it.
01 · KEYSIDENTITY
PRIVATE KEY · 256-bit secret
k = 0x8f2a…c41d
secp256k1 (one-way)
PUBLIC KEY
K = k · G
↓ SHA-256 then RIPEMD-160
ADDRESS
bc1q7x…e93k
The private key signs. Anyone can verify with the public key. Lose the key and the coins are gone for good.
SIGNS
02 · TRANSACTIONUTXO MODEL
INPUTS · spend UTXOs
utxo #a4f2 · 0.80 ₿
+ signature
utxo #77c1 · 0.25 ₿
+ signature
OUTPUTS · new UTXOs
→ bc1qme… 1.00 ₿
locking script
→ change 0.0498 ₿
fee = Σ inputs − Σ outputs = 0.0002 ₿ → claimed by the miner
There are no account balances, only unspent outputs (UTXOs). A transaction consumes whole UTXOs and creates new ones.
BROADCAST
03 · MEMPOOLWAITING ROOM
UNCONFIRMED TXS, SORTED BY FEE RATE
tx #f81a42 sat/vB
tx #03bd18 sat/vB
tx #c2997 sat/vB
tx #5e401 sat/vB
Every node keeps its own mempool. Higher fee rate gets picked sooner. A block holds roughly 2,000 to 3,000 txs, so fees are a live auction for space.
SELECT BY FEE
04 · MININGPROOF-OF-WORK
THE PUZZLE
SHA-256( SHA-256( header + nonce ) ) < target
nonce = 0✗ 9e41f2…
nonce = 1✗ 71cc08…
… × 10²²✗ …
nonce = 2,083,236,893✓ 0000…a3f1
Guessing is the only strategy: hard to solve, instant to verify. Difficulty retargets every 2,016 blocks to hold ~10 min. The winner earns the subsidy (3.125 ₿, halving every 210,000 blocks) plus all fees.
GOSSIP: VALIDATE + RELAY
SOLVED BLOCK
05 · P2P NETWORKNO CENTER
~21,000 reachable nodes
EVERY NODE, INDEPENDENTLY:
checks signatures & scripts
rejects double-spends of UTXOs
verifies each block's proof-of-work
relays valid data to ~8 to 125 peers
Rules are enforced by everyone, not decreed by anyone. An invalid block is simply ignored, no matter who mined it.
06 · BLOCKCHAINSETTLEMENT LAYER
BLOCK 958,401hash 0000…8c2e2,914 txs
BLOCK 958,402 · HEADER (80 bytes) prev_hash  0000…8c2e ← links to parent merkle_root 7d1f…a980 ← fingerprint of all txs time · bits (target) · nonce
BLOCK 958,403being mined…ETA ~10 min
TAMPER-EVIDENCE
Change any tx and its merkle root changes, so the block hash changes, so every later prev_hash link breaks. Rewriting history means redoing all that proof-of-work faster than the honest network.
CONSENSUS & FINALITY
If two blocks tie, nodes follow the chain with the most cumulative work; the loser is orphaned. Each block on top makes reversal exponentially harder. 6 confirmations ≈ settled.
GLOSSARY UTXO unspent transaction output, the coins themselves nonce the number miners vary to change the hash target the hash must fall below it; lower is harder merkle root one hash committing to every tx in a block sha256d · secp256k1 · bitcoin.org/bitcoin.pdf (2008)
TX · 1.00 ₿
01
Hover highlights interactive parts · click for a definition · Run transaction animates a payment through the system
operated by Bsecure