Pages:
Author

Topic: y coordinate calculation (PUBLIC KEY BITCOIN) - page 2. (Read 947 times)

member
Activity: 211
Merit: 20
$$$$$$$$$$$$$$$$$$$$$$$$$
September 06, 2021, 10:47:05 AM
#8
@BlackHatCoiner Or it could be like this...
 
p = 115792089237316195423570985008687907853269984665640564039457584007908834671663

32748224938747404814623910738487752935528512903530129802856995983256684603122^
28948022309329048855892746252171976963317496166410141009864396001977208667916=
32670510020758816978083085130507043184471273380659243275938904335757337482424


member
Activity: 107
Merit: 61
September 06, 2021, 08:58:03 AM
#7
Excuse me for the noob question:  Let's assume x3=1, which means y2=8. What's y? Will it be square root of 8?
It will be square root modulo prime of 8
to be precise, it will be 29896722852569046015560700294576055776214335159245303116488692907525646231534

(29896722852569046015560700294576055776214335159245303116488692907525646231534 * 29896722852569046015560700294576055776214335159245303116488692907525646231534) mod secp256k1.p = 8
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
September 06, 2021, 08:48:13 AM
#6
32748224938747404814623910738487752935528512903530129802856995983256684603122**28948022309329048855892746252171976963317496166410141009864396001977208667916
What exactly are you trying to do here? It doesn't seem okay to me.

@_Counselor Thanks for the answers... yes, I'm calculating using only x. Maybe with some more advanced equation or other methods it is possible to define exactly the value of y with only x?
But, the only thing you need to define the value of y is x. @interiawp added you a code in which you can get one of the two values by knowing the other. If you wanted to know x, but having only y, then it's: x^3 = y^2 - 7.

To convert between Ys, you have to calculate y2 = (y1 - secp256k1.p) * -1. One of Y is even and another is odd.
Excuse me for the noob question:  Let's assume x3=1, which means y2=8. What's y? Will it be square root of 8?
member
Activity: 211
Merit: 20
$$$$$$$$$$$$$$$$$$$$$$$$$
September 06, 2021, 06:39:04 AM
#5
@_Counselor Thanks for the answers... yes, I'm calculating using only x. Maybe with some more advanced equation or other methods it is possible to define exactly the value of y with only x?
member
Activity: 107
Merit: 61
September 06, 2021, 06:20:41 AM
#4
Yes...but what I would really like to understand is why private key 3 needed to invert the y value and private keys 1 and 2 didn't need to invert the y value.

Why do there have y values that need to be inverted and other values that don't need to be inverted?

What math or method is used to know whether or not I will need to invert the y value?

If you're using standard EC math, there no need to invert anything.
The point on the elliptic curve is generator point G multiplied by the private key. The EC multiplication formula calculates both X and correct Y and does not require additional inversion.
Looks like you're trying to calculate only X and then trying to calculate Y from that X with simple equation, which leads to two possible solutions of that equation. And without using the multiplication formula, there is no way to know whether the right Y will be even or odd.
member
Activity: 211
Merit: 20
$$$$$$$$$$$$$$$$$$$$$$$$$
September 06, 2021, 05:54:40 AM
#3
Each x coordinate corresponds to two y coordinates, because of square root.

To convert between Ys, you have to calculate y2 = (y1 - secp256k1.p) * -1. One of Y is even and another is odd.

To indicate which coordinate is needed, the compressed keys starts with 02 for even Y and 03 for odd Y.
Yes...but what I would really like to understand is why private key 3 needed to invert the y value and private keys 1 and 2 didn't need to invert the y value.

Why do there have y values that need to be inverted and other values that don't need to be inverted?

What math or method is used to know whether or not I will need to invert the y value?
member
Activity: 107
Merit: 61
September 05, 2021, 06:03:57 PM
#2
Each x coordinate corresponds to two y coordinates, because of square root.

To convert between Ys, you have to calculate y2 = (y1 - secp256k1.p) * -1. One of Y is even and another is odd.

To indicate which coordinate is needed, the compressed keys starts with 02 for even Y and 03 for odd Y.
member
Activity: 211
Merit: 20
$$$$$$$$$$$$$$$$$$$$$$$$$
September 05, 2021, 01:57:23 PM
#1
I would like to understand the math behind this...

Simply and objectively!In decimal for ease.

All calculations:
p = 115792089237316195423570985008687907853269984665640564039457584007908834671663
-------------------------------------------------------------------------------------------------------------------------------------------------------
Private key : 1

Public key :

x = 55066263022277343669578718895168534326250603453777594175500187360389116729240

55066263022277343669578718895168534326250603453777594175500187360389116729240**3 + 7 =

32748224938747404814623910738487752935528512903530129802856995983256684603122**28948022309329048855892746252171976963317496166410141009864396001977208667916=

y = 32670510020758816978083085130507043184471273380659243275938904335757337482424

OKAY
---------------------------------------------------------------------------------------------------------------------------------------------------

Private key : 2

Public key :

x = 89565891926547004231252920425935692360644145829622209833684329913297188986597

89565891926547004231252920425935692360644145829622209833684329913297188986597**3 + 7 =

57199941671890039290383617934355424684258807805258215939368959893591666662646**28948022309329048855892746252171976963317496166410141009864396001977208667916=

y = 12158399299693830322967808612713398636155367887041628176798871954788371653930

OKAY
-------------------------------------------------------------------------------------------------------------------------------------------------

Private key : 3

Public key :

x = 112711660439710606056748659173929673102114977341539408544630613555209775888121

112711660439710606056748659173929673102114977341539408544630613555209775888121**3 + 7 =

104193826873522593991639737736096919049125888873761064059040146529970392609905**28948022309329048855892746252171976963317496166410141009864396001977208667916=

y = 90209061256745311731914079131285931446821116410824268969537695047367247992253

NO OKAY
------------------------------------------------------------------------------------------------------------------------------------------------
Why did the y value of private key 3 need to be inverted?

What math or method is used to know whether or not I will need to invert the y value?
Pages:
Jump to: