Bitcoin Forum
December 11, 2017, 05:24:26 PM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Compressed and uncompressed  (Read 350 times)
RentGPU
Sr. Member
****
Offline Offline

Activity: 350


View Profile
September 17, 2017, 05:03:40 PM
 #1

Sorry for my newbie question , actually there is 2 questions.
First, does the prefix (02 or 03) of the compressed publickey point refer to it's position of the x-axis up or down ,postive or negative?

Second, can i get the compressed publickey point from an uncompressed publickey point without knowing it's private key, if yes is there a site or software can do this for me?....thx alot.
1513013066
Hero Member
*
Offline Offline

Posts: 1513013066

View Profile Personal Message (Offline)

Ignore
1513013066
Reply with quote  #2

1513013066
Report to moderator
1513013066
Hero Member
*
Offline Offline

Posts: 1513013066

View Profile Personal Message (Offline)

Ignore
1513013066
Reply with quote  #2

1513013066
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513013066
Hero Member
*
Offline Offline

Posts: 1513013066

View Profile Personal Message (Offline)

Ignore
1513013066
Reply with quote  #2

1513013066
Report to moderator
1513013066
Hero Member
*
Offline Offline

Posts: 1513013066

View Profile Personal Message (Offline)

Ignore
1513013066
Reply with quote  #2

1513013066
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 1246


17kKQppUsngUiByDsce4JXoZEjjpvX9bpR


View Profile WWW
September 17, 2017, 05:35:09 PM
 #2

Sorry for my newbie question , actually there is 2 questions.
First, does the prefix (02 or 03) of the compressed publickey point refer to it's position of the x-axis up or down ,postive or negative?
It refers to the position on the y-axis. Specifically 0x02 is used to indicate that the y value is even and 0x03 is used to indicate that it is odd.

Second, can i get the compressed publickey point from an uncompressed publickey point without knowing it's private key, if yes is there a site or software can do this for me?....thx alot.
Yes, you can. In fact all compressed public keys are actually computed from the uncompressed public key as the uncompressed public key is the one that is actually derived.

What kind of software are you looking for?

RentGPU
Sr. Member
****
Offline Offline

Activity: 350


View Profile
September 17, 2017, 05:37:54 PM
 #3

Sorry for my newbie question , actually there is 2 questions.
First, does the prefix (02 or 03) of the compressed publickey point refer to it's position of the x-axis up or down ,postive or negative?
It refers to the position on the y-axis. Specifically 0x02 is used to indicate that the y value is even and 0x03 is used to indicate that it is odd.

Second, can i get the compressed publickey point from an uncompressed publickey point without knowing it's private key, if yes is there a site or software can do this for me?....thx alot.
Yes, you can. In fact all compressed public keys are actually computed from the uncompressed public key as the uncompressed public key is the one that is actually derived.

What kind of software are you looking for?
An online site that can convert uncompressed point to it's compressed one , script or something
DannyHamilton
Legendary
*
Online Online

Activity: 2002



View Profile
September 17, 2017, 06:16:26 PM
 #4

An online site that can convert uncompressed point to it's compressed one , script or something

There really isn't any "conversion" to do.

An uncompressed point has an x-coordinate and a y-coordinate. To get the compressed value, just throw away the y-coordinate, and add the appropriate (02 or 03) prefix.

RentGPU
Sr. Member
****
Offline Offline

Activity: 350


View Profile
September 17, 2017, 07:08:40 PM
 #5

An online site that can convert uncompressed point to it's compressed one , script or something

There really isn't any "conversion" to do.

An uncompressed point has an x-coordinate and a y-coordinate. To get the compressed value, just throw away the y-coordinate, and add the appropriate (02 or 03) prefix.
Thats in order to convert uncompressed to compressed what i need is the opposite , or in other words how i know the right prefix 02 or 03
achow101
Moderator
Legendary
*
Offline Offline

Activity: 1246


17kKQppUsngUiByDsce4JXoZEjjpvX9bpR


View Profile WWW
September 17, 2017, 07:30:45 PM
 #6

Thats in order to convert uncompressed to compressed what i need is the opposite , or in other words how i know the right prefix 02 or 03
No, that's exactly what you asked, to convert uncompressed pubkey to compressed one. Just look at the last digit of the y value (last 32 bytes of pubkey) and see if that is an even or odd digit. If it is even, the prefix byte is 0x02. If it is odd, the prefix byte is 0x03.

DannyHamilton
Legendary
*
Online Online

Activity: 2002



View Profile
September 17, 2017, 07:38:00 PM
 #7

how i know the right prefix 02 or 03

If you know the uncompressed?

Look at the value of the y-coordinate.  If the last digit is an odd number (1, 3, 5, 7, 9) then use a prefix of "03". If it is not an odd number (0, 2, 4, 6, 8 ) then use a prefix of "02"

Here's an example:

Uncompressed public key (prefix in black, x-value in blue, y-value in red):
04890821F2C9C8A01DDD5C019E75FD6D46D41D4575047CDEDD7946AA56EAE01A80FCA0ABC7E90526EB41EA6A9E4C6FA0A9FCED8DCF7E25FCD46509FFF2BD5088B8

Notice that the final digit of the red portion (y-value) is 8. So, we throw away that red portion, and change the prefix from 04 (uncompressed) to 02 (compressed/even):
02890821F2C9C8A01DDD5C019E75FD6D46D41D4575047CDEDD7946AA56EAE01A80



Here's another example:

Uncompressed public key (prefix in black, x-value in blue, y-value in red):
041C2E319C3F82FE654A77B6DF323166E1D771974B64CEF70F5AB97EAC9DA1A7CCDC44D9E9E893B53C9968C3D41EF20356484243530027456BFCF1AD97AC223839

Notice that the final digit of the red portion (y-value) is 9. So, we throw away that red portion, and change the prefix from 04 (uncompressed) to 03 (compressed/odd):
031C2E319C3F82FE654A77B6DF323166E1D771974B64CEF70F5AB97EAC9DA1A7CC


There really isn't any "conversion" to do.

An uncompressed point has an x-coordinate and a y-coordinate. To get the compressed value, just throw away the y-coordinate, and add the appropriate (02 or 03) prefix.
Thats in order to convert from uncompressed to compressed

Correct.  That's what you asked for, twice.

See here:

can i get the compressed publickey point from an uncompressed publickey point without knowing it's private key

An online site that can convert uncompressed point to it's compressed one

RentGPU
Sr. Member
****
Offline Offline

Activity: 350


View Profile
September 17, 2017, 07:53:38 PM
 #8

how i know the right prefix 02 or 03

If you know the uncompressed?

Look at the value of the y-coordinate.  If the last digit is an odd number (1, 3, 5, 7, 9) then use a prefix of "03". If it is not an odd number (0, 2, 4, 6, 8 ) then use a prefix of "02"

Here's an example:

Uncompressed public key (prefix in black, x-value in blue, y-value in red):
04890821F2C9C8A01DDD5C019E75FD6D46D41D4575047CDEDD7946AA56EAE01A80FCA0ABC7E90526EB41EA6A9E4C6FA0A9FCED8DCF7E25FCD46509FFF2BD5088B8

Notice that the final digit of the red portion (y-value) is 8. So, we throw away that red portion, and change the prefix from 04 (uncompressed) to 02 (compressed/even):
02890821F2C9C8A01DDD5C019E75FD6D46D41D4575047CDEDD7946AA56EAE01A80



Here's another example:

Uncompressed public key (prefix in black, x-value in blue, y-value in red):
041C2E319C3F82FE654A77B6DF323166E1D771974B64CEF70F5AB97EAC9DA1A7CCDC44D9E9E893B53C9968C3D41EF20356484243530027456BFCF1AD97AC223839

Notice that the final digit of the red portion (y-value) is 9. So, we throw away that red portion, and change the prefix from 04 (uncompressed) to 03 (compressed/odd):
031C2E319C3F82FE654A77B6DF323166E1D771974B64CEF70F5AB97EAC9DA1A7CC


There really isn't any "conversion" to do.

An uncompressed point has an x-coordinate and a y-coordinate. To get the compressed value, just throw away the y-coordinate, and add the appropriate (02 or 03) prefix.
Thats in order to convert from uncompressed to compressed

Correct.  That's what you asked for, twice.

See here:

can i get the compressed publickey point from an uncompressed publickey point without knowing it's private key

An online site that can convert uncompressed point to it's compressed one
I got it now thanks alot for the detailed answer.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!