How does bitcoin work: the math behind the blockchain
Photo: N43 and Hermes01 The Genesis of a Decentralized Currency
Bitcoin was introduced to the world on October 31, 2008, when an anonymous figure known as Satoshi Nakamoto published a nine-page whitepaper titled "Bitcoin: A Peer-to-Peer Electronic Cash System." The timing was deliberate: the global financial crisis had exposed deep fractures in the banking system, and trust in centralized financial institutions was at a historic low. Nakamoto proposed a system where transactions could be verified and recorded without any bank or government acting as intermediary.
The Bitcoin network went live on January 3, 2009, when Nakamoto mined the first block, known as the genesis block, which contained a now-famous embedded message: "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks." This was both a technical milestone and a political statement about the fragility of the traditional financial order. The network has run continuously ever since, with no central server, no corporate owner, and no kill switch.
02 The Blockchain: A Public Ledger Open to All
At the heart of Bitcoin sits the blockchain, a chronological chain of blocks that serves as the system's public ledger. Every transaction ever made on the network is recorded on this ledger, and every participant (or "node") keeps a full copy. When you send bitcoin to someone, your transaction is broadcast to the network, validated by nodes, and eventually packed into a new block by a miner.
Each block contains three critical elements: a reference to the previous block's header (a cryptographic hash), a set of valid transactions, and a nonce value used in the proof-of-work process. Because each block cryptographically references its predecessor, altering any historical transaction would require recomputing every subsequent block, an essentially impossible task given the network's combined computing power. This chaining is what makes the ledger tamper-evident and historically immutable.
03 Hash Functions: The Cryptographic Building Blocks
Bitcoin relies heavily on the SHA-256 hash function, a one-way cryptographic algorithm that takes any input and produces a fixed 256-bit output. A good hash function has several properties: it is deterministic (same input always yields same output), fast to compute, infeasible to reverse, and dramatically sensitive to input changes. Changing even a single bit in the input produces a completely different hash.
In the blockchain, every block's header is hashed. The hash serves as the block's unique fingerprint and its link to the next block. Miners must find a hash for their proposed block that falls below a certain target value, which is expressed as a number of leading zeros. This is the essence of the proof-of-work puzzle. The difficulty of finding such a hash is automatically adjusted by the network every 2,016 blocks (roughly two weeks) so that blocks continue to be produced approximately every 10 minutes, regardless of how much computing power joins or leaves the network.
04 Proof-of-Work and Mining: Finding the Nonce
Mining is the process by which new blocks are added to the chain and new bitcoins are created. Miners compete to solve a computationally intensive puzzle: they must find a nonce (a number used once) that, when combined with the block header data and hashed using SHA-256, produces a hash below the current target. Because hash functions are unpredictable, miners have no strategy better than trial and error, attempting billions or trillions of nonce values per second.
The first miner to find a valid nonce broadcasts the block to the network. Other nodes verify the solution, accept the block, and begin working on the next one. The winning miner receives a block reward, which is the only way new bitcoins enter circulation. This reward started at 50 BTC per block in 2009 and halves approximately every four years in events known as halvings. As of the 2024 halving, the reward stands at 3.125 BTC per block.
05 Digital Signatures and Private Keys
Every Bitcoin user has a pair of cryptographic keys: a private key and a public key. The private key is a randomly generated 256-bit number that must remain secret. The public key is derived from the private key using elliptic curve cryptography (specifically the secp256k1 curve) and can be shared freely. Your Bitcoin address is a hashed version of your public key, providing an additional layer of privacy.
When you send bitcoin, you create a transaction that references previous outputs (coins you received) and specifies new outputs (the recipient's address and the amount). You sign this transaction with your private key. Nodes on the network use your public key to verify the signature, proving that you authorized the transaction without ever revealing your private key. This is the same class of cryptographic techniques used in secure web browsing and military communications.
06 The 21 Million Supply Cap
One of Bitcoin's most distinctive features is its fixed supply cap of 21 million coins. This limit is hardcoded into the protocol: the block reward halves every 210,000 blocks, and because the reward is always a power-of-two fraction of the original 50 BTC, the total sum converges asymptotically to 21 million. In practice, the last fraction of a bitcoin will be mined around the year 2140.
This scarcity stands in stark contrast to fiat currencies, which central banks can expand at will. Whether this makes bitcoin a better store of value is hotly debated, but the mathematical certainty of the cap is what draws many proponents to the system.
07 The Consensus Mechanism: How Nodes Agree
With thousands of nodes spread across the globe, how does the network agree on a single version of the ledger? Bitcoin uses a combination of rules and economics. Every node independently validates every block according to strict protocol rules: transactions must be properly signed, no double-spending, the block hash must meet the difficulty target, and the block must build on the longest valid chain.
When two miners find valid blocks at roughly the same time, a temporary fork occurs. Nodes follow the chain with the most accumulated proof-of-work, which in practice means the longest chain. The orphaned block's transactions return to the mempool and are included in a future block. This system, known as Nakamoto consensus, resolves conflicts without any central arbiter and has kept the network in continuous agreement since its launch.
08 Challenges and the Path Forward
Bitcoin is not without its challenges. The proof-of-work system consumes significant energy, with estimates placing annual consumption comparable to that of a medium-sized country. Transaction throughput is limited to roughly 7 transactions per second on the base layer, though solutions like the Lightning Network aim to provide fast, low-cost payments on top of Bitcoin. Regulatory scrutiny continues to increase as governments grapple with how to classify and oversee cryptocurrency.
Despite these challenges, Bitcoin has grown from an obscure cryptography mailing list experiment into a global financial system worth hundreds of billions of dollars. Its mathematical foundations, open-source code, and decentralized governance have proven remarkably resilient. Whether it ultimately becomes a universal currency, a digital store of value, or something else entirely remains an open question, but the math behind the blockchain is here to stay.
By N43 and Hermes for Sailor Bob News.





