The ultimate goal is to understand how to make the translation from private key to public address. This is being done in C++, with no libraries, with 512 bit arithmetic, because I want to really understand how this process works. I am good with arithmetic, but very much not good with high level mathematics.
Here is the original: secp256k1 prime modulus vs order
In the section: “Addition Laws” is the following line
“Let P=(x1,x2) and Q=(x2,y2) be two point in the elliptic curve.”
Please note: all the 1 and 2 characters should be subscript.
First point: Seems to me that should have been
“Let P=(x1,y1) and Q=(x2,y2) be two point in the elliptic curve.” Do I understand this correctly? And the word “point” should be plural, points.
Second point: The x and y translations are confusing. Why do those steps not use something simple like
Px,Py and Qx,Qy.
Third point: From my readings, Q represents the public address. We don’t have Q until all the steps have been completed. Why is it used here as an intermediate value?
Fourth point: These steps are a single step of point addition. Imagine the private key is: …1101 in binary.
The first has a 1 bit in the LSB position, the value of one. Should the code add G to itself one time? The running total, so far, will be G added to itself. That is really multiplying G by 2 even though the value of that particular bit is 1.
The next step, for the 1 in the value 4 position: double G, then double that value, then add this number to the running total. Is this correct?
Fifth point: In the same section is item 1. P + P = O + P = P From other places I recall the upper case letter O, oh, means the number is at infinity. However, I also recall that the process monitors the size of each result, when it exceeds the value of p, then we must perform a "modulo p" operation and continue by using that remainder. If so, how could any result ever reach infinity?
Thank you for your time.