Bitcoin Forum
May 27, 2024, 11:00:04 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Private key Generation and how public key derived from Private Key  (Read 581 times)
Zanetti (OP)
Newbie
*
Offline Offline

Activity: 21
Merit: 0



View Profile
April 25, 2013, 08:17:31 AM
Last edit: April 25, 2013, 09:26:39 AM by Zanetti
 #1

Hi everyone!!

I'm looking information about the first process of the creation of the Bitcoin Address, because the rest of the process I know, and the only questions that I have are with the first two steps.

    1 - How is the private key generated?
I found that information:
Quote
The private key is an ECDSA secp256k1, and is a random number. This secp256k1 has to be a number between 1 and 115792089237316195423570985008687907852837564279074904382605163141518161494336 (or in hexadecimal, between 1 and FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364140).
Is really a random number of the ECDSA secp256k1 o it has an specific protocol and is not exactly a random number?

    2 - How is the public key derived from private key?
I found that in a forum:
Quote
The private key is converted to a public key by performing an Elliptic Curve point multiplication with the curve’s base point. The result is an (x,y) coordinate pair, which constitutes the public key.

There was a sinple equation or way to calculate the whole public key form the private key, or if it's complicated explain in a simple words how this conversion works? The private key is hashed with something or is a simply aplication of an equation?

I know that in the Wiki exists this process, but the first two step there aren't explain in detail, and I want to know this steps in detail.
https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses

And this is the topic on the forum when I find some things, but is a little bit complexe for me.
https://bitcointalk.org/index.php?topic=78132.0

If someone could help me with these two questons I would appreciate.

Thanks
Buffer Overflow
Legendary
*
Offline Offline

Activity: 1652
Merit: 1015



View Profile
April 25, 2013, 08:21:47 AM
 #2

1) It's truly a random number between those two parameters. You could pick number 1 if you wanted, though that would be a poor choice.

DannyHamilton
Legendary
*
Offline Offline

Activity: 3402
Merit: 4656



View Profile
April 25, 2013, 02:24:37 PM
 #3

Is really a random number of the ECDSA secp256k1 so it has an specific protocol and is not exactly a random number?

No specific protocol. It is just a random number.  Some people "choose" a number by using some memorable data and running the SHA-256 algorithm against that data to result in a number ot use as a private key.  This is often referred to as a "brain wallet".  By using this "brain wallet" technique you drastically increase the odds that someone else will pick the same data (or guess what data you've picked), so this is generally considered insecure.  The most secure way to choose a private key is to do it as randomly as possible.  There are cryptographically sound random number generators used by computer programs (wallets) to do this, but if you really wanted to, you could just flip a coin 256 times and write a 0 for each "heads" and a 1 for each "tails".

There was a sinple equation or way to calculate the whole public key form the private key, or if it's complicated explain in a simple words how this conversion works? The private key is hashed with something or is a simply aplication of an equation?

As stated in quote you found in a forum, it is "an Elliptic Curve point multiplication with the curve’s base point. The result is an (x,y) coordinate pair, which constitutes the public key."

No hashing, no other equation.  You'll want to learn about Elliptic Curve mathematics, and then you can perform the math yourself (although it would be far safer, faster, and less error prone to use a well tested and industry accepted library instead).
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!