{
  "schema_version": 1,
  "title": "Elliptic-curve points and addition",
  "url": "/writing/understanding-elliptic-curves/lessons/0002-elliptic-curve-point-addition.html",
  "author": "Abhineet Biju",
  "text": "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. Secret-sized scalar 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. Why does an elliptic curve over a finite field look like dots? Why is point addition not coordinate-wise addition? What does kG mean? Why can a public key be shared while its private scalar must stay secret? Why does off-curve imply that a Solana PDA has no Ed25519 private key? Show numbered solutions 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. 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. 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. 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. 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 RFC 8032, sections 3 and 5.1 specifies EdDSA parameters, modular arithmetic, point addition, keys, signing, and verification. SEC 1, sections 2.2 and 2.3 defines elliptic curves over finite fields and the group operation. Solana's PDA documentation ties off-curve addresses to the absence of private keys.",
  "headings": [
    {
      "level": 1,
      "id": null,
      "text": "Elliptic-curve points and addition"
    },
    {
      "level": 2,
      "id": null,
      "text": "Finite-field curves contain discrete points"
    },
    {
      "level": 2,
      "id": null,
      "text": "How elliptic-curve point addition works"
    },
    {
      "level": 2,
      "id": null,
      "text": "Calculate 2G step by step"
    },
    {
      "level": 3,
      "id": null,
      "text": "Quick check 1"
    },
    {
      "level": 2,
      "id": null,
      "text": "Scalar multiplication as repeated addition"
    },
    {
      "level": 2,
      "id": null,
      "text": "Private scalars and public points"
    },
    {
      "level": 3,
      "id": null,
      "text": "Quick check 2"
    },
    {
      "level": 2,
      "id": null,
      "text": "Check your understanding"
    },
    {
      "level": 3,
      "id": null,
      "text": "Primary reading"
    }
  ],
  "sections": [
    {
      "id": "dots",
      "heading": "Finite-field curves contain discrete points",
      "text": "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."
    },
    {
      "id": "group",
      "heading": "How elliptic-curve point addition works",
      "text": "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 𝒪."
    },
    {
      "id": "double",
      "heading": "Calculate 2G step by step",
      "text": "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?"
    },
    {
      "id": "walk",
      "heading": "Scalar multiplication as repeated addition",
      "text": "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. Secret-sized scalar 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."
    },
    {
      "id": "solana",
      "heading": "Private scalars and public points",
      "text": "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?"
    },
    {
      "id": "close",
      "heading": "Check your understanding",
      "text": "Check your understanding Try to answer each question before you open the solutions. Why does an elliptic curve over a finite field look like dots? Why is point addition not coordinate-wise addition? What does kG mean? Why can a public key be shared while its private scalar must stay secret? Why does off-curve imply that a Solana PDA has no Ed25519 private key? Show numbered solutions 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. 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. 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. 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. 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 RFC 8032, sections 3 and 5.1 specifies EdDSA parameters, modular arithmetic, point addition, keys, signing, and verification. SEC 1, sections 2.2 and 2.3 defines elliptic curves over finite fields and the group operation. Solana's PDA documentation ties off-curve addresses to the absence of private keys."
    }
  ],
  "links": [
    {
      "label": "writing",
      "url": "/#writing"
    },
    {
      "label": "Chapter I",
      "url": "/writing/understanding-elliptic-curves/lessons/0001-modular-arithmetic-and-finite-fields.html"
    },
    {
      "label": "Glossary",
      "url": "/writing/understanding-elliptic-curves/reference/0001-cryptography-glossary.html"
    },
    {
      "label": "group",
      "url": "/writing/understanding-elliptic-curves/reference/0001-cryptography-glossary.html"
    },
    {
      "label": "RFC 8032, sections 3 and 5.1",
      "url": "https://www.rfc-editor.org/info/rfc8032/"
    },
    {
      "label": "SEC 1, sections 2.2 and 2.3",
      "url": "https://www.secg.org/sec1-v2.pdf"
    },
    {
      "label": "Solana's PDA documentation",
      "url": "https://solana.com/docs/core/pda"
    },
    {
      "label": "Previous: Modular arithmetic and finite fields",
      "url": "/writing/understanding-elliptic-curves/lessons/0001-modular-arithmetic-and-finite-fields.html"
    },
    {
      "label": "Next: Deriving the point-doubling formulas",
      "url": "/writing/understanding-elliptic-curves/lessons/0003-point-doubling-derivation.html"
    }
  ]
}
