Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: piotr_n on April 09, 2013, 01:41:44 PM



Title: How do you decompress a public key?
Post by: piotr_n on April 09, 2013, 01:41:44 PM
A compressed public key contains 02 or 03 at the fist byte, followed by 256-bits of the X.
https://en.bitcoin.it/wiki/Elliptic_Curve_Digital_Signature_Algorithm

How do you calculate the Y, out of it?

I see that the client just calls EC_KEY_set_conv_form with POINT_CONVERSION_COMPRESSED, but since I need to do it in an app which not use OpenSSL, could anyone please refer me to some doc/code explaining the math behind this process?


Title: Re: How do you decompress a public key?
Post by: MoonShadow on April 09, 2013, 01:43:05 PM
I don't believe that you can derive the uncompressed public key from just the compressed public key.  I'm pretty sure that you need the private key for that.


Title: Re: How do you decompress a public key?
Post by: Zeilap on April 09, 2013, 01:44:23 PM
https://bitcointalk.org/index.php?topic=162805 (https://bitcointalk.org/index.php?topic=162805)


Title: Re: How do you decompress a public key?
Post by: piotr_n on April 09, 2013, 01:45:29 PM
https://bitcointalk.org/index.php?topic=162805 (https://bitcointalk.org/index.php?topic=162805)
Cheers!