Bitcoin Forum
May 07, 2024, 09:15:39 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: question about address generation  (Read 1260 times)
bitcoinsarefun (OP)
Member
**
Offline Offline

Activity: 98
Merit: 10



View Profile
March 26, 2012, 01:33:12 PM
 #1

why it 0x04 appended to the public key before beginning other functions on it?
1715116539
Hero Member
*
Offline Offline

Posts: 1715116539

View Profile Personal Message (Offline)

Ignore
1715116539
Reply with quote  #2

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

Posts: 1715116539

View Profile Personal Message (Offline)

Ignore
1715116539
Reply with quote  #2

1715116539
Report to moderator
1715116539
Hero Member
*
Offline Offline

Posts: 1715116539

View Profile Personal Message (Offline)

Ignore
1715116539
Reply with quote  #2

1715116539
Report to moderator
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
March 26, 2012, 01:49:07 PM
 #2

My understanding is it is to identify the underlying encryption protocol.  All keys today have the prefix 0x04 because they all use ECDSA (w/ secp256k1 curve).   It is possible for Bitcoin to support future algorithms (if ECDSA became compromised or degraded).  The 0x04 allows the client to "check" the algorithm being used.  If it finds a key w/ anything other than 0x04 it will fail but future clients could be extended.

You have to imagine if ECDSA was "partially compromised" existing keys will remain for a long time.  Having a encryption identifier would allow a client to handle both encryption methods at the same time.  Old clients would be ECDSA only and new clients would support the old & new algorithms.

If you mean why 0x04 not 0x03 or 0x99?  I don't think it has any specific meaning other than an identifier.
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1072
Merit: 1174


View Profile WWW
March 26, 2012, 06:08:36 PM
 #3

There are several ways to serialize EC public keys, as specified by the SEC specification. A summary:
* 0x00: The point at infinity
* 0x02 + x_coord: Compressed representation of a point with an even y_coord
* 0x03 + x_coord: Compressed representation of a point with an odd y_coord
* 0x04 + x_coord + y_coord: Uncompressed representation of a point

Up to 0.5.x, bitcoin always used uncompressed EC points (=public keys). Starting with 0.6.0, compressed public keys will be used for new or upgraded wallets.

I do Bitcoin stuff.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
March 26, 2012, 06:31:32 PM
 #4

Thanks Pieter I learned something today (I knew it would be a good idea to get out of bed).
Red Emerald
Hero Member
*****
Offline Offline

Activity: 742
Merit: 500



View Profile WWW
March 26, 2012, 06:34:43 PM
 #5

There are several ways to serialize EC public keys, as specified by the SEC specification. A summary:
* 0x00: The point at infinity
* 0x02 + x_coord: Compressed representation of a point with an even y_coord
* 0x03 + x_coord: Compressed representation of a point with an odd y_coord
* 0x04 + x_coord + y_coord: Uncompressed representation of a point

Up to 0.5.x, bitcoin always used uncompressed EC points (=public keys). Starting with 0.6.0, compressed public keys will be used for new or upgraded wallets.
Thanks for this.  I was trying to figure out how bitcoin was doing compressed public keys just last night.

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!