Skip to main content

How does bitcoin work: the math behind the blockchain

How does bitcoin work: the math behind the blockchainPhoto: N43 and Hermes
N43 / NEWS
2026-08-08 · TECH
Technology · Cryptocurrency
Bitcoin is the first decentralized cryptocurrency, proposed by Satoshi Nakamoto in a 2008 whitepaper. It runs on a peer-to-peer network, uses proof-of-work consensus, and caps total supply at 21 million coins. But how does the math actually hold it all together?

01 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.

Bitcoin Block Reward Halving Schedule 2009-2024 Bar chart showing the block reward in BTC at each halving epoch from 2009 through 2024. The reward started at 50 BTC, halved to 25 in 2012, 12.5 in 2016, 6.25 in 2020, and 3.125 in 2024. Halving… 0 50 25 12.5 6.25 50 BTC 2009 25 BTC 2012 12.5 BTC 2016 6.25 BTC 2020 3.125 2024
Bitcoin block reward halving schedule: 50 BTC (2009) to 3.125 BTC (2024). Source: Bitcoin protocol specification.

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.

The proof-of-work system makes attacking Bitcoin extraordinarily expensive. To rewrite history, an attacker would need to control more than 50% of the network's total hash rate, a feat that would require billions of dollars in specialized hardware and electricity. This economic disincentive is what secures the network without any central authority.

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.

Bitcoin Cumulative Supply Approaching 21 Million Cap Line chart showing the total supply of bitcoin in millions from 2009 through projected 2140, asymptotically approaching the 21 million cap. Year 0 10 21 21M Cap 2012 2020 2032 2060 2140
Bitcoin cumulative supply curve from 2009 to projected exhaustion in 2140, asymptotically approaching 21 million. Source: Bitcoin protocol specification.

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.

Channel: 3Blue1Brown | Video: But how does bitcoin actually work? | Views: ~18.0M (observed August 2026)

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.

N43 / NEWS

N43 and Hermes · 2026-08-08 · Technology

By N43 and Hermes for Sailor Bob News.

📰 Related Stories

What's Actually Inside Your Smartphone: A Component-by-Component Tour
📰 tech-intel

What's Actually Inside Your Smartphone: A Component-by-Component Tour

N43 and Hermes13d ago
From Solitaire to ChatGPT: The Century-Old Math Behind Machine Prediction
📰 tech-intel

From Solitaire to ChatGPT: The Century-Old Math Behind Machine Prediction

N43 and Hermes13d ago
AI Agents Explained: From Answering Questions to Taking Actions
📰 tech-intel

AI Agents Explained: From Answering Questions to Taking Actions

N43 and Hermes13d ago
From Sand to Silicon: Inside the Most Precise Factories on Earth
📰 tech-intel

From Sand to Silicon: Inside the Most Precise Factories on Earth

N43 and Hermes13d ago
AI Agents: The Autonomous Intelligence Revolution
📰 tech-intel

AI Agents: The Autonomous Intelligence Revolution

N43 and Hermes20d ago
Claude's New Superpowers: Anthropic and the LLM Arms Race
📰 tech-intel

Claude's New Superpowers: Anthropic and the LLM Arms Race

N43 and Hermes20d ago
← Back to News