How Bitcoin Works
The short answer
Bitcoin is a decentralized network where participants transfer value recorded as unspent transaction outputs (UTXOs). Cryptographic keys authorize these transfers, which are then included in a shared, public transaction history called a blockchain. This history is secured by 'Proof of Work' and enforced by independent network participants following common rules.
This lesson explains Bitcoin's fundamental mechanics, detailing how it tracks value, authorizes spending, maintains a shared history, and secures that history without a central authority.
This lesson explains how money works. It isn't financial advice: for your own situation, talk to a qualified financial adviser.
By BasicsTutor · Created with AI, researched and fact-checked · Updated Sep 28, 2026 · How we make lessons
Value is Defined by Unspent Transaction Outputs (UTXOs), Not Account Balances
Bitcoin fundamentally tracks spendable value as specific, previously received portions of transactions that have not yet been spent—known as Unspent Transaction Outputs, or UTXOs—rather than as a cumulative balance in a personal account. This model stems from Bitcoin's design as a peer-to-peer cash system without a central ledger operator; instead of a central entity declaring "Alice has $X," the network understands that a particular output from a past transaction is available to be spent. When you receive bitcoin, you are actually receiving an output in a transaction that is recorded in the public ledger. This output then becomes a UTXO. To spend it, you must reference this specific UTXO as an input in a new transaction. A transaction typically consumes one or more existing UTXOs as inputs and creates new UTXOs as outputs for the recipient and any 'change' returned to the sender. Each UTXO can only be spent exactly once. Most people, accustomed to traditional banking, imagine their Bitcoin wallet holds a 'balance' or 'digital coins' akin to money in a bank account. This intuition fails because there is no central balance sheet; your 'wallet balance' is merely the sum of all UTXOs that your wallet controls and is thus authorized to spend. You do not possess a 'file of coins.' This precise, granular tracking of value, where every unit has a traceable origin and spending event, is critical. It inherently prevents the 'double-spending' problem—where the same funds are spent more than once—without needing a central bank, because once a UTXO is consumed as an input, it ceases to exist and cannot be referenced again.
Imagine carrying physical cash. When you buy something, you don't just reduce a 'balance' in your pocket; you hand over specific bills (your inputs). If the total value of your bills exceeds the price, you receive specific new bills back as change (your change output), along with the item (the recipient's output). Each bill you spend can only be spent once. * Your bills: Individual UTXOs you own. * Handing them over: Providing UTXOs as inputs in a transaction. * Receiving change: A new UTXO returned to your address. * The item: A new UTXO created for the recipient.
- Bitcoin value is tracked as specific, one-time spendable transaction outputs (UTXOs), not account balances.
- A transaction consumes existing UTXOs as inputs and creates new UTXOs as outputs.
- The UTXO model prevents double-spending by ensuring each output is spent only once.
Private Keys Authorize Spending through Cryptographic Signatures
Because Bitcoin has no central authority to manage accounts or grant permissions, the ability to spend a UTXO is secured through cryptography. Specifically, owning a 'private key' gives you the power to authorize the spending of any UTXO associated with its corresponding 'public key' (or an address derived from it) by creating a digital signature. When a UTXO is created for you, it includes a locking script that specifies the conditions under which it can be spent, typically requiring a signature from the owner of a particular public key. To spend that UTXO, your wallet uses your private key to create a unique digital signature for the new transaction. This signature proves that you, and only you, are authorized to spend those specific funds without ever revealing your private key itself. Network participants can then verify the signature against the public key to confirm authenticity. Many people mistakenly believe that their Bitcoin wallet physically 'holds' their bitcoin, or that a password protects their digital currency like a bank login. In reality, a wallet is a software application that manages your private keys and helps you construct and sign transactions, while tracking which UTXOs are associated with those keys. Your 'bitcoin' is never 'in' the wallet; it exists as UTXOs recorded in the blockchain. This means the private key is the actual ownership of your bitcoin. If you lose your private key, you lose access to the associated UTXOs permanently, as there's no central recovery mechanism. Conversely, anyone who gains unauthorized access to your private key can spend your bitcoin. This underscores the paramount importance of safeguarding your private keys securely.
Consider a locked safe deposit box. The box itself is the UTXO, and it has a public label (the Bitcoin address) identifying it. The private key is the unique physical key that unlocks the box. * Safe Deposit Box: An individual UTXO. * Public Label/Address: The public key or Bitcoin address associated with the UTXO. * Physical Key: Your private key. * Unlocking and taking items: Signing a transaction to spend the UTXO. Others can see the box is unlocked and empty (transaction is valid and UTXO spent) but don't see your private key.
- Ownership of bitcoin is proven by possessing a private cryptographic key.
- A private key creates a digital signature that authorizes spending of UTXOs associated with its public key.
- Your wallet manages your private keys and tracks your UTXOs, it does not 'hold' bitcoin.
The Transaction History is Maintained by a Decentralized Network of Independent Validators
Building on the concept of individual authorization, Bitcoin maintains its shared, public transaction history—the blockchain—not through a single entity, but through a global network of independent computers called 'full nodes.' There is no central server or organization responsible for keeping the ledger. When a user creates and digitally signs a transaction to spend their UTXOs, they broadcast it to this peer-to-peer network. Any full node that receives this transaction will independently verify its validity: checking that the UTXOs exist and are unspent, that the digital signature is correct, and that no other consensus rules are violated. If valid, the node relays the transaction to its peers. 'Miners' (a specialized type of full node) then collect these verified transactions into a 'block,' which they attempt to add to the blockchain. Many people mistakenly assume that Bitcoin is operated by a specific company, like how banks operate their ledgers, or that there's a 'Bitcoin HQ' or 'main server.' This intuition fails because Bitcoin was designed specifically to eliminate such central points of control. The system's robustness comes from its distribution. This decentralized maintenance means that no single entity—whether a government, corporation, or individual—can unilaterally censor transactions, freeze funds, or arbitrarily alter the historical record. The network's integrity relies on a vast number of independent participants, each performing their own verification, collectively agreeing on the true state of the ledger, and enforcing the rules without needing to trust each other.
Consider a community where every resident keeps their own copy of a public bulletin board with rules for posting. When someone wants to make an announcement (a transaction), they write it down, sign it, and share it with their neighbors. Each neighbor checks if the announcement is properly signed and follows the rules before making their own copy and sharing it further. Periodically, a dedicated group (miners) gathers recent valid announcements into an official 'newsletter' (a block) to be distributed. * Residents: Full nodes. * Public Bulletin Board: The blockchain. * Announcement: A transaction. * Newsletter: A block.
- Bitcoin's transaction history (blockchain) is maintained by a global peer-to-peer network of independent full nodes.
- Full nodes independently verify and relay transactions and blocks, ensuring validity.
- Decentralized maintenance prevents single points of failure, control, or censorship.
Proof of Work Secures the Shared History Against Tampering
Because multiple independent entities maintain the blockchain (Principle 3), a mechanism is needed to ensure they converge on a single, agreed-upon history and to make that history extremely difficult to alter. Bitcoin achieves this with 'Proof of Work' (PoW), a process that makes rewriting past transactions prohibitively costly. Miners compete to create new blocks by solving a computationally intensive puzzle: finding a number (a 'nonce') that, when combined with the block's data and run through a cryptographic hash function, produces an output (a 'hash') that falls below a specific target value. This is a trial-and-error process, requiring immense computational power. The first miner to find a valid hash broadcasts their block, which includes the hash of the previous block. This 'chaining' of block hashes means that if anyone wanted to change a transaction in an old block, they would have to re-do the Proof of Work for that block and all subsequent blocks built on top of it, which would require more computational power than the rest of the network combined to reliably succeed. Many people mistakenly believe that mining is about 'solving complex math problems for useful purposes' or simply 'creating new coins.' They often view the significant energy consumption of mining as wasteful. This intuition misses the point that the energy expenditure is precisely what provides security. The profound implication is that the high computational cost and energy consumption involved in Proof of Work are not a bug; they are the fundamental feature that secures the Bitcoin network. This 'difficulty' directly translates into the integrity and immutability of the transaction history. The more blocks built on top of a transaction (confirmations), the more work an attacker would need to redo, making past transactions increasingly irreversible in practice, though never mathematically impossible.
Imagine a public ledger where, to add a new page (block) of transactions, you must first solve a very expensive, publicly verifiable puzzle (Proof of Work). The puzzle involves finding a specific grain of sand on a vast beach, and you can only prove you found it by presenting the grain itself, which is easy for anyone to check. Once found, this page is permanently bound to the previous page. If you wanted to change a transaction on an old page, you'd have to re-find all the specific grains of sand for that page and every subsequent page. * Finding the grain of sand: Performing the Proof of Work (hashing). * The grain of sand: The valid block hash below the target. * Expensive puzzle: The computational cost of mining. * Binding pages: Hashing the previous block into the current one.
- Proof of Work (PoW) makes altering past transaction history extremely costly by requiring immense computation.
- Miners compete to find a cryptographic hash below a target, linking new blocks to previous ones.
- The high energy expenditure of PoW is the core security mechanism, not a byproduct.
Network Consensus Rules Govern All Valid Behavior, Not Just Proof of Work
While Proof of Work makes it difficult to alter the transaction history (Principle 4), it does not, by itself, determine what constitutes a valid transaction or block. Instead, the entire network of full nodes independently enforces a strict set of 'consensus rules' that define all acceptable behavior within the Bitcoin protocol. A block found by a miner, even if it has a valid Proof of Work, is not automatically accepted by the network. Each full node independently verifies every aspect of that block: it checks that every transaction within the block is valid (e.g., UTXOs exist and are unspent, signatures are correct, no value is improperly created beyond the block subsidy and transaction fees) and that the block itself adheres to all protocol rules (e.g., correct block size, proper coinbase transaction, valid timestamp). If a block violates any of these consensus rules, full nodes will reject it, regardless of the Proof of Work expended. Many people mistakenly believe that miners, by virtue of their computational power, can dictate changes to the rules or insert invalid transactions. They might think that a successful Proof of Work means anything goes within that block. This intuition fails because the 'rules' are upheld by every participating full node, not just the miners. This leads to a non-obvious implication: the security and integrity of Bitcoin are not solely dependent on the computational power of miners; they are equally reliant on the distributed, independent validation performed by all full nodes. This means no single miner, or even a majority of miners, can unilaterally introduce invalid transactions, create extra bitcoin, or change the fundamental rules of the system. If they attempt to do so, their blocks will simply be ignored by the honest majority of full nodes, rendering their mining efforts wasted. The consensus rules are the ultimate safeguard, enforced by the collective and independent verification of the entire network.
Imagine a group of expert librarians, each with an identical, comprehensive rulebook for classifying books (transactions) and organizing shelves (blocks). A new assistant (miner) presents a newly organized shelf (block) and says they worked very hard (Proof of Work). Each librarian still independently checks every single book on that shelf against their own rulebook. If even one book is out of place or misclassified, the librarians reject the entire shelf, regardless of how much effort the assistant put into it. * Expert Librarians: Full nodes. * Rulebook: Bitcoin's consensus rules. * New Assistant: A miner. * Organized Shelf: A block with Proof of Work.
- Full nodes enforce a strict set of consensus rules for all transactions and blocks, not just Proof of Work.
- A block with valid Proof of Work will be rejected if it violates any consensus rule.
- The network's security relies on the collective, independent validation of all full nodes, preventing any single entity from changing the rules.
Put it into practice
- Use a public Bitcoin block explorer (e.g., blockchain.com/explorer) to look up a recent block. Identify its block height, timestamp, the previous block's hash, and inspect several individual transactions to see their inputs (UTXOs) and outputs.
- Experiment with an online private/public key pair generator (ensure it's for learning purposes only and you don't use the generated keys for real funds). Observe how a random private key mathematically generates a specific public key and Bitcoin address.
- Find a live mempool visualization tool (e.g., mempool.space) to observe transactions as they are broadcast to the network before being included in a block. Pay attention to transaction fees and how they might correlate with inclusion in subsequent blocks.
- Research the history of Bitcoin's 'halving' events and difficulty adjustments. Understand how the block subsidy changes over time and how the network dynamically adjusts mining difficulty to maintain a consistent block time.