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

Maths IA · Algebra and functions · topic 14 of 97

Elliptic curves: the maths inside a crypto wallet · IB Maths IA idea: guide, sample graph and step-by-step plan

chord, third point, flip

Take two points on a curve, draw a line, find where it hits the curve again and flip it. That strange recipe is a way to add points, and it is the basis of the keys in many crypto wallets. You will check why the recipe never leaves the curve.

Difficulty●●● Stretch
KitGraph paper or graphing software, a short program, your GDC
TimeAbout 15 to 18 hours
FitsAA SL2 of 3AA HL3 of 3AI SL1 of 3AI HL2 of 3
  • ✓ you enjoy geometry that turns into algebra
  • ✓ you like a rule that looks odd until you see why it works
  • ✓ you want to know what a private key and a public key really are, mathematically

The big idea

On a curve such as y² = x³ + 7, a line through two points meets the curve at a third point. Reflect that point in the x-axis and you have defined an addition. Find the sum with algebra: the gradient of the chord, or the tangent gradient 3x²/(2y) found by implicit differentiation, then substitute into the curve and use the sum of the roots of a cubic. The result is a formula that uses only addition, multiplication and division, so it also works with remainders modulo a prime. There you can add a point to itself k times quickly, but undoing that, finding k from the result, has no known quick method on classical computers. Parts of this are beyond the IB courses: the finite field and the group structure need careful, honest explanation. Decide what you prove and what you quote.

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 →

Derive the addition formula

Find the chord gradient, substitute into y² = x³ + 7 and use the sum of the roots to get the third point.

→ A proof that the sum is again on the curve, with the algebra shown line by line. Treat the case where the two points are equal separately.
Tangent by implicit differentiation

Differentiate both sides of y² = x³ + 7 to get the tangent gradient, and use it to double a point.

→ Calculus enters the geometry. Check the doubling formula against a numerical value for a chosen point.
Work modulo a prime

Repeat the addition over the integers mod p for a small prime, listing every point on the curve.

→ The picture turns into a scatter of dots, but the algebra still works. Count the points and compare with the expected size.
Multiply a point by k

Compute kG by repeated doubling and adding, and count the operations compared with k − 1 additions.

→ Fast computation of a hard-to-reverse map. Show with logarithms why a 256-bit k needs only a few hundred steps.
Try to reverse it

Given G and kG on a small curve, find k by searching, and record how the work grows with the number of points.

→ You measure the hardness yourself. Explain why a small curve is useless and what changes at real sizes.
Change the curve

Replace the 7 by another constant, or compare with y² = x³ − 2x + 1, and ask which properties survive.

→ Tests whether your argument depends on the constant. Check which curves give a smooth, well-behaved addition.

Your Maths IA research question: run the check

reals or mod p?

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

  • Names the curve and the field you work over: the real numbers, or the integers mod a stated prime.
  • Names what you prove or compute: the addition formula, the number of points or the cost of multiplying.
  • Says what is checked numerically and what is proved algebraically.
  • Is clear about which facts, such as associativity of the addition, you quote rather than prove.
  • States what you leave out: real key sizes, the choice of the generator and attacks that do not use brute force.
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

A curve, a chord and a reflection. Draw the construction for two points of your own on your own curve, and mark the third point before you reflect it.

PQRP + Qy² = x³ + 71. draw the chord2. find the third point3. reflect itif P = Q, use the tangent:slope 3x² / 2y

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 a public key is for, and which part of the maths you will explain or test.
The curve and the chord rule~1.5 pages
The curve, the chord construction and the reflection. A hand-drawn or plotted example with exact coordinates.
Deriving the formulas~3 pages
Chord gradient, substitution, sum of roots, and the tangent case by implicit differentiation. Every step shown.
Working modulo a prime~2 pages
The same formulas with remainders, a complete list of points for a small prime and a count checked against a bound.
Multiplying and reversing~2 pages
Double and add, the operation counts, and your measurement of how hard it is to find k by searching.
Conclusion~1 page
Back to your aim: what you proved, what you computed and what the two together say about keys.
Evaluation~2 pages, the biggest part!
What you quoted without proof, how small your examples are compared with real keys, and what would change for a real system. Say which limitation matters most.
Bibliographynot counted
Where every theorem and parameter came from.

What your Maths IA graph could look like

average several runs

Made-up values to show the form of a strong graph, not the answer: the work to find k by searching against the number of points on the curve, with a model. Yours will use your own searches. example only

020040060080010000100200300400500600Number of points on the curveSteps to find kmodel: c × (number of points)your searches (made-up)average of half thepoints, as predictedILLUSTRATIVE · MADE-UP DATA
  • Measured work and model on one set of axes.
  • Axis labels give units: a count of points and a count of steps.
  • Repeat each search several times and plot the average, not a single run.
  • Say how the points were found: exhaustive search, or a method you coded.
  • Another graph to consider: steps for double-and-add against the number of binary digits of k.

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.

Left: the real curve with a dashed line through two blue points, its third intersection and the reflected red point P plus Q. Right: a scatter of 78 dots in a 97 by 97 grid, six of them in red labelled 1G to 6G.
(a) On y² = x³ + 7, the chord through P = (−1.5, 1.90) and Q = (3.0, −5.83) meets the curve again at R; reflecting R gives P + Q. (b) The curve mod 97 has 79 points counting infinity; G = (1, 28) generates all of them.Source: Computed here: the addition formulas on the real curve; every point of the curve mod 97 found by exhaustive search.

How many points does a curve have?

Count the points on y² = x³ + 7 over the integers mod p, including the point at infinity. Compare each with p + 1 and with the bound that guarantees the count is close to it.

p = 137p = 3121p = 6161p = 9779p = 151133p = 211199p = 271243the count follows p, but not exactlyPoints on the curve mod p (including infinity)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 an introduction to elliptic curves and plot y² = x³ + 7. Before any algebra, predict where the line through two points meets the curve.
  2. Draw the chord ruleChoose two points, draw the chord, read off the third point and reflect it. Write the coordinates as accurately as you can.
  3. Derive the formulaWrite the chord gradient, substitute into the curve and use the sum of the roots of the cubic to find the third x-coordinate.
  4. Trial run (1 lesson)Add two points with your formula and check them against your drawing, and check that the result lies on the curve. Fix any mismatch now: the sign of y, the order of the points.
  5. Double a pointFind the tangent gradient by implicit differentiation and derive the doubling formula. Check it numerically.
  6. Go modularRepeat with arithmetic mod a small prime. List all the points and look for the pattern when you add a point to itself again and again.
  7. Multiply and reverseWrite double-and-add, count its operations, then search for k from kG on a small curve and record how the work grows.
  8. Go further, with a reasonProve one property yourself, such as the sum being on the curve in every case, or compare two curves. HL: justify each case, including the point at infinity.
  9. Reflect as you goAfter every result, write one line on what it means and what you took on trust. These lines become your evaluation.
  10. Cut, check, then sendCheck every symbol is defined once, each claim is proved or sourced and the conclusion answers your aim. Then send your teacher one draft.

The maths you'll use

  • Implicit differentiation – Differentiate to get the tangent gradient and use it for doubling a point.
  • Coordinate geometry and polynomials – Substitute the chord into the curve and use the sum of the roots of the cubic to find the third intersection.
  • Proof by cases – Show the sum is on the curve, treating , and vertical lines separately.
  • Modular arithmetic – Run the same formulas mod a prime , using modular inverses in place of division, and list all the points.
  • Counting operations and logarithms – Compare double-and-add, about doublings, with repeated additions, and measure a brute-force search for .

Key equations

Syllabus links

  • 2.1Straight lines
  • 2.3Graphs of functions
  • 2.12Polynomials, factor and remainder theoremsHL
  • 5.4Tangents and normals
  • 5.14Implicit differentiation, related rates, optimisationHL

Read up first

Data and sources to start from

Point counts and search times from a program you write for small primes, plus the published parameters of the curve used by Bitcoin.

References to cite

  1. Koblitz, N. (1987). Elliptic curve cryptosystems. Mathematics of Computation, 48(177), 203-209.
  2. Miller, V. S. (1986). Use of elliptic curves in cryptography. In Advances in Cryptology: CRYPTO '85 (pp. 417-426). Springer.
  3. Silverman, J. H., & Tate, J. (2015). Rational points on elliptic curves (2nd ed.). Springer.

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

Traps to avoid in this Maths IA

equal points need the tangent
  • Adding the y-coordinates and x-coordinates of two points directly. The rule is the chord, the third point and the reflection.
  • Forgetting the vertical line case, where two points have the same x and opposite y. Their sum is the point at infinity.
  • Using the chord formula when the two points are the same. That needs the tangent.
  • Dividing by zero modulo p without noticing. Division is multiplication by an inverse, and some values have none.
  • Claiming the associative law from a few numerical checks. Say it is quoted, or prove it.
  • Treating a small curve as if it showed real security. Real curves have about 2^256 points.

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