Post
Topic
Board Development & Technical Discussion
Merits 2 from 1 user
Re: Elliptic Curve Point Addition Question
by
o_e_l_e_o
on 24/01/2022, 13:41:28 UTC
⭐ Merited by BlackHatCoiner (2)
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