# Deriving $y$-coordinate

Is there any formula for deriving the $$y$$-coordinate using the $$x$$-coordinate and the slope in the secp256k1 elliptic curve?

For example:

Calculate the slope:

slope = 75359724952757581356787150982223137069297282952438962440225639443485944634025


Calculate the new $$x$$-coordinates:

x = 112711660439710606056748659173929673102114977341539408544630613555209775888121


Calculate the new $$y$$-coordinates:

y = 25583027980570883691656905877401976406448868254816295069919888960541586679410


Each of the above values are valid points in the elliptic curve.

• Have you tried looking at the math behind elliptic curves? Points are defined by an equation which you can find online easily. Sep 5 at 2:01
• A valid x coordinate defines one of two points. It's unclear the slope of what the other given is.
– fgrieu
Sep 5 at 8:28
• "Each of the above values are valid points in the elliptic curve" There is one slope and two coordinates. At most there is one point defined in the question: $(x, y)$, which begs the question if you've got enough understanding of ECC calculations. Sep 7 at 9:49

In python we have (see this):

slope = (3 * pow(x, 2, p) * pow(2 * y, -1, p)) % p


So

y = (3 * pow(x, 2, p) * pow(2 * slope, -1, p)) % p


Example

p = 2 ** 256 - 2 ** 32 - 2 ** 9 - 2 ** 8 - 2 ** 7 - 2 ** 6 - 2 ** 4 - 1
x = 112711660439710606056748659173929673102114977341539408544630613555209775888121
y = 25583027980570883691656905877401976406448868254816295069919888960541586679410
slope = 75359724952757581356787150982223137069297282952438962440225639443485944634025
y_ = 3 * pow(x, 2, p) * pow(2 * slope, -1, p) % p
assert y == y_


The octet-string-to-ec-point conversion subroutine contains steps that de-compresses a EC point with only x-coordinates into X-Y tuple.

The spec's available on SECG website, section 2.3.4 of SEC#1 v2.0