Bitcoin Forum
May 02, 2024, 05:13:03 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is it possible to recover uncompressed public key from compressed?  (Read 806 times)
amaclin (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
August 03, 2016, 05:58:42 AM
 #1

Let us say I have compressed public key
0378D430274F8C5EC1321338151E9F27F4C676A008BDF8638D07C0B6BE9AB35C71

How can I calculate uncompressed public key from it without knowledge of private key in form of

0478D430274F8C5EC1321338151E9F27F4C676A008BDF8638D07C0B6BE9AB35C71
  A1518063243ACD4DFE96B66E3F2EC8013C8E072CD09B3834A19F81F659CC3455

"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4613



View Profile
August 03, 2016, 06:35:22 AM
Merited by ABCbits (2)
 #2

The elliptic curve equation is:
Y2 = X3 + aX + b

In the case of the secp256k1 curve used by bitcoin:
a=0
b=7

Therefore:
Y2 = X3 + 7

So, if you know X, you can use the curve equation to compute Y2.
A square root extraction will result in Y and -Y.  The compressed point format includes the least significant bit of Y in the first byte.  That bit is enough to know whether you got Y or -Y and adjust appropriately.
dsattler
Legendary
*
Offline Offline

Activity: 924
Merit: 1000


View Profile
August 03, 2016, 06:36:31 AM
 #3

Let us say I have compressed public key
0378D430274F8C5EC1321338151E9F27F4C676A008BDF8638D07C0B6BE9AB35C71

How can I calculate uncompressed public key from it without knowledge of private key in form of

0478D430274F8C5EC1321338151E9F27F4C676A008BDF8638D07C0B6BE9AB35C71
  A1518063243ACD4DFE96B66E3F2EC8013C8E072CD09B3834A19F81F659CC3455



Try this tool: https://en.bitcoin.it/wiki/Bitcoin_Address_Utility

Bitcointalk member since 2013! Smiley
will_k
Sr. Member
****
Offline Offline

Activity: 337
Merit: 250


View Profile
August 04, 2016, 07:04:10 AM
 #4

The elliptic curve equation is:
Y2 = X3 + aX + b

In the case of the secp256k1 curve used by bitcoin:
a=0
b=7

Therefore:
Y2 = X3 + 7

So, if you know X, you can use the curve equation to compute Y2.
A square root extraction will result in Y and -Y.  The compressed point format includes the least significant bit of Y in the first byte.  That bit is enough to know whether you got Y or -Y and adjust appropriately.

very beginner question... what's X and Y? the integer form of the key?

★☆★Syscoin - Decentralized Marketplace and Multisig Platform
Pay with Bitcoin, ZCash and many more
For more visit Syscoin.org ★☆★
belcher
Sr. Member
****
Offline Offline

Activity: 261
Merit: 518


View Profile
August 04, 2016, 10:25:30 AM
Last edit: August 04, 2016, 10:39:43 AM by belcher
 #5

The elliptic curve equation is:
Y2 = X3 + aX + b

In the case of the secp256k1 curve used by bitcoin:
a=0
b=7

Therefore:
Y2 = X3 + 7

So, if you know X, you can use the curve equation to compute Y2.
A square root extraction will result in Y and -Y.  The compressed point format includes the least significant bit of Y in the first byte.  That bit is enough to know whether you got Y or -Y and adjust appropriately.

very beginner question... what's X and Y? the integer form of the key?

X and Y are the coordinates of the elliptic curve, in which bitcoin's elliptic curve cryptography operations take place. A public key is a point on that curve so it's stored as (X, Y), or (X, b) in compressed form.

Read this for an introduction http://www.coindesk.com/math-behind-bitcoin/

1HZBd22eQLgbwxjwbCtSjhoPFWxQg8rBd9
JoinMarket - CoinJoin that people will actually use.
PGP fingerprint: 0A8B 038F 5E10 CC27 89BF CFFF EF73 4EA6 77F3 1129
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!