From one switch
to a financial network nobody owns.
Bell Labs, 1947. A small piece of germanium let electricity change direction on command. Two states, one switch. In 2008, nine pages by Satoshi Nakamoto turned that same primitive, scaled by billions, into a network that lets thousands of strangers agree on a shared truth without trusting each other. This page is the bridge between those two events. It's the capstone: every other page on the site shows up here, in order, with nothing missing.
The ladder: from a transistor to Bitcoin
In 1947 a physicist at Bell Labs placed two gold foil contacts onto a sliver of germanium. He applied a small voltage. And made electricity change direction. He called it a transistor. He had no idea what he had started.
Sixty one years later a person called Satoshi Nakamoto published nine pages. Those nine pages took the same switch, scaled by billions, running at four billion cycles per second, connected to every other machine on Earth, and answered a question that had been considered unsolvable for thirty years: how do thousands of strangers agree on the same truth without trusting each other?
Not with a central server. Not with a trusted third party. Not with anyone in charge. With mathematics.
This page is the bridge between those two moments. Every page on this site shows up here. In order. With nothing missing.
You have already met every layer below. This page stacks them, deliberately, on top of each other, and shows what falls out at the top. The stack is not metaphorical. Every box in the ladder below is a real, physical layer that the layer above it depends on.
Read the ladder bottom to top, the way history built it:
- Transistor (1947). Bell Labs, William Shockley, John Bardeen, Walter Brattain. A pinch of germanium that switches electricity on or off in response to a third terminal. Single switch. The Nobel was for this.
- Binary. Two voltage levels become two symbols: 0 and 1. Every other number, every character, every image, every video, every bitcoin transaction is, at the wire level, a sequence of these. The binary page covered it.
- Logic gates. Wire transistors into AND, OR, XOR, NOT. The logic gates page showed how a handful of these compose into an adder and a flip-flop.
- OS + CPU. Stack billions of those gates onto silicon and you have a CPU running fetch-decode-execute forever. Stack an operating system on top so many programs can share one CPU safely.
- Memory, pointers, data structures. The CPU needs somewhere to put state. Memory is just a long array of bytes; pointers are just numbers that mean "look at that byte"; everything from arrays to hash maps is built on those three ideas.
- Hashing. A hash function takes any sized input and returns a fixed-size fingerprint. Same input always produces the same output. Tiny change in input completely changes the output. Irreversible. This single primitive is the rest of the page.
- Nodes and networking. Connect machines, give each one an address, agree on a protocol, and a single computer becomes a participant in a global network of millions.
- Blockchain. Now do something nobody had figured out for thirty years: make those millions of mutually distrusting machines agree on the same history, without a central server, without a trusted third party, without anyone in charge.
The CAP theorem, which you learned on the previous pages, is the formal proof of why this is hard. During a network partition you cannot have both consistency and availability. Bitcoin chose consistency above everything; the waiting is not inefficiency, it is the price of mathematical truth. ← see: cap theorem
The breakthrough, in one sentence
Combine a cryptographic hash with an economic incentive, broadcast everything over an open gossip network, and let the longest valid chain win. The hash makes tampering detectable; the incentive makes honest behaviour profitable; the gossip network removes the need for a coordinator; the longest-chain rule makes disagreement resolvable. Each ingredient is a page on this site. The combination is Bitcoin.
Build the chain yourself
Before the formal anatomy, get your hands on it. Mine a block and watch the nonce search run live. Then try to cheat: edit a historical block and watch every block after it turn red. The hash box at the bottom is real SHA-256, so you can feel the avalanche that makes all of this work.
Inside a block, and the mining loop that produces it
What's actually in a block
A Bitcoin block is a tiny 80-byte header plus a list of transactions. The header is what matters for the chain's integrity. The body is what matters for the economic content. Both are bound together by the Merkle root field.
Notice three of those fields are pointers back into the past or sideways into the present:
prev_hashis the hash of the previous block's header. It nails this block to the rest of the chain.merkle_rootis the fingerprint of every transaction in this block. The hashing page introduced Merkle trees; this is one being used in production.nonceis the only field a miner is free to spin: a 4-byte counter they iterate to find a valid hash.
// A Bitcoin block, in 30 lines.
// Hash this struct, get a 32-byte fingerprint; that's the block's identity.
// The next block in the chain stores this fingerprint as its prev_hash.
use sha2::{Sha256, Digest};
struct BlockHeader {
version: u32, // 4 bytes
prev_hash: [u8; 32], // 32 bytes; points at the previous block
merkle_root: [u8; 32], // 32 bytes; fingerprint of every tx in this block
timestamp: u32, // 4 bytes; unix time
bits: u32, // 4 bytes; encodes the current difficulty target
nonce: u32, // 4 bytes; the miner's degree of freedom
} // = 80 bytes total
impl BlockHeader {
fn hash(&self) -> [u8; 32] {
// Bitcoin double-hashes: SHA-256(SHA-256(header)).
// The double is for historical reasons; the result is still 32 bytes.
let mut h1 = Sha256::new();
h1.update(self.serialize());
let first = h1.finalize();
let mut h2 = Sha256::new();
h2.update(first);
h2.finalize().into()
}
}#include <stdint.h>
#include <string.h>
#include <openssl/sha.h>
/* A Bitcoin block header: exactly 80 bytes. */
typedef struct __attribute__((packed)) {
uint32_t version; /* 4 bytes */
uint8_t prev_hash[32]; /* 32 bytes; points at previous block */
uint8_t merkle_root[32]; /* 32 bytes; fingerprint of all txns */
uint32_t timestamp; /* 4 bytes; unix time */
uint32_t bits; /* 4 bytes; encodes difficulty target */
uint32_t nonce; /* 4 bytes; the miner's degree of freedom */
} BlockHeader; /* = 80 bytes total */
/* Bitcoin double-hashes: SHA256(SHA256(header)). */
void block_hash(const BlockHeader *header, uint8_t out[32]) {
uint8_t first[32];
SHA256((const uint8_t *)header, sizeof(BlockHeader), first);
SHA256(first, 32, out);
}
/* Compare hash against target (both big-endian 256-bit). */
int hash_meets_target(const uint8_t hash[32], const uint8_t target[32]) {
return memcmp(hash, target, 32) < 0;
}The chain, made of these blocks
Each block's prev_hash field is the hash of the previous block's full header. Change anything in any historical block (a transaction amount, an address, a timestamp) and that block's hash changes. The next block's stored prev_hash no longer matches. Every block after the tampered one is now invalid. To "fake" a change, you would have to re-mine every subsequent block, faster than the rest of the world is producing new ones. That is the entire security argument.
Inside a single block: the Merkle root
The hashing page covered Merkle trees; here is where they pay off in production. The block's body might contain three thousand transactions; the block header carries a single 32-byte hash that fingerprints all of them. Change any leaf transaction and every hash on its path to the root changes. The 80-byte header inherits all the integrity guarantees of the megabyte-sized body, at zero extra cost.
The Merkle root is a hash of hashes: a tree of SHA-256 operations. Change any transaction anywhere in the tree and the root changes completely. The 80-byte header inherits all the integrity of the megabyte-sized body. This is the hashing page's Merkle tree in production. ← see: hashing
Mining: brute force, made expensive on purpose
The catch on adding a block is that not every header is valid. The network agrees on a difficulty target: a 256-bit number, currently around 0x00000000000000000004…, that the block's hash must be less than. Because SHA-256 has the avalanche property, the only way to hit such a target is to keep trying nonces until one comes out small enough. There is no algorithm. There is no shortcut. Only the loop.
// The mining loop in five lines, conceptually.
// Increment the nonce, hash, check. Repeat ~2^70 times per block on Bitcoin.
fn mine(mut header: BlockHeader, target: [u8; 32]) -> BlockHeader {
loop {
let h = header.hash();
if h < target { // hash interpreted as a 256-bit big-endian number
return header; // we found a valid block
}
header.nonce = header.nonce.wrapping_add(1);
// if nonce overflows, miners tweak the coinbase tx to refresh the
// merkle_root, which gives them another 2^32 attempts. In practice
// they also vary the timestamp by a few seconds.
}
}
// Every Bitcoin block on the planet was found by some computer running
// this exact loop. The thing that took thousands of CPU-years of compute
// is the IF check on line 4. There is no clever algorithm; only the loop.#include <stdint.h>
#include <string.h>
/* The mining loop. Every Bitcoin block ever found was
* produced by some version of this loop. */
BlockHeader mine(BlockHeader header, const uint8_t target[32]) {
uint8_t hash[32];
for (;;) {
block_hash(&header, hash);
/* Hash interpreted as a 256-bit big-endian number.
* If it is less than the target: valid block found. */
if (hash_meets_target(hash, target)) {
return header;
}
header.nonce++; /* try the next nonce */
/* nonce overflows every 2^32 attempts (~4 billion).
* Miners then tweak the coinbase tx to get a new
* merkle_root, giving them another 2^32 attempts.
* In practice they also vary the timestamp. */
if (header.nonce == 0) {
break; /* signal: need to refresh merkle_root */
}
}
return header; /* caller updates merkle_root and retries */
}
/* Every Bitcoin block on the planet was found by some
* computer running this exact loop. The expensive part is
* the hash_meets_target check. No clever algorithm. Only the loop. */Why this is a Byzantine fault-tolerant ledger
Three things together make Bitcoin Byzantine fault tolerant:
- Cryptographic identity. Every transaction is signed; you can't forge somebody else's signature without their private key. The hashing page set up the primitive.
- Hash-linked history. Tampering with any block invalidates every block after it. The chain itself is tamper-evident.
- Proof-of-work + longest chain. Adding a new block costs energy. Whoever does more work, faster than everyone else, gets to extend the chain. To rewrite history, an attacker would have to redo all that work, and outpace the honest majority indefinitely. Game theory does the rest.
Strip out any of the three and the system collapses. Together, they make decentralised agreement possible.
The CAP theorem explains why Bitcoin is slow. During normal operation Bitcoin chose EC, strong consistency, in the PACELC framework. Every confirmation is a distributed system choosing correctness over speed. Ten minutes is not a bug; it is the PACELC price of PC/EC across ten thousand mutually distrusting nodes. ← see: pacelc
One transaction, through every layer on this site
Follow a single Bitcoin transaction from your wallet to a confirmed block. At every step it's touching machinery from a different page on this site. By the time it's confirmed, every prior topic has been used at least once.
// A Bitcoin transaction in flight. This is the same byte stream that travels
// from your wallet through the gossip network to the miners.
//
// Step-by-step, every layer of the site is doing its job:
//
// 1. WALLET CREATES TX
// - allocates a Vec<u8> on the heap (memory + arrays pages)
// - fills it with inputs, outputs, scripts
//
// 2. WALLET SIGNS TX
// - hashes the tx body with SHA-256 (hashing page)
// - signs that hash with ECDSA / Schnorr
//
// 3. WALLET BROADCASTS TX
// - opens a TCP socket to a Bitcoin node (pointers + OS + networking pages)
// - writes the serialised tx as bytes (binary page; bytes are bytes)
// - kernel splits it into IP packets (networking page)
//
// 4. NODES VALIDATE TX
// - parse the bytes back into a struct (variables + arrays page)
// - verify the signature with hashing (hashing page)
// - check inputs against the UTXO set (hash maps; hashing page)
// - if valid, gossip it to every peer (networking page)
//
// 5. MINER INCLUDES TX IN A BLOCK
// - the mempool is a hash map keyed by txid (hashing page)
// - the miner picks high-fee txs into a candidate block
// - hashes the block header repeatedly until a valid nonce is found
//
// 6. BLOCK GOSSIPED ACROSS THE NETWORK
// - every node verifies the block independently
// - if everything checks out, the block is added to the chain
// - your tx now has one "confirmation"
//
// Every layer in here was a previous page on this site.#include <stdint.h>
#include <string.h>
#include <unistd.h>
/*
* A Bitcoin transaction in flight. The same byte stream that
* travels from your wallet through the gossip network to the
* miners. Each step uses a different page from this site.
*/
/* STEP 1: WALLET CREATES TX
* - allocates memory on the heap (memory page)
* - fills with inputs, outputs, scripts */
typedef struct {
uint8_t *data; /* heap-allocated byte array (arrays page) */
uint32_t length;
uint32_t capacity;
} ByteVec;
/* STEP 2: WALLET SIGNS TX
* - hashes the tx body with SHA-256 (hashing page)
* - signs the hash with ECDSA / Schnorr */
void sign_transaction(ByteVec *tx, const uint8_t privkey[32],
uint8_t sig_out[64]) {
uint8_t tx_hash[32];
SHA256(tx->data, tx->length, tx_hash); /* hashing page */
ecdsa_sign(privkey, tx_hash, sig_out); /* cryptography */
}
/* STEP 3: WALLET BROADCASTS TX
* - opens a TCP socket to a node (OS + networking pages)
* - writes serialised tx as bytes (binary page)
* - kernel splits into IP packets (networking page) */
int broadcast_transaction(const ByteVec *tx, const char *node_ip,
uint16_t port) {
int sock = tcp_connect(node_ip, port); /* OS + pointers */
if (sock < 0) return -1;
struct BitcoinMessage msg = {
.magic = 0xD9B4BEF9,
.payload_size = tx->length,
};
memcpy(msg.command, "tx\0\0\0\0\0\0\0\0\0\0", 12);
SHA256d(tx->data, tx->length, msg.checksum); /* hashing page */
write(sock, &msg, sizeof(msg)); /* networking page */
write(sock, tx->data, tx->length);
return sock;
}
/* STEP 4: NODES VALIDATE TX
* - parse bytes back into a struct (variables + arrays page)
* - verify signature via hashing (hashing page)
* - check the UTXO set (a hash map) (hashing page)
* - gossip to peers if valid (networking page)
*
* STEP 5: MINER INCLUDES IT IN A BLOCK
* - mempool is a hash map txid->tx (hashing page)
* - mines the header until valid (this page)
*
* STEP 6: BLOCK GOSSIPED AND CONFIRMED
* - every node verifies independently
* - your tx now has one confirmation
*
* Every layer in here was a previous page on this site. */Gossip: how the transaction reaches the miners
Your wallet does not know which miner will include your transaction. It doesn't need to. It opens a TCP connection to any reachable node, sends the bytes, and the node forwards them to every peer it has. Each of those peers verifies the signature (more hashing) and forwards them again. Within a few seconds, every node on the planet has your transaction in their mempool. From there it is a matter of waiting for a miner to find a block that includes it.
The same bytes, all the way down
#include <stdint.h>
// What's on the wire between two Bitcoin nodes. Every `bitcoind` and
// `btcd` on the planet sends and receives exactly this:
struct BitcoinMessage {
uint32_t magic; // 0xD9B4BEF9 for mainnet
char command[12]; // "tx", "block", "inv", "version", ...
uint32_t payload_size;
uint32_t checksum; // first 4 bytes of SHA-256(SHA-256(payload))
uint8_t payload[]; // the actual transaction or block bytes
};
// The payload is itself a binary-encoded struct: integers little-endian,
// strings length-prefixed, hashes raw 32-byte blobs. Same idea as every
// protocol in the networking page. The agreement is what makes it work.
//
// Strip the message wrapper: bytes.
// Strip the bytes: bits.
// Strip the bits: voltages on copper, photons on glass.
// All the way down to the transistor.#include <stdint.h>
// What's on the wire between two Bitcoin nodes. Every `bitcoind` and
// `btcd` on the planet sends and receives exactly this:
struct BitcoinMessage {
uint32_t magic; // 0xD9B4BEF9 for mainnet
char command[12]; // "tx", "block", "inv", "version", ...
uint32_t payload_size;
uint32_t checksum; // first 4 bytes of SHA-256(SHA-256(payload))
uint8_t payload[]; // the actual transaction or block bytes
};
// The payload is itself a binary-encoded struct: integers little-endian,
// strings length-prefixed, hashes raw 32-byte blobs. Same idea as every
// protocol in the networking page. The agreement is what makes it work.
//
// Strip the message wrapper: bytes.
// Strip the bytes: bits.
// Strip the bits: voltages on copper, photons on glass.
// All the way down to the transistor.Every page, doing its job, in one transaction
The closer
The full PACELC picture
Bitcoin is the most extreme PC/EC system ever built at planetary scale. During a partition it halts rather than risk chain divergence (PC: consistency over availability). During normal operation, every confirmation waits for global consensus, ten minutes per block (EC: consistency over latency).
Satoshi did not choose this arbitrarily. With money there is no such thing as reconciling later. The double-spend problem is the CAP theorem applied to a ledger: if two nodes accept the same coin simultaneously, the ledger is inconsistent and someone gets money they should not have. Proof of Work is the solution. Not a coordinator, not a trusted server, not a governance mechanism. Just mathematics that makes lying more expensive than honesty.
Every blockchain that came after Bitcoin is a different answer to the same PACELC question:
- Bitcoin: PC/EC. Absolute truth. Ten minutes.
- Ethereum: PC/EC, strengthening. DeFi demands it.
- Solana: PA/EL. Speed above all. Accept the outages.
- Sui and Aptos: hybrid. Per-operation tradeoffs.
Every chain is a public PACELC declaration. And now you understand every layer of every one of them. From the transistor to the tradeoff.
Where to dig in next
This page closes the ladder. The directions to walk from here are deep, in every direction:
- Read the Bitcoin whitepaper. Nine pages. Worth two hours of careful reading; you will understand most of it now.
- Mastering Bitcoin (Andreas Antonopoulos). The book-length version, free online, that walks you from key generation to consensus.
- Ethereum and smart contracts. Same ladder, plus a Turing-complete VM on top. The "world computer" pitch.
- Proof-of-stake systems (Ethereum after the Merge, Solana, Cosmos). Same goal as proof-of-work, different economic primitive.
- Layer-2 scaling (Lightning, rollups, channels). How to get more transactions per second without touching the base chain.
- Zero-knowledge proofs (zk-SNARKs, zk-STARKs). The mathematical frontier; everything in this page, plus succinct proofs of computation.
- The Byzantine Generals paper (Lamport, Shostak, Pease, 1982). The original problem statement, surprisingly readable.
Every page. One system.
This is not a connections section. This is a proof that every concept you learned was always pointing here.
// end of root.system
You started with a transistor. A single switch. On or off. 1 or 0. You followed that switch through nineteen pages. And you arrived here. At a network that processes billions of dollars every day, that has never been successfully altered, that nobody owns, that nobody controls, that cannot be shut down.
Not because of legal protection. Not because of institutional trust. Not because anyone decided it should exist. Because of mathematics. Running on transistors, wired into logic gates, organised into a CPU, running an operating system, allocating memory, following pointers, organising data structures, hashing everything, broadcasting over a network, letting nodes agree, choosing consistency over speed, making lying computationally impossible.
From one switch in 1947. To a trustless global financial network in 2008. Powered by every concept on this site. All of them. Simultaneously. Right now.