Tool · Keys & addresses
Toy elliptic curve
Add points and multiply on a curve small enough to draw
What it does
The dots are every point on y² = x³ + 7 where x and y are whole numbers from 0 to p − 1, counting “mod p”. Click two points to add them, or switch to Multiply k·G and step through G, 2G, 3G… Try mod 43 or mod 97 for a bigger grid.
How to read it
- Adding P + Q: draw the line through P and Q. On a grid mod p the line wraps around the edges (the shaded cells). It meets exactly one more curve point; flip that point across the middle line to get P + Q.
- Doubling: pick the same point twice. The line becomes the tangent at P.
- If the line is vertical, the sum is O, the point at infinity, which acts like zero.
- Multiplying: k·G means adding G to itself k times. The walk jumps around the grid with no visible pattern. Computing k·G is quick; finding k from the result has no known fast method. That one-way street is what protects a private key.
Pearl specifics
Pearl’s keys use secp256k1: the same equation, y² = x³ + 7, over a prime of about 2²⁵⁶, with about 1.16 × 10⁷⁷ points. A private key is k; the public key is k·G. Nothing here is drawn from that real curve: this is a toy.
Under the hood
Runs entirely in your browser. Point addition, doubling, multiplication and the point counts come from
toyCurve and makeToyCurve in src/lib/keys.ts; a unit test checks the mod-17 curve’s points and group
structure. The tool only draws what the library computes.