Prerequisites:
- The properties of a group
- Elliptic curve point addition
An elliptic curve is a group. Its elements are closed under point addition.
Check addition: https://www.desmos.com/calculator/ialhd71we3
The point at infinity is the identity element of the group. There is no point in the curve that can be the identity element, so we need to include a new element, with the special property that it is the identity.
When doing addition, we have two steps:
- Draw a line between P and Q. Find the third point on the curve that intersects that line.
- Reflect that point
When P or Q is the identity element, these steps become:
- Draw a vertical line through P. Find the second point on the curve that intersects that line
- Reflect that point
You can see that that these two steps cancel each other. They're the exact same operation, but rephrased differently.
Why is it called "at infinity?". There are two ways to think about this.
The short Weierstrass form of a curve:
The equivalent projective curve:
Where
The values of the projective coordinates of a curve can be mapped back to the afine coordinates:
The neutral element in the projective coordinates is
Are you confused about projective coordinates and want to find more about it? Check out this book. It's a good introduction on Elliptic Curves: https://books.google.ch/books?id=mAJei2-JcE4C.
Check out this desmos graph: https://www.desmos.com/calculator/ialhd71we3
Let's say you have two points and you plot the result of their addition. Also, assume that those two points are on the same sign side of the y axis.
If you move the second point further away, you'll observe that the result of the addition gets closer to the first point. Without any mathematical rigurosity, we can say that:
As
Openssl:
- Secp256k1 parameters: https://github.com/openssl/openssl/blob/70e71ac2ae18c719adae2875bc3d5b5353ca7bb8/crypto/ec/ec_curve.c#L644C1-L674C3
- Creating an Elliptic Curve point: https://github.com/openssl/openssl/blob/70e71ac2ae18c719adae2875bc3d5b5353ca7bb8/crypto/ec/ecp_smpl.c#L322C1-L336C2
- Setting a point to infinity: https://github.com/openssl/openssl/blob/70e71ac2ae18c719adae2875bc3d5b5353ca7bb8/crypto/ec/ecp_smpl.c#L367C1-L373C2
Bitcoin's secp256k1: