Bitcoin Math Explained: Hashes, Curves and 21 Million
Quick answer: Bitcoin uses cryptography, probability and a geometric series to work without a central authority. SHA-256 hashing links blocks into a tamper-evident chain and powers proof of work, in which miners hash block headers until the result meets a difficulty target. Elliptic-curve cryptography (secp256k1) lets owners sign transactions with private keys that anyone can check with public keys. Network consensus prevents double-spending, and block rewards that halve every 210,000 blocks cap issuance at about 20,999,999.98 bitcoins, just under 21 million.
Facts checked November 22, 2026. This article explains the mathematics; it is not investment advice.
Bitcoin has no central bank and no company in charge, yet millions of people trust its ledger. What holds it together is not a promise but mathematics: hash functions, elliptic curves and a simple infinite series. Each piece can be understood with high school algebra and a little patience.
The Three Math Ideas at a Glance
| Job | Math | What it does |
|---|---|---|
| Keep the record tamper-evident | SHA-256 hash function | Any change to a block changes its fingerprint |
| Decide who adds the next block | Proof of work (probability) | Miners race to find a rare hash |
| Prove you own your coins | Elliptic-curve digital signatures | Only the private key can sign |
| Limit the supply | Geometric series | Rewards halve, total stays under 21 million |
1. Hash Functions: Digital Fingerprints
A hash function turns any input into a fixed-length output. SHA-256 always produces 256 bits, written as 64 hexadecimal characters. Change one letter and the output changes completely:
- SHA-256(“Effortless Math”) begins
b979d2aa61cc… - SHA-256(“Effortless math”) begins
83ac132e981b…
It is easy to compute and, as far as anyone knows, practically impossible to reverse or to find two inputs with the same hash. Each Bitcoin block header contains the hash of the previous block, forming a chain. Editing an old transaction would change that block’s hash, which breaks the link to every later block. Note that Bitcoin mostly uses hashes and signatures, not encryption: transaction data is public, not hidden.
Inside a block, transactions are combined in a Merkle tree. With four transaction hashes \(H_1, H_2, H_3, H_4\): hash pairs to get \(H_{12} = \text{hash}(H_1 \| H_2)\) and \(H_{34} = \text{hash}(H_3 \| H_4)\), then the Merkle root \(= \text{hash}(H_{12} \| H_{34})\), where \(\|\) means “joined together.” The root goes in the block header, so changing any one transaction changes the root and the block’s hash. (Bitcoin applies SHA-256 twice in these steps.)
2. Proof of Work: A Lottery Built From Probability
To add a block, miners repeatedly change a number in the block (the nonce) and hash it, looking for a hash below a target value, roughly “starting with enough zeros.” Since each hexadecimal digit is one of 16 values, the chance that a random hash starts with \(k\) zero digits is
\[ P = \left(\frac{1}{16}\right)^{k}, \]so the expected number of tries is \(16^k\). Four leading zeros take about \(16^4 = 65{,}536\) tries on average; each extra zero multiplies the work by 16. Bitcoin adjusts the target every 2,016 blocks (about two weeks) so that a block is found about every 10 minutes, however much computing power joins. Because rewriting history would mean redoing all that work faster than the rest of the network, an attacker would need most of the network’s computing power.
3. Elliptic Curves: Keys and Signatures
Bitcoin’s keys use the elliptic curve secp256k1:
\[ y^2 = x^3 + 7, \]with all arithmetic done modulo the prime \(p = 2^{256} – 2^{32} – 977\). Points on the curve can be “added” by a geometric rule: draw a line through two points, find where it meets the curve a third time, and reflect. Adding a point \(G\) to itself \(k\) times gives \(kG\).
- Your private key is a secret whole number \(k\), chosen at random from about \(2^{256} \approx 1.16 \times 10^{77}\) possibilities.
- Your public key is the point \(K = kG\).
Computing \(kG\) is fast, using repeated doubling. Going backward, finding \(k\) from \(K\), is the elliptic-curve discrete logarithm problem, which no known classical method can solve at this size. Signatures (ECDSA, and Schnorr signatures since the 2021 Taproot upgrade) let you prove you know \(k\) without revealing it.
A Toy Elliptic Curve You Can Check
Use the same equation, but mod 17 instead of a huge prime: \(y^2 \equiv x^3 + 7 \pmod{17}\). Is \(G = (1, 5)\) on it? \(5^2 = 25 \equiv 8\) and \(1^3 + 7 = 8\). Yes. To double a point, the tangent slope is \(\lambda = \frac{3x^2}{2y}\), computed mod 17:
\[ \lambda = \frac{3 \cdot 1^2}{2 \cdot 5} = \frac{3}{10} \equiv 3 \times 12 = 36 \equiv 2 \pmod{17}, \]since \(10 \times 12 = 120 \equiv 1\), so 12 acts as \(\tfrac{1}{10}\). Then \(x_3 = \lambda^2 – 2x = 4 – 2 = 2\) and \(y_3 = \lambda(x – x_3) – y = 2(1 – 2) – 5 = -7 \equiv 10\). So \(2G = (2, 10)\). Check: \(10^2 = 100 \equiv 15\) and \(2^3 + 7 = 15\). This tiny curve has only 17 points plus a “point at infinity,” so its discrete logarithm is easy; the real curve has about \(10^{77}\) points. Modular arithmetic is explained further in RSA encryption explained.
A Bitcoin Transaction, Step by Step
Bitcoin does not store account balances. It tracks unspent transaction outputs (UTXOs), like individual banknotes. Suppose you own a single 0.7-bitcoin output and want to pay 0.4:
| Part | Amount |
|---|---|
| Input (the output you spend, authorized by your signature) | 0.7 |
| Output 1: to the recipient | 0.4 |
| Output 2: change back to you | 0.299 |
| Fee to the miner (input minus outputs) | \(0.7 – 0.4 – 0.299 = 0.001\) |
Every node checks the signature against your public key and checks that the input has not already been spent. Trying to spend the same output twice is caught because only one of the two transactions can end up in the chain with the most accumulated proof of work, and merchants usually wait for several confirmations (blocks on top) before trusting a payment.
4. The 21 Million Cap: A Geometric Series
New coins are created as a reward for each block. The reward started at 50 bitcoins in 2009 and halves every 210,000 blocks (about four years). The total supply is a geometric series:
\[ 210{,}000 \times 50 \times \left(1 + \tfrac{1}{2} + \tfrac{1}{4} + \cdots\right) = 10{,}500{,}000 \times 2 = 21{,}000{,}000. \]Because rewards are rounded down to whole satoshis (one hundred-millionth of a bitcoin) at each halving, the scheduled total is about 20,999,999.9769 bitcoins, slightly under 21 million, with the last new coins around the year 2140. (Some coins are also lost or unspendable, so fewer will ever circulate.) The fourth halving, in April 2024 at block 840,000, cut the reward to 3.125 bitcoins; the next is expected around 2028.
| Era | Reward per block | Coins issued in era |
|---|---|---|
| 2009–2012 | 50 | 10,500,000 |
| 2012–2016 | 25 | 5,250,000 |
| 2016–2020 | 12.5 | 2,625,000 |
| 2020–2024 | 6.25 | 1,312,500 |
| 2024–about 2028 | 3.125 | 656,250 |
Could Quantum Computers Break Bitcoin?
Hashing is fairly safe: Grover’s algorithm only gives a square-root speedup. Elliptic-curve signatures are the weak point, since Shor’s algorithm solves the elliptic-curve discrete logarithm. On March 31, 2026, a Google Quantum AI team estimated that 256-bit elliptic-curve keys could be broken with under 500,000 physical qubits under specified fault-tolerant hardware assumptions. That is a resource estimate, not a demonstrated attack, and no such machine exists yet. Moving Bitcoin to post-quantum signatures is an active debate.
Common Misconceptions
“Miners solve hard math problems.” They make enormous numbers of random guesses; the “puzzle” is luck plus computing power.
“Bitcoin is anonymous.” Every transaction is public; addresses are pseudonymous, and analysis can often link them to people.
“The 21 million limit is enforced by a company.” It is enforced by the software rules that every node checks, built on the series above.
Watch: The Math of Bitcoin
If you learn better by watching, these videos are worth your time.
Check Your Understanding
Five quick questions to see how much of this has stuck. Pick an answer and press Submit; you will see a short explanation either way.
Answer each question and press Submit to see your result right away.
Frequently Asked Questions
What math is used in Bitcoin?
Cryptographic hash functions (SHA-256), probability for proof of work, elliptic-curve cryptography on the curve y² = x³ + 7 (secp256k1) for keys and signatures, and a geometric series for the supply limit.
Why is Bitcoin limited to 21 million?
Block rewards started at 50 coins and halve every 210,000 blocks, so the total is 210,000 × 50 × (1 + 1/2 + 1/4 + …) = 21 million. Rounding to whole satoshis makes the scheduled total about 20,999,999.9769.
Does Bitcoin use encryption?
Mostly not. Bitcoin relies on hash functions and digital signatures; transaction data is public. Encryption is used only in some wallets and network connections.
What is proof of work?
Miners repeatedly hash a block with different numbers until the hash falls below a target. Each try is a random lottery ticket, and the target adjusts so a block is found about every 10 minutes.
What is secp256k1?
The elliptic curve y² = x³ + 7 over a prime field of about 2^256 elements, used for Bitcoin keys. Private keys are random numbers; public keys are points obtained by repeated point addition.
Can quantum computers break Bitcoin?
Not today. A large error-corrected quantum computer running Shor’s algorithm could forge elliptic-curve signatures; a March 2026 Google estimate put the requirement under 500,000 physical qubits. Hashing is much less vulnerable.
Keep Exploring
- RSA Encryption Explained: A Simple Step-by-Step Example
- Post-Quantum Cryptography Explained: Lattices and ML-KEM
- Shor’s Algorithm Explained: Example, RSA and Qubits
Sources and Further Reading
- Satoshi Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System (2008)
- Standards for Efficient Cryptography Group, SEC 2: Recommended Elliptic Curve Domain Parameters (secp256k1)
- NIST FIPS 180-4: Secure Hash Standard (SHA-256)
- The Quantum Insider: Three papers in three months rewriting the quantum threat timeline (Mar 31, 2026)
Related to This Article
More math articles
- Top 5 Best Math YouTube Channels for High School Students
- Time, place, and manner restrictions
- Trigonometry Basics: SOH-CAH-TOA Made Easy
- Monopsony MRC: Calculate Hiring Cost, Then Read the Wage
- Prime Number Theorem Explained: Formula and Examples
- Writing down Variable Expressions Involving Two Operations
- Sugar and Stamp Acts: Taxation, Representation and Protest
- Top 5 Graphing Calculators for Physics
- From Simple to Complex: Calculus of Surfaces
- Using a Dictionary, Thesaurus, and Glossary


What people say about "Bitcoin Math Explained: Hashes, Curves and 21 Million - Effortless Math"?
No one replied yet.