Elliptic curve → torus: tutorials
Tutorials for Elliptic curve → torus, the single-file, offline visualizer of elliptic curves over finite fields by Idle (idlebg.com). They show how to use it properly and what it can show, with many worked examples, for every level: from no maths at all to Bitcoin keys and research on elliptic curves.
The visualizer draws the points of y² = x³ + ax + b over F_p on a donut (a torus) and on eight other shapes, with the group law, negation as a mirror, the GLV endomorphism of Bitcoin’s curve, a flat map, orders and discrete logs on toy curves, and every way of writing a public key.
Start reading: 11 Start here, or pick a path below. All examples lists every example with a picture.
The visualizer
Every example opens the visualizer, elliptic_curve_torus_visualizer_v3.html: version 3.2.2, the released build,
SHA-256 57b068d91e8c227af4066da6425144163eff10a671ef9f3852e3b1fb32663370. It is one HTML file that runs from disk in
any current browser, with no network and no install. It comes from https://github.com/idlebg/EllipticTorus3d (source,
MIT licence) and https://idlebg.com/idleGevrek/ (a gallery).
Every example has a screenshot, an Open this view link that opens the visualizer in exactly that state in a new tab, the steps to build it by hand, what to look at, and why it looks that way. Opening an example replaces the view the visualizer remembered; 11 Start here explains how to keep your own.
Where to start
| if you want to | read |
|---|---|
| just see what it does | 11 to 16: Start here, dots, donut, distance, mirror, shapes |
| understand how Bitcoin keys work | 11, 13 to 15, then 31 to 36: secp256k1, private to public, formats, parity, GLV, invalid points |
| teach this | Level 1 and Level 2, then 96 For teachers |
| research elliptic curves | 28 and 29, then 41 to 49, from The mapping |
The four levels:
| level | for | assumes |
|---|---|---|
| 1 Explorer | anyone curious | a browser and a mouse |
| 2 Learner | students, teachers, developers new to elliptic curves | school algebra; clock arithmetic is taught here |
| 3 Bitcoiner | Bitcoin users and developers | has heard of keys and addresses |
| 4 Researcher | mathematicians, cryptographers | groups and finite fields |
Contents
Level 1 · Explorer
- 11 Start here: the screen, the mouse and keys, opening the examples
- 12 A curve is a cloud of dots: every point of a small curve, cards, the Inspector
- 13 Why a donut: numbers that wrap around, the flat map, guide rings
- 14 Two points: how far apart?: “02 and 03” read three ways
- 15 Mirror images: 02 and 03: every point and its mirror image, on every shape
- 16 One set of points, nine shapes: the same points on all nine shapes
- 17 Save, share, export: links, PNG, JSON, what is remembered
- 18 Make it look right: theme, sizes, glass, grid, labels
Level 2 · Learner
- 21 Clock arithmetic and the curve equation
- 22 Counting points
- 23 Negation
- 24 Adding points: the chord
- 25 Doubling: the tangent
- 26 Subtraction
- 27 Walking the multiples
- 28 Orders and subgroups
- 29 Discrete logs on toy curves
Level 3 · Bitcoiner
- 31 secp256k1 in the panel
- 32 Private key → public key
- 33 Key formats
- 34 Parity, 02/03 and Taproot
- 35 The GLV endomorphism
- 36 Invalid points
- 37 Where points appear in Bitcoin
- 39 P-256 next to secp256k1
Level 4 · Researcher
- 41 The mapping
- 42 Group structure
- 43 j = 0 and its automorphisms
- 44 Quadratic twists
- 45 Invalid-curve attacks
- 46 Singular curves and composite moduli
- 47 Shapes as topology
- 48 Scripting with ecTorus
- 49 Trusting the numbers
Reference
- 91 Cookbook: one-line recipes
- 92 Exercises and 93 Answers
- 94 Glossary
- 95 FAQ and troubleshooting
- 96 For teachers
How the numbers are checked
Every number, point, key, order or count in these tutorials is computed, never typed from memory, and checked twice:
- The live visualizer must show it. Each example is built by a script that opens the tutorials’ copy of the visualizer, sets the state the way a person would, and checks the claims of the text against what the page computes and shows (its model and the text of its panel) before it takes the screenshot.
- An independent computation must agree. Toy curves are checked by brute force, written separately from the visualizer; Bitcoin’s curve secp256k1 by the idleCore library and by OpenSSL; P-256 by OpenSSL.
49 Trusting the numbers shows how to redo any claim yourself.