2021-06-09

Elliptic curve algebra explained in high school maths

 

I have no formal Computer Science background. Most of my computer knowledge are acquired after graduation. Especially about encryption stuff, this is based on self learning and most level is just up to RSA standard. Recently having some interest on the underlying technologies of Bitcoin, I want to study about Elliptic curve (y2 = x3 + ax + b) because it is used for encryption. However, after viewing some YouTube videos, I still cannot have a better understanding the geometry about it. Some of them are even wrong. The following diagrams are from Wikipedia (red line) and the blue line will define a “binary” operation P+Q = -R



The Youtuber simply stated the following formulae to derive R…

If P = (x1, y1), Q = (x2, y2), R = (x3, y3)

Not satisfied with result, I try to solve the problem (simultaneous equations in two unknowns) using my high school level maths level.

Putting (2) into (1)


which is a simple polynomial of level 3.

High school level maths shows the sum of roots (x1+x2+x3) is the negative coefficient of x2 (i.e. m2). Back to how to calculate m, it is simply

Oh! I finally got the answer!


The Youtuber also stated that for the case P=Q i.e. x1 = x2 and y1 = y2), then



For this case, actually the straight line should be a tangent line touching the elliptic curve at point B. Oh! This needs calculus and I need to cheat by doing some searching on internet. Luckily, some universities do public some tutorial paper on that.

Taking differentiation on y2 = x3 + ax + b

As in the previous case, m2 is still the sum of root (in this case is x1+x2+x3).

Therefore x3 and also be calculated according.