Everyone has heard "decentralized ledger." Almost nobody can say why you can't just open your copy and add a zero to your balance. This guide is the answer — trust without a trustkeeper, built from two pieces of math. It goes down in stages, no coins or charts. Stop wherever you like — each depth is complete on its own.
The first misconception to drop: a cryptocurrency is not a folder of coin files sitting on your computer. There are no coins anywhere. There is only a ledger — a running list of who paid whom — and "your balance" is just what that list adds up to for your name. Every question about how crypto works is really one question: how do thousands of strangers keep identical copies of one ledger honest, with no bank in the middle?
One trusted party holds the ledger and everyone defers to it. It works — until the bookkeeper freezes your account, charges rent, gets hacked, or is leaned on. Every participant has to trust one party, and that party is a single point of control and failure.
Every participant holds a full copy of the ledger. A new entry counts only once the network as a whole accepts it. The hard part isn't storing copies — it's making agreement between copies automatic and forgery mathematically visible, so no one copy can lie to the others.
If that sounds abstract, it has a very concrete precedent. On the Micronesian island of Yap, money was rai — stone discs, some the size of a car, far too heavy to move. So they didn't move. When a stone changed hands, the island simply agreed on the new owner; the stone stayed put. One famous rai sank to the sea floor during transport, and the islanders agreed the owner still owned it — it kept being spent, underwater, for generations. The lesson is the whole of this guide: the ledger is the money. Bitcoin just replaced a village's shared memory with cryptography. (The economist Milton Friedman told this story in "The Island of Stone Money.")
A shared ledger with no owner creates exactly two problems, and the rest of this guide is the two solutions:
| Problem | The question | Solved by |
|---|---|---|
| Forgery | What stops me editing my copy, or writing "Alice pays me 100" in Alice's name? | Cryptography — Levels 2–3 |
| Ordering | When two honest copies disagree about which of two conflicting payments came first, whose version wins? | Consensus — Level 4 (and all of Guides 2–3) |
That second problem has a name — the double-spend problem. Digital things copy for free; money must not. If I can spend the same coin twice by showing two people two different versions of history, the money is worthless. A bank solves it by being the single source of truth. A blockchain has to solve it with no single source at all.
A blockchain is a shared, append-only ledger where math replaces the bookkeeper. Forgery is made detectable and rewriting history is made expensive — those two properties, and nothing about coins, are what "decentralized trust" actually means.
Cryptographic hash — a fingerprint for data. A hash function like SHA-256 takes any input — a word, a file, an entire library — and produces a fixed 256-bit output (64 hex characters). Four properties make it the load-bearing wall of the whole system, and each one exists because the ledger needs it:
Deterministic — the same input always gives the same hash, on every machine on Earth. Two nodes an ocean apart can confirm they hold the identical ledger by comparing 32 bytes instead of gigabytes. Avalanche — flip a single bit of input and about half the output bits flip, unpredictably; tampering is never subtle, it's a klaxon. One-way — you cannot run it backwards to recover the input; a hash commits you to data without revealing it. Collision-resistant — nobody can find two different inputs with the same hash. The output space is 2²⁵⁶ ≈ 1.2 × 10⁷⁷ possibilities — within a few orders of magnitude of the number of atoms in the observable universe (~10⁸⁰). That is the honest scale of "nobody can find a collision."
The avalanche property is the one to feel, not just read. Type into both boxes below — the second starts one keystroke away from the first — and watch how a change too small to matter to a human rewrites the fingerprint completely:
A hash has no key and no way back — "decrypting a hash" is not a thing that exists. Encryption is reversible with a key; hashing is a one-way fingerprint. Conflating the two is the single most common beginner error here.
Digital signature — unforgeable handwriting. This is the second primitive, and it answers "who authorized this?" You hold a key pair: a private key that only you know, which signs things, and a public key that everyone can see, which lets anyone verify your signature. Your crypto "account" is a key pair — your address is derived from your public key. A transaction is just a small record — to, amount, a reference number — plus a signature computed over all of it with your private key.
The consequences are worth stating one by one, because together they solve the forgery problem:
The specific math is ECDSA over the secp256k1 curve for Bitcoin and Ethereum accounts — worth knowing the name if you want to dig, but the elliptic-curve details don't change the mental model: secret to sign, public to check.
Signatures prove who; hashes prove what. A signature says "the owner really authorized this payment." A hash says "this data has not been altered by one bit." Everything above the cryptography — blocks, chains, consensus — is built to apply these two guarantees to a ledger that no one owns.
Transactions aren't stored one by one. They're batched into blocks, and a block is two parts: a header and the list of transactions it contains. The header is small and fixed-shape:
struct BlockHeader { prev_block_hash // 32-byte hash of the previous header — the chain link merkle_root // one hash committing to every tx in this block timestamp // when the block was assembled difficulty_target // how hard the puzzle was → Guide 2 nonce // the number miners vary to win it → Guide 2 }
Most of those fields are bookkeeping. One is the entire trick. prev_block_hash is the hash of the previous block's header — so every block's identity includes its parent's fingerprint. And the parent's fingerprint included its parent's, all the way back. The newest block therefore commits, transitively, to the complete history behind it. That's why it's a chain: not blocks sitting in a row, but each block cryptographically welded to the one before it.
Here's what that buys you. Tamper with a transaction in an old block and its merkle_root changes, so the block's header hash changes, so the next block's prev_block_hash no longer matches — and that mismatch cascades all the way to the tip. You cannot quietly edit one page of the ledger. To make a forged edit "fit," you'd have to re-forge every block after it, in every copy, faster than the whole network keeps extending the real chain. Try it — edit any transaction and watch the break spread:
That cascade is the reason a blockchain is called immutable: not because editing is forbidden by some rule, but because a single change invalidates everything downstream and is instantly visible to every other copy. The re-chain button papers over it locally; on the real network, re-linking means redoing work the rest of the world isn't going to wait for.
Merkle trees, briefly. How does one merkle_root commit to a thousand transactions? Pair them up, hash each pair, then pair up those hashes, and repeat until a single root hash remains. The payoff is efficiency: you can prove "my transaction is in this block" with about log₂(n) hashes — roughly 10 hashes for 1,000 transactions, not 1,000. That's how a wallet on your phone can verify a payment without downloading the entire chain.
The lifecycle of a payment. Your wallet signs a transaction → it's broadcast to peer nodes → it waits in each node's mempool (the waiting room of unconfirmed transactions) → a block producer picks it up and includes it in a block → the block propagates to everyone → and each further block built on top is one more confirmation that it's settled.
Every full node independently re-validates everything. Each node checks every signature, every balance, every protocol rule for itself. Block producers — miners or validators — only get to choose the ordering of valid transactions; they do not get to choose what counts as valid. A block that breaks a rule (mints coins from nothing, spends without a valid signature) is silently discarded by every node no matter how much power or money is behind it. Rules are enforced at the edges, by the many, not by the powerful few. This is half the answer to "how does a decentralized system stay legitimate."
Here's that guarantee as the code every node runs — notice that "who produced the block" appears nowhere in it:
def validate_chain(blocks): // every full node runs this, independently for b in blocks: if b.prev_hash != hash(b.parent): // 1. is the link intact? return REJECT // one tampered tx breaks every child if hash(b.header) > b.target: // 2. was the work actually done? → Guide 2 return REJECT for tx in b.transactions: // 3. is every payment legitimate? if not verify_signature(tx): // forged? rejected — no matter who mined it return REJECT if double_spent(tx): // coin already spent? rejected return REJECT return ACCEPT // rules enforced at the edges, not by the powerful
One more distinction you'll meet everywhere. Chains disagree on what the ledger tracks:
| Model | What the ledger stores | Why |
|---|---|---|
| UTXO (Bitcoin) | Discrete unspent coins; your balance is the sum of coins your keys can spend | Simple, parallel-friendly, easy to verify |
| Account (Ethereum) | A balance and a counter per account, like a bank statement | Smart contracts need persistent, addressable state |
Two copies of the ledger can both be internally flawless and still contradict each other. Alice signs two perfectly valid transactions spending the same coin — one paying Bob, one paying herself back — and shows each half of the network a different one first. Both are properly signed. Neither is a forgery. The network just has to agree on which happened first, because only one can stand. This is the double-spend problem in its true form: not forgery, but ordering.
Computer science has studied this for forty years as the Byzantine generals problem: armies encircling a city must agree on a single plan — attack or retreat — by messenger, while some messengers may be traitors delivering contradictory orders. The classic results all assumed a known, fixed set of participants who could vote. The open internet offers neither.
Why "just vote" fails — the Sybil attack. On the internet, identities are free. Anyone can spin up a million "nodes" for pocket change. So any one-node-one-vote scheme is instantly won by whoever runs the most virtual machines — democracy is meaningless when you can mint a billion citizens. This single fact is why blockchains look so strange: they can't count identities, so they have to count something that can't be faked.
Make voting power proportional to a real-world resource that can't be copied or faked, and make writing a block cost that resource. Bitcoin's whitepaper called it "one-CPU-one-vote." A million fake identities are worthless unless each one is backed by a million real power plants (proof-of-work) or a million real dollars at risk (proof-of-stake). The Sybil attack dies because the vote is anchored to something outside the computer.
How disagreement actually resolves — fork choice. Suppose two block producers find a valid block at nearly the same instant. The network briefly splits, some nodes building on one, some on the other. No committee convenes. Each side just keeps building, and whichever branch attracts the next block first becomes the longest (heaviest) chain — and by a rule every node follows, everyone abandons the shorter branch and switches to it. The stranded block is orphaned; its transactions fall back into the mempool to be included later. Agreement is not negotiated; it emerges from one greedy rule applied identically by everyone.
Which means "final" is a probability, not a fact. A transaction one block deep can still be undone if a competing branch overtakes it. Six blocks deep, an attacker would have to out-produce the entire honest network for about an hour straight to rewrite it — possible in theory, absurdly expensive in practice. So confirmations don't make a payment certainly irreversible; they make reversing it exponentially more expensive with each block. (Hold that thought — Guide 3 shows how proof-of-stake replaces this probabilistic finality with a mathematical one.)
No. Someone commanding a majority of block-production power can do exactly two things: censor new transactions (refuse to include them) and reorg recent blocks to double-spend their own coins. That's the whole menu. They cannot steal your coins, forge your signature, mint coins from nothing, or change the rules — because every full node still independently rejects invalid blocks (Level 3's guarantee holds no matter who is attacking). A 51% attack is real and damaging, but it is bounded, not god-mode. Guides 2 and 3 put a price tag on it.
Everything above is the machine. These pods are the truths the machine's design implies but rarely states out loud — including the one that finally answers "how can something with no owner be legitimate?"
A bitcoin is not an object stored anywhere. There is only the set of unspent outputs (the UTXO set), computed by replaying every transaction from the genesis block forward. "Your balance" is not a number sitting in a file — it's the answer to a query run against the whole history. Own the coins and you own nothing but a private key that can authorize new entries in the ledger.
An append-only log of immutable facts, with current state derived by replaying it rather than stored — that's event sourcing. A blockchain is a globally-replicated, cryptographically-welded event store, and the UTXO set (or account state) is a projection of it. If that guide clicked for you, you already understand the storage model here.
Two different things get "agreed" on a blockchain, and conflating them causes endless confusion. Validity rules — what counts as a legal transaction — are enforced unanimously by every node; reject them and you're simply not on the network anymore. Ordering — which valid block comes next — is decided by weight of work or stake. Changing the rules is a hard fork: a constitutional moment where humans, not hashpower, decide which set of rules deserves the name.
Two case studies show who really holds the pen. The DAO hack (2016): a bug drained ~$60M of ETH, and Ethereum's community chose to hard-fork the chain to reverse the theft. Dissenters who believed "code is law" kept running the old chain — it survives as Ethereum Classic. Bitcoin's block-size war (2017): a faction forked to raise the block size, creating Bitcoin Cash; the market overwhelmingly stayed with the original rules. In both cases the split was decided not by an algorithm but by which chain exchanges, developers, and users chose to call real.
How does a decentralized system control legitimacy? On two levels. Mechanically, every node enforces the rules, so no powerful party can push through an invalid block. Ultimately, when the rules themselves are in dispute, legitimacy is social — code enforces the rules, but people choose which code to run. Decentralization doesn't remove human judgment; it relocates it from an authority to a community.
Finding a SHA-256 collision by brute force takes roughly 2¹²⁸ operations (the birthday bound). For scale: the entire Bitcoin network, running flat out since 2009, has computed on the order of 2⁹⁵ hashes total — billions of times short of a single expected collision. If SHA-256 ever broke, "crypto" would be the least of anyone's worries: the same function secures TLS, software updates, and the banking system.
Quantum? Grover's algorithm only halves the exponent — a 2¹²⁸ preimage search, still comfortably infeasible. Hashes are quantum-resistant enough. The real quantum exposure is signatures: Shor's algorithm threatens ECDSA, which is why post-quantum migration research targets the signature scheme, not the hash.
Nothing physically forbids rewriting a hundred blocks of history — the protocol will cheerfully accept a heavier chain if one appears. What stops it is that building that heavier chain costs more than the attack could ever yield. "Immutable" is a statement about economics, not physics. On a small chain with a thin security budget, it's barely true at all — which is exactly why Guide 2 opens with real chains that were rewritten by attackers who could afford it.
Addresses aren't your name — but every transaction you ever make is public and permanent. That's the opposite of anonymous. Chain-analysis firms deanonymize users routinely by clustering addresses and correlating with the moment crypto touches the real world (an exchange, a purchase). "Crypto is anonymous" is a myth; "crypto is a permanent public record loosely tied to pseudonyms" is the truth.
You now know that writing history must be costly, and why — it's the only defense against the Sybil attack. The next guide, How proof-of-work really works, takes the first answer — burn electricity — all the way down: mining as a lottery, why it hit an energy wall, and the real chains that got robbed when their bill got too cheap to pay.