Bitcoin Architecture — The Machine With No Owner
Bitcoin is the digital Rai stone. No coin ever physically moves. Instead, a worldwide network of computers agrees on who owns what, and writes that agreement into an unchangeable public record. There is no central bank, no CEO, no server room you could raid. Bitcoin is architecture without an architect-in-charge — a machine that runs itself.
Bitcoin's architecture is a carefully layered stack: a peer-to-peer network of nodes, a ledger of blocks, the UTXO accounting model, Bitcoin Script for spending conditions, and mining to secure it all. This tutorial dissects every layer, from a single transaction to the Genesis Block, halvings, and the global network.
Bitcoin Transactions — Moving Value Without Moving Coins
A Bitcoin transaction does not "move" a coin like handing over cash. Instead, it consumes existing chunks of value (inputs) and creates new chunks (outputs). Every input points back to an earlier output that has not yet been spent. Think of it as tearing up old cheques and writing new ones.
Inputs must be spent entirely. If you have a 0.8 BTC chunk but only want to send 0.75, the remaining 0.05 (minus the fee) is sent back to you as change — usually to a brand-new address your wallet generates automatically. This is why your Bitcoin balance is scattered across many addresses, and why reusing addresses hurts your privacy.
The UTXO Model — Bitcoin's Accounting System
Bitcoin does not track account balances the way a bank does. Instead it tracks Unspent Transaction Outputs (UTXOs) — discrete, indivisible chunks of Bitcoin, each locked to an owner. Your "balance" is simply the sum of all UTXOs your keys can unlock, like the total of all the coins and notes scattered in your pockets.
| One running balance per account |
| Alice: 1.2 BTC (a single number) |
| Send = subtract from balance |
| Simple, but harder to parallelize |
| Many discrete unspent chunks |
| Alice: 0.3 + 0.5 + 0.4 = 1.2 BTC |
| Send = consume chunks, make new ones |
| Better privacy & parallel checking |
Each UTXO can only be spent once. The moment it is used as an input, every node marks it "spent" and removes it from the UTXO set. If you try to spend the same UTXO twice, the second transaction references something that no longer exists — and the network instantly rejects it. No central checker needed; the model itself makes double-spending impossible.
Bitcoin Script — The Lock On Every Coin
Every UTXO is guarded by a small program written in Bitcoin Script — a simple, deliberately non-Turing-complete (no loops) stack language. To spend a coin, you must provide an input that makes its locking script evaluate to TRUE. The most common lock is "prove you own the private key for this address."
Here is the classic Pay-to-Public-Key-Hash (P2PKH) script that guards most Bitcoin. The spender pushes their signature and public key; the locking script verifies both:
# scriptSig (unlocking) — provided by the spender
<signature> <publicKey>
# scriptPubKey (locking) — attached to the UTXO
OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
# Combined execution on the stack:
# 1. Push signature and public key
# 2. OP_DUP -> duplicate the public key
# 3. OP_HASH160 -> hash it to get pubKeyHash
# 4. OP_EQUALVERIFY -> must match the address's hash
# 5. OP_CHECKSIG -> signature must be valid -> TRUE
Unlike Ethereum's Turing-complete contracts, Bitcoin Script deliberately cannot loop. This means a script always finishes in predictable time and can never hang a node with an infinite loop. It sacrifices flexibility for rock-solid safety — a very Bitcoin trade-off: do less, but do it bulletproof.
Block Structure — What's Inside A Block
A Bitcoin block has two parts: a tiny 80-byte header that miners hash, and a body containing all the transactions (up to ~4 MB with SegWit). The header is the security-critical part — it links to the previous block, commits to all transactions via the Merkle root, and holds the nonce.
The Genesis Block — Where It All Began
It was the front-page headline of that day's London Times — both a timestamp proving the block wasn't pre-mined, and a political statement about the broken banking system Bitcoin was built to replace. The 50 BTC reward in that block can never be spent, encoded that way in the original software. It sits untouched to this day.
The Mining Process — Securing The Chain
Mining is the competitive process that adds new blocks and secures Bitcoin. Miners collect pending transactions, assemble a candidate block, and race to find a nonce that makes the block header hash fall below the difficulty target. The winner earns the block reward. This "proof-of-work" makes rewriting history astronomically expensive.
To rewrite a past transaction, an attacker would need to re-mine that block and every block after it — faster than the entire honest network combined. This requires controlling over 51% of global mining power, costing billions in hardware and electricity. The economic cost of attacking exceeds any possible gain. Security through raw energy.
The Coinbase Transaction — Minting New Bitcoin
The very first transaction in every block is special: the coinbase transaction (unrelated to the exchange of the same name). It has no inputs — it creates brand-new Bitcoin out of nothing and pays it to the winning miner. This is the only way new Bitcoin enters existence.
In 2026, a miner who wins a block earns roughly 3.125 BTC in new coins plus whatever fees the ~3,000 included transactions paid — often another 0.1–0.5 BTC. During congestion, fees can spike dramatically, briefly making the fee reward larger than the subsidy.
Difficulty Adjustment — Keeping 10-Minute Blocks
As more miners join, blocks would be found faster — so Bitcoin automatically makes mining harder to compensate. Every 2,016 blocks (about two weeks), the network recalculates the difficulty target so that the average block time stays locked at ~10 minutes, no matter how much mining power exists.
New Difficulty = Old Difficulty × (2 weeks / actual time for last 2,016 blocks).
If the last 2,016 blocks took only 10 days instead of 14, difficulty jumps ~40% to slow things
back down. Adjustments are capped at a 4× change per period to prevent wild swings.
The Halving — Bitcoin's Programmed Scarcity
Roughly every four years (every 210,000 blocks), the block subsidy is cut in half. This "halving" steadily reduces the rate of new Bitcoin creation until, around the year 2140, the last satoshi is mined and the supply caps forever at 21 million BTC. Scarcity is not a policy — it is written in the code.
| Halving | Year | Block Height | Reward |
|---|---|---|---|
| Genesis era | 2009 | 0 | 50 BTC |
| 1st Halving | 2012 | 210,000 | 25 BTC |
| 2nd Halving | 2016 | 420,000 | 12.5 BTC |
| 3rd Halving | 2020 | 630,000 | 6.25 BTC |
| 4th Halving | 2024 | 840,000 | 3.125 BTC |
| Final coin | ~2140 | ~6,930,000 | 0 (fees only) |
Halvings cut the flow of new supply in half overnight while demand often keeps rising. Bitcoin's most dramatic bull runs have historically followed halving events. Whether or not that pattern continues, the halving is what makes Bitcoin disinflationary — its issuance rate only ever falls, unlike fiat currencies that can be printed without limit.
The Bitcoin Network — Nodes That Keep It Honest
Bitcoin runs on a global peer-to-peer network of roughly 15,000 reachable full nodes. Each node independently stores the entire blockchain, validates every transaction and block against the rules, and relays valid data to its peers. No node is in charge — the rules are enforced by everyone, everywhere, simultaneously.
Miners produce blocks, but full nodes decide what's valid. If miners tried to change the rules (say, print extra coins), every full node would reject their blocks as invalid. This is why anyone running a node — even on a cheap Raspberry Pi — is part of what keeps Bitcoin honest and decentralized. The power lies with the users, not the miners.