Post
Topic
Board Development & Technical Discussion
Re: Elliptic Curve Point Addition Question
by
Tanagi
on 25/01/2022, 02:39:52 UTC
How did you get y2-y1 to equal that? When I did it it ends up being a negative number.

Also, where does modp come into it all?
You've answered your own question here.

The secp256k1 curve which bitcoin uses is defined over the field p. So all calculations must be done modulo p. p is defined as:

FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE FFFFFC2F
2256 - 232 - 29 - 28 - 27 - 26 - 24 - 1
115792089237316195423570985008687907853269984665640564039457584007908834671663

With the coordinates you have given above, y2 - y1 gives:
Code:
-21239012392863529345032835584268763069528848989720309668369416382715921184388

Take that number mod p, and you get:
Code:
94553076844452666078538149424419144783741135675920254371088167625192913487275



Thanks you so much Shocked)