if i understand
Ax = a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd
Ay = 5b8dec5235a0fa8722476c7709c02559e3aa73aa03918ba2d492eea75abea235
BxBy = G
CxCy = G2
Your (Ax, Ay) point is the same as point kG in my example, and your (Bx, By) coordinates are for G.
To get G*2 (I am assuming this is the value you are trying to compute, correct me if I'm wrong), you have to add G + G.
There is an
algorithm for doing this point doubling
C = B*2 by hand. First, take
lambda = (3Bx2 + a)/(2By) , where (
Bx, By) are the coordinates of the point
B you are trying to double, and
a is a parameter whose value is given along with the type of curve you are using. Since you are using the secp256k1 curve,
a = 0.
So for the secp256k1 this expression becomes
lambda = (3Bx2)/(2By) (I'm using red to color x coordinates and blue to color y coordinates).
Next you compute
Cx = lambda2 -2Bx, then you compute
Cy = lambda*(Bx - Cx) - By . And this is how you get coordinates (Cx, Cy) of the point C = B*2.
The algorithm for doing point addition is so similar I might as well include it here too. To get C = A + B, where A != B (in other words A and B must not be the same point. If that's the case, use point doubling instead):
-
lambda = (By - Ay)/(Bx - Ax) (Note: no
a term, even if the curve is not secp256k1!)
-
Cx = lambda2 - Ax - Bx-
Cy = lambda*(Ax - Cx) - Ay