Study materials · photonresources.comClasses with our teachers · Photon AcademyFor IB Diploma students worldwide

Maths IA · Algebra and functions · topic 8 of 97

Bitcoin's 21 million cap: a geometric series in code · IB Maths IA idea: guide, sample graph and step-by-step plan

endless halving, finite total

Every four years or so, the reward for adding a block to Bitcoin's chain is cut in half. That sounds like it should never end, yet the total can never pass 21 million. Your job is to explain why an endless process has a finite total.

Difficulty●●○ Medium
KitA spreadsheet or short program, the published rules of the protocol, your GDC
TimeAbout 12 to 15 hours
FitsAA SL3 of 3AA HL3 of 3AI SL2 of 3AI HL3 of 3
  • ✓ you have heard the number 21 million and want to know where it comes from
  • ✓ you like a sum you can check both by formula and by code
  • ✓ you want to explain a piece of crypto without promoting it

The big idea

The protocol pays a reward for each block: 50 coins at first, halved after every 210,000 blocks. The coins issued in each stretch form a geometric sequence, so the total is a geometric series with a limit. Write it, sum it and get the famous 21 million. Then look closer. The software counts in whole units of 0.00000001 coin and rounds down at each halving, so the true total is slightly below 21 million. From the same schedule you can find the issuance per year, the annual inflation rate, and the date by which 99% of coins exist. The marks come from checking the formula against an exact count and from saying what the model leaves out, such as block times that are not exactly ten minutes.

Make it yours: pick one twist

Copying a classic won't show your choices. Pick one of these (or invent your own) and your IA becomes yours.

Swipe for more twists →

Sum the series two ways

Find the total with the infinite geometric formula, then with a loop that rounds the reward down to whole units.

→ You get an ideal total and an exact one. The gap between them is a small, precise number that you must explain.
When is 99% mined?

Solve for the number of halvings after which a chosen share of the final supply exists.

→ An exponential inequality solved with logarithms. Then turn halvings into calendar years and say how reliable that conversion is.
Annual inflation rate

Divide each year's new coins by the coins already existing, and plot it against time.

→ A ratio that falls in steps. Use a log scale to see that it falls faster than the reward does.
Change the rule

Halve every 100,000 blocks, or cut the reward by 25% each time, and find the new limit.

→ The common ratio and the block interval change, so you test whether the limit depends on the ratio only or on both.
Block times that wander

Compare the ten-minute model with real halving dates from a public block explorer.

→ The model meets data. Measure the error in years and explain what causes it.
Smooth or staircase?

Approximate the staircase of rewards with an exponential function of time and test the fit.

→ A continuous model for a discrete rule. Discuss what you gain, and where the approximation is poor.

Your Maths IA research question: run the check

which rule? which number?

Write your own question first. Then make sure it ticks every box:

  • Names the rule you model: the starting reward, the halving interval and the unit of account.
  • Names the quantity you find: the total supply, a date, or an inflation rate.
  • Says what the formula is tested against: an exact count in code or published block data.
  • Goes beyond quoting 21 million: there is a series to sum and a gap or an error to explain.
  • States what you leave out: lost coins, fees, block-time variation and any future change to the rules.
Stuck on your question?Get an RQ Check: each question is scored on 5 points, with what to fix. Your first one is free.
Get an RQ Check

The model

One reward per block, halved after each fixed stretch of blocks. Each bar is one stretch. Draw the bars for your own rule and label the areas.

502512.56.253.131.560.78reward per block (coins), one bar for each 210,000 blocks (about 4 years)each bar is half the one beforewidth × height = coinsissued in that stretchadd them all up:how many coins in total?

How your Maths IA could be laid out

The usual order for a topic like this, what each part needs to show, and roughly how much of your 12 to 20 pages it takes. The words are all yours.

Aim and context~1 page
What the protocol rule is, where you found it, and what you predict the total will be before summing.
The reward as a sequence~1.5 pages
Every symbol defined. The coins issued in each stretch of blocks as a geometric sequence, with its first term and common ratio.
The limit~2 pages
The infinite series summed, then the exact total from code with rounding, and the gap between them.
Supply against time~2 pages
Cumulative supply by year, and the number of halvings needed to reach a chosen percentage.
Annual inflation~2 pages
The inflation rate as a function of time, its graph on a log scale and what it says about the long run.
Model against block data~1.5 pages
Your schedule beside real halving dates. A number for the error and a reason for it.
Conclusion~1 page
Back to your aim: the limit, the gap, the dates and the rate, with numbers.
Evaluation~2 pages, the biggest part!
Lost coins, changing block times, fees and rule changes. Say which assumption matters most and what the model cannot tell you.
Bibliographynot counted
Where every rule, date and figure came from.

What your Maths IA graph could look like

mark the limit!

Made-up values to show the form of a strong graph, not the answer: coins in existence against years since the first block, with the limit marked. Yours will use your own rule. example only

0510152025303540048121620Years since the first blockCoins in existence / millionsmodel: L(1 − 0.5^(x/4))your exact schedule (made-up)limit: 21 million.How close at year 28?ILLUSTRATIVE · MADE-UP DATA
  • The model curve and your exact values on one set of axes, so the match or the gap is visible.
  • Axis labels give units: years, and coins in millions.
  • Draw the limit as a dashed line and say what it is.
  • A smooth curve is an approximation. The real schedule is a staircase of straight sections.
  • Another graph to consider: annual inflation rate on a log scale.

The maths in action

worked through, not sketched!

The graph above was a sketch with made-up numbers. This figure works the idea through from the model itself, so you can see what a finished figure looks like. The source line under it says where every number comes from.

Two panels. Left: a rising curve that flattens towards 21 million coins, with red dots at the four halvings so far. Right: a staircase falling to the right on a log axis, the yearly inflation rate dropping at each halving.
(a) Coins in existence from the halving schedule, anchored to the real halving dates; 99% is reached at the 7th halving (about 2036). (b) Annual inflation rate on a log scale: about 0.83% a year just after the 2024 halving.Source: Computed from the protocol rule (whole units); real halving dates 28 Nov 2012, 9 Jul 2016, 11 May 2020, 20 Apr 2024; later epochs at 10 minutes per block.

How fast does the supply fill up?

After each halving, what share of the final total has been issued? Compute it for your own rule and explain the pattern in the gaps.

after halving 150%after halving 275%after halving 387.5%after halving 493.8%after halving 596.9%after halving 698.4%after halving 799.2%the first stretch alone gives half of all coinsShare of the final supply issued, %ILLUSTRATIVE · MADE-UP NUMBERS

Your game plan

Tick steps off as you go. We'll remember on this device.

0 of 10 done

  1. Read and predictRead the rule in the original paper and in the protocol documentation. Before any sums, guess whether the total is finite and roughly how big.
  2. Define the sequenceWrite the coins issued in each stretch of blocks. State the first term, the common ratio and why it is geometric.
  3. Sum the seriesUse the infinite sum formula for the ideal total. State the condition on the ratio that makes the series converge.
  4. Trial run (1 lesson)Code a loop that adds up the first ten stretches and compare it with your formula. Fix any mismatch now: off-by-one errors, units, rounding.
  5. Count in whole unitsRound each reward down to the smallest unit, sum exactly and find the gap from 21 million. Explain where it comes from.
  6. Find the datesSolve for the halving after which 99% of coins exist. Convert blocks to years and compare with the real halving dates.
  7. Inflation rateCompute new coins per year divided by coins existing, and graph it with a log axis. Describe the shape in words.
  8. Go further, with a reasonChange the rule (a different ratio or interval) or fit a smooth curve to the staircase. HL: prove your limit claims rather than only checking them.
  9. Reflect as you goAfter every result, write one line on what it means and what it assumes. These lines become your evaluation.
  10. Cut, check, then sendCheck every graph has labelled axes with units, every symbol is defined once and the conclusion answers your aim. Then send your teacher one draft.

The maths you'll use

  • Geometric sequence – Write the coins issued in stretch as and identify the first term and common ratio.
  • Infinite geometric series – Sum the series to get and state the condition for convergence.
  • Exponential inequality and logarithms – Solve for the number of halvings .
  • Rounding and exactness – Round each reward down to a whole unit, sum exactly in code and bound the gap from the ideal limit.
  • Rates on a log scale – Compute annual issuance divided by supply and plot it on a logarithmic axis to see the steps.

Key equations

Syllabus links

  • 1.3Geometric sequences and series
  • 1.5Exponents and an introduction to logarithms
  • 1.7Rational exponents and laws of logarithms
  • 1.8Infinite geometric series
  • 2.9Exponential and logarithmic functions

Read up first

Data and sources to start from

The protocol rule from the original paper and documentation, plus real halving dates and block heights from a public block explorer, compared with the model.

References to cite

  1. Nakamoto, S. (2008). Bitcoin: A peer-to-peer electronic cash system.
  2. Antonopoulos, A. M. (2017). Mastering Bitcoin: Programming the open blockchain (2nd ed.). O'Reilly Media.

Cite what you actually use, in your own format, and say where each number came from.

Traps to avoid in this Maths IA

state why it converges
  • Saying the series 'adds up to 21 million' without stating the first term, the ratio and why the sum converges.
  • Mixing up the number of blocks in a stretch with the number of years it takes.
  • Treating ten minutes per block as exact. Real halving dates drift from it, and you should measure by how much.
  • Ignoring the whole-unit rounding and then being unable to explain why a code total is slightly below 21 million.
  • Plotting the inflation rate on a linear axis, where everything after the first few years is a flat line.
  • Writing as if the aim is to judge whether Bitcoin is a good investment. The task is the mathematics of the rule.

More Maths IA ideas like this

Make sure it's yours

This guide shows how a topic like this is usually approached. It is not an IA. Your question, choices, data, analysis and words must be your own: change something, tell your teacher where the idea came from, and follow your school's rules on outside help.

Get your RQ checked · first one free