Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Kostelooscoin on September 30, 2021, 09:07:48 AM



Title: same compressed pubkey for 2 different address
Post by: Kostelooscoin on September 30, 2021, 09:07:48 AM
hi guy,

for address compressed : 15UWMPEccBBLxVKFS6ULfsLDGmYA1KZvpr Public Key (hex) 03469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284

and for 2nd address uncompressed : 1MeRe251K27Uxkdz3bohptVht72EGLeX7k Public Key (hex) 04469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284a9bfbec4b12fdc733f4d35f1d666ce9010af4f1f62de4b683ce1d3ca738f5450

now for address compressed : 1Ak489qTiyprxJ98kD6dj8x4YbTZBAR82J Public Key (hex) 03469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284

and for 2nd address uncompressed : 1E8iFaQeRtKzzsbwgtwjXQs6bBdRtFsp7XPublic Key (hex)
04469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd2845640413b4ed0238cc0b2ca0e2999316fef50b0e09d21b497c31e2c348c70a7df

does anyone have an explanation ?

2 same compressed address for 2 bitcoin address differents ???


Title: Re: same compressed pubkey for 2 different address
Post by: NotATether on September 30, 2021, 09:13:49 AM
Are you sure you didn't just HASH160 both compressed and uncompressed pubkey and got these two different addresses for each one?

Because a public key will hash to only one address.


Title: Re: same compressed pubkey for 2 different address
Post by: a.a on September 30, 2021, 09:15:44 AM
The Second compressed Key Is wrong. It has to be
03469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284

The corresponding uncompressed key ends on the hex number f, which is decimal 15 meaning it is odd. So odd y => 03 prefix


Title: Re: same compressed pubkey for 2 different address
Post by: Kostelooscoin on September 30, 2021, 09:16:09 AM
Are you sure you didn't just HASH160 both compressed and uncompressed pubkey and got these two different addresses for each one?

Because a public key will hash to only one address.

test yourself these 2 public keys you will see by yourself that they are correct


Title: Re: same compressed pubkey for 2 different address
Post by: Kostelooscoin on September 30, 2021, 09:17:16 AM
The Second compressed Key Is wrong. It has to be
03469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284

The corresponding uncompressed key ends on the hex number f, which is decimal 15 meaning it is odd. So odd y => 03 prefix

yes 03 not 02 sorry
but this does not solve the problem
04469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284a9bfbec4b12fd c733f4d35f1d666ce9010af4f1f62de4b683ce1d3ca738f5450 corresponding to 1MeRe251K27Uxkdz3bohptVht72EGLeX7k
and 04469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd2845640413b4ed02 38cc0b2ca0e2999316fef50b0e09d21b497c31e2c348c70a7df corresponding to 1E8iFaQeRtKzzsbwgtwjXQs6bBdRtFsp7X


Title: Re: same compressed pubkey for 2 different address
Post by: a.a on September 30, 2021, 09:27:10 AM

02469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284 => 15UWMPEccBBLxVKFS6ULfsLDGmYA1KZvpr
03469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284 => 1Ak489qTiyprxJ98kD6dj8x4YbTZBAR82J


Title: Re: same compressed pubkey for 2 different address
Post by: Kostelooscoin on September 30, 2021, 09:32:37 AM

02469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284 => 15UWMPEccBBLxVKFS6ULfsLDGmYA1KZvpr
03469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284 => 1Ak489qTiyprxJ98kD6dj8x4YbTZBAR82J

yes ok thanks ;)


Title: Re: same compressed pubkey for 2 different address
Post by: o_e_l_e_o on September 30, 2021, 11:04:47 AM
On an elliptic curve, each x coordinate has two valid y coordinates. One of those y coordinates will be even, and one of those y coordinates will be odd.

Knowing the x coordinate and whether the y coordinate is even or odd is enough information for anyone else to calculate the y coordinate, and so we can compress keys by leaving out the y coordinate and specifying whether it is even or odd. We specify even y coordinates using the prefix 02, and we specify odd y coordinates using the prefix 03.

Therefore

02469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284
04469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284a9bfbec4b12fdc733f4d35f1d666ce9010af4f1f62de4b683ce1d3ca738f5450

02 signals the even y coordinate, which in this case ends in 0.

03469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd284
04469619dc9c10ce858a5359e9e948cb50d415f93f2b63490fefcc1c4013bcd2845640413b4ed0238cc0b2ca0e2999316fef50b0e09d21b497c31e2c348c70a7df

03 signals the odd y coordinate, which in this case ends in f.

04 in both examples signals an uncompressed key.

This gives a total of 4 possible addresses - both an uncompressed and a compressed address for each of the two possible y values.