Magic Internet Math Academy

Elliptic Curve Cryptography

The mathematics that secure every Bitcoin transaction — from clock arithmetic to MuSig2.

📄 107 pages 📐 12 chapters ✏️ Exercises & solutions 🆓 Free PDF
⬇ Download Study Guide

PDF · 1.7 MB · No signup required

What's Inside

This guide walks you through the complete mathematical stack that makes Bitcoin's elliptic curve cryptography work. No hand-waving. No "trust me, it's secure." Every claim is proved or derived.

You'll start with modular arithmetic — the "clock math" that underpins everything — and build up through finite fields, group theory, and the discrete logarithm problem to reach the actual curve: secp256k1.

Then you'll see how those foundations produce ECDSA (the original Bitcoin signature scheme), Schnorr signatures (the Taproot upgrade), and MuSig2 (multi-party signing). Every verification equation is derived, not just stated.

Each chapter includes exercises with full solutions so you can verify your understanding.

Table of Contents

Prologue

▼
Why Does a Random Number Secure Billions?
How to Read This Study Guide

Part I · The Language of Remainders

▼
Ch 1 · Clock Arithmetic
Division Algorithm · Congruence · Integers mod n · Working mod a prime · Subtraction & negation
Ch 2 · The Inverse Problem
Multiplicative inverses · Euclidean Algorithm · Extended Euclidean Algorithm · Fermat's Little Theorem · Square-and-multiply
Ch 3 · The Finite World
What is a field? · ℤₚ is a field · secp256k1's field prime · Why 256 bits? · Arithmetic in the field

Part II · The Structure Beneath

▼
Ch 4 · Groups — The Algebra of Symmetry
Group axioms · Order of groups & elements · Cyclic groups & generators · Lagrange's Theorem · Additive vs. multiplicative notation
Ch 5 · The Discrete Logarithm Problem
Brute force · Baby-step giant-step · Pollard's rho · Why the ECDLP is harder

Part III · The Curve

▼
Ch 6 · Elliptic Curves Over the Reals
Weierstrass equation · Point at infinity · Geometric addition · Point doubling · Algebraic formulas · Why it forms a group
Ch 7 · Elliptic Curves Over Finite Fields
Curve equation mod p · Quadratic residues · Hasse's Theorem · Scatter plot visualization
Ch 8 · secp256k1 — The Six Parameters
Decoding the name · The six parameters · The "nothing up my sleeve" controversy
Ch 9 · Key Generation and the ECDLP
Generating a private key · Scalar multiplication · Double-and-add · Public key encoding & compression · Address derivation

Part IV · Signatures

▼
Ch 10 · ECDSA — The Original Bitcoin Signature
Signing algorithm · Verification algorithm · Why verification works · The nonce catastrophe · RFC 6979 · Signature malleability
Ch 11 · Schnorr Signatures — The Upgrade
Signing & verification · Why verification works · ECDSA vs. Schnorr · Batch verification · BIP 340
Ch 12 · MuSig2 — Many Keys, One Signature
Signature aggregation · Rogue key attack · MuSig key aggregation · The round problem · MuSig2 protocol · Security properties
✏️ 12 exercise sets with full solutions 📖 Epilogue: What Satoshi Built

Companion Podcast Episodes

3

Magic Internet Math — Episode 3

From Why to How: Understanding Elliptic Curves (Part 1) · ~1h 55m

4

Magic Internet Math — Episode 4

From Why to How: Understanding Elliptic Curves (Part 2) · 92 min

▶

YouTube Playlist

Watch the full ECC series on YouTube

About the Author

Brian Hirschfield is the author of Bitcoin for Institutions (Konsensus Network, 2025) and the creator of Magic Internet Math Academy — 96 courses and 5,000+ interactive sections teaching the mathematics behind Bitcoin.

CFA · ASA · FRM · CQF

This guide is one piece of a much larger curriculum.

Explore Magic Internet Math Academy →