Chapter II · elliptic-curve points

Elliptic-curve points and addition

Objective
compute 2G
Solana
public keys
Requires
finite fields

We can build an elliptic-curve public key by repeatedly adding points on a finite-field curve.

Finite-field curves contain discrete points

If you draw an elliptic curve over real numbers, you see a smooth line. Over a finite field, you get a finite set of coordinate pairs that satisfy the same equation.

y² ≡ x³ + 2x + 2 (mod 17)Our complete toy curve. Both coordinates must be values from 0 through 16.

The coordinates are field elements, not ordinary whole numbers. We display them as integers from 0 through 16 because those are convenient representatives of the elements modulo 17.

Let's test G = (5, 1). It is on the curve because both sides of the equation reduce to 1 modulo 17.

Left side: 1² ≡ 1 (mod 17)

Right side: 5³ + 2·5 + 2 = 137

Reduce: 137 ≡ 1 (mod 17)

A coordinate pair either satisfies the curve equation or it does not. This is the basis of Solana's on-curve and off-curve distinction.

How elliptic-curve point addition works

When we write P + Q, we do not mean (x₁ + x₂, y₁ + y₂). We apply the curve's point-addition rule instead.

The valid points and a special identity point 𝒪 form a group:

ClosureAdd valid points and the result is another valid point or 𝒪.
IdentityP + 𝒪 = P. The special point changes nothing.
Inverse(x,y) + (x,−y) = 𝒪, with the negation computed modulo p.
Associativity(P + Q) + R = P + (Q + R).
Closure means that adding valid points produces another valid point or 𝒪.

Calculate 2G step by step

To compute G + G, first calculate a slope λ. Every operation wraps modulo 17, including division. Dividing by 2 means multiplying by the modular inverse of 2, which is 9.

λ = (3x² + a) / 2y

λ = (3·5² + 2) / (2·1) = 77 / 2

λ ≡ 9 · 9 ≡ 13 (mod 17)

x₃ = λ² − 2x ≡ 13² − 10 ≡ 6

y₃ = λ(x − x₃) − y ≡ 13(5 − 6) − 1 ≡ 3

2G = G + G = (6, 3)The result also satisfies the curve equation. Closure worked.

Quick check 1

On our toy curve, which point equals 2G?

Scalar multiplication as repeated addition

Move the scalar k and watch the highlighted point change. That point is kG, which means we added G to itself k times. It does not mean multiplying the coordinates of G by k.

    At 19G, you reach 𝒪, the identity point. Another step would return to G. Our toy subgroup therefore has order 19.

    Computing Q=kG from k is fast. Recovering k from G and Q is the elliptic-curve discrete logarithm problem.

    Private scalars and public points

    You can model an elliptic-curve private key as a secret scalar k. Its public key is the point Q = kG. Ed25519 adds hashing, clamping, encoding, and subgroup rules, but Q=kG is the core relationship.

    secret scalar k → scalar multiplication → public point QFast forward. Believed hard to reverse on a classical computer when parameters and implementation are sound.

    Solana transaction signers use Ed25519 keys. PDAs are off-curve and have no matching secret scalar. Programs authorize PDAs through runtime-checked derivation.

    Quick check 2

    Which operation captures the private-to-public direction?

    Check your understanding

    Try to answer each question before you open the solutions.

    1. Why does an elliptic curve over a finite field look like dots?
    2. Why is point addition not coordinate-wise addition?
    3. What does kG mean?
    4. Why can a public key be shared while its private scalar must stay secret?
    5. Why does off-curve imply that a Solana PDA has no Ed25519 private key?
    Show numbered solutions
    1. The field has finitely many x-values and y-values. Testing each pair against the curve equation leaves a finite set of points rather than a continuous line.

    2. Point addition draws a line through two points, finds the third curve intersection, and reflects it. The algebra reproduces this construction over a finite field. Coordinate-wise addition does not generally stay on the curve.

    3. kG means adding G to itself k times with the curve's addition law. The scalar k is a number; G and kG are points. This is not ordinary coordinate multiplication.

    4. Computing Q=kG from k is efficient. Recovering k from G and Q is infeasible with current classical methods and production parameters. Anyone who learns k can sign as its owner.

    5. A PDA does not decode as an Ed25519 curve point. No scalar k can produce it as Q=kG, so it has no matching private key. The runtime checks PDA seeds instead.

    Primary reading