Bitcoin Forum
May 17, 2024, 05:47:01 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Getting the bitcoin address of a private key  (Read 2605 times)
btcton (OP)
Legendary
*
Offline Offline

Activity: 1288
Merit: 1007


View Profile
December 15, 2013, 05:18:04 PM
 #1

So, I'm playing around with bitcoin in JavaScript but I haven't found anywhere online how to calculate the bitcoin address of a Base 58 private key (starting with a 5). Can anyone tell me how or provide me a link with documentation? I'm not asking for a script, just conceptually how to do it.

The signature campaign posters adding useless redundant fluff to their posts to reach their minimum word count are lowering my IQ.
yakov
Newbie
*
Offline Offline

Activity: 40
Merit: 0


View Profile
December 15, 2013, 08:55:44 PM
 #2

https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
chriswilmer
Legendary
*
Offline Offline

Activity: 1008
Merit: 1000


View Profile WWW
December 15, 2013, 09:02:02 PM
 #3


I think that link skips a big conceptual step (at least for beginners), namely... the creation of the public key.

Starting from the private key, which is just a random 256 bit number, obtaining the public key requires performing a series of operations using elliptic curves (specifically, perform an "elliptic curve point multiplication" of the private key integer and a "generator" point on the specific curve that Bitcoin uses). THEN once you have the public key, you can follow the steps in that link.

btcton (OP)
Legendary
*
Offline Offline

Activity: 1288
Merit: 1007


View Profile
December 15, 2013, 11:03:20 PM
 #4


I think that link skips a big conceptual step (at least for beginners), namely... the creation of the public key.

Starting from the private key, which is just a random 256 bit number, obtaining the public key requires performing a series of operations using elliptic curves (specifically, perform an "elliptic curve point multiplication" of the private key integer and a "generator" point on the specific curve that Bitcoin uses). THEN once you have the public key, you can follow the steps in that link.


Yeah, I noticed that. I just need to know the starting point from the 5XXX[...] private key. Unfortunately, the wiki doesn't mention that.

The signature campaign posters adding useless redundant fluff to their posts to reach their minimum word count are lowering my IQ.
empoweoqwj
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


View Profile
December 16, 2013, 01:34:27 AM
 #5


I think that link skips a big conceptual step (at least for beginners), namely... the creation of the public key.

Starting from the private key, which is just a random 256 bit number, obtaining the public key requires performing a series of operations using elliptic curves (specifically, perform an "elliptic curve point multiplication" of the private key integer and a "generator" point on the specific curve that Bitcoin uses). THEN once you have the public key, you can follow the steps in that link.



So you are saying its possible to create the public key from the private key. But just "how possible"? Is it something done regularly or something that requires huge amounts of processing power?
chriswilmer
Legendary
*
Offline Offline

Activity: 1008
Merit: 1000


View Profile WWW
December 16, 2013, 06:43:15 AM
 #6


I think that link skips a big conceptual step (at least for beginners), namely... the creation of the public key.

Starting from the private key, which is just a random 256 bit number, obtaining the public key requires performing a series of operations using elliptic curves (specifically, perform an "elliptic curve point multiplication" of the private key integer and a "generator" point on the specific curve that Bitcoin uses). THEN once you have the public key, you can follow the steps in that link.



So you are saying its possible to create the public key from the private key. But just "how possible"? Is it something done regularly or something that requires huge amounts of processing power?

It's not only possible... it's the standard way every bitcoin address is generated.

Steps:

1. Generate a random number. <-- this IS your private key
2. Perform a hard-to-explain-but-easy-for-a-computer-to-do elliptic curve math operation to get the public key.
3. Apply the RIPEMD160 and SHA256 hash functions on the public key to get what is generally known as the "Bitcoin address"

empoweoqwj
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


View Profile
December 16, 2013, 06:54:11 AM
 #7


I think that link skips a big conceptual step (at least for beginners), namely... the creation of the public key.

Starting from the private key, which is just a random 256 bit number, obtaining the public key requires performing a series of operations using elliptic curves (specifically, perform an "elliptic curve point multiplication" of the private key integer and a "generator" point on the specific curve that Bitcoin uses). THEN once you have the public key, you can follow the steps in that link.



So you are saying its possible to create the public key from the private key. But just "how possible"? Is it something done regularly or something that requires huge amounts of processing power?

It's not only possible... it's the standard way every bitcoin address is generated.

Steps:

1. Generate a random number. <-- this IS your private key
2. Perform a hard-to-explain-but-easy-for-a-computer-to-do elliptic curve math operation to get the public key.
3. Apply the RIPEMD160 and SHA256 hash functions on the public key to get what is generally known as the "Bitcoin address"



Gotcha - thanks very  much for the explanation
simbo
Full Member
***
Offline Offline

Activity: 165
Merit: 100


View Profile
December 16, 2013, 03:47:38 PM
 #8

How to get the bitcoin private key? Just convert the 32 bit private key to 58base?

Thanks.

BattleTitans.io  ▼  Mobile PvP Arena of the Future  ▼  BattleTitans.io
The Most Promising ICO in October    [Join Now!]

▼  [FB]  ▬  [TW]  ▬  [TG]  ▬▬▬  [YU]  ▼
kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1025



View Profile
December 17, 2013, 04:39:30 AM
 #9

Any collection of 256 bits is a private key.  For best results, use a high quality source of random bits.

Also, those things that start with a 5 are called WIFs.  They are used to encode the binary private key in base58check.

https://en.bitcoin.it/wiki/WIF

Note that if you are doing this for real, you'll need to read up on public key point compression.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
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!