Bitcoin Forum

Local => Discussions générales et utilisation du Bitcoin => Topic started by: adrient on May 11, 2013, 09:37:26 AM



Title: Address from private key
Post by: adrient on May 11, 2013, 09:37:26 AM
Hello,

Tout d'abord, je suis conscient qu'il ne s'agit pas de la bonne section pour poster ce message, mais je n'ai pas l'option "new post" dans la rubrique "Development & Technical Discussion" et il semble que je ne puisse écrire un message qu'ici... Merci d'avance au modérateur de déplacer ce message au bon endroit.

First of all, I know this is not the place I should be posting this thread, but the "Development & Technical Discussion" section does not allow me to post a new thread! The only place where I can find the "new post" link seems to be there, so sorry for the pollution, and I'd thank the moderator if he'd be kind enough to move this thread to the right place.

---

Now here is my question:

Is it possible / trivial to compute the public key (or the bitcoin address) from the private key? I haven't studied asymmetric cryptography, but as far as I understand it, the public key is a function of the two secret prime numbers: I would thus guess that the answer to my question is yes.

If that is the case, how should I do it, practically?

Concretely, I want to store my bitcoin wallet information on one QR code. I could very well store both the public/private keys (using the URI format for inst.) but I would prefer storing only the private key in order to reduce the complexity of the QR, if that is possible.

Thank you in advance for your help,

Adrien


Title: Re: Address from private key
Post by: aes1 on May 11, 2013, 10:12:41 AM
Is it possible / trivial to compute the public key (or the bitcoin address) from the private key? I haven't studied asymmetric cryptography, but as far as I understand it, the public key is a function of the two secret prime numbers: I would thus guess that the answer to my question is yes.

If that is the case, how should I do it, practically?

Concretely, I want to store my bitcoin wallet information on one QR code. I could very well store both the public/private keys (using the URI format for inst.) but I would prefer storing only the private key in order to reduce the complexity of the QR, if that is possible.
From what I've understood, private key is practically a random number, and you can generate the public key from it using elliptic curve cryptography (http://en.wikipedia.org/wiki/Elliptic_Curve_DSA (http://en.wikipedia.org/wiki/Elliptic_Curve_DSA)).

Here's some more information I found at the Bitcoin wiki: https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses (https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses), https://en.bitcoin.it/wiki/Secp256k1 (https://en.bitcoin.it/wiki/Secp256k1)

The exact algorithm in bitcoin context takes some effort to find (not to mention understand), but if you have the patience you can probably dig it out from the javascript sources at https://www.bitaddress.org/ (https://www.bitaddress.org/). (I found the link here: https://bitcointalk.org/index.php?topic=78132.0 (https://bitcointalk.org/index.php?topic=78132.0)).


Title: Re: Address from private key
Post by: aes1 on May 11, 2013, 10:17:26 AM
Oh,

and if you find a succinct and practical answer, you can probably score some points here:

http://bitcoin.stackexchange.com/questions/1389/how-are-public-private-keys-in-an-address-created/1715#1715 (http://bitcoin.stackexchange.com/questions/1389/how-are-public-private-keys-in-an-address-created/1715#1715)


Title: Re: Address from private key
Post by: adrient on May 11, 2013, 10:32:33 AM
Hi Aes1,

Thank you for your answer, I'll investigate in that direction. Main point is that it is indeed possible, so thanks.

Best


Title: Re: Address from private key
Post by: jackjack on May 11, 2013, 11:35:18 AM
Is it possible / trivial to compute the public key (or the bitcoin address) from the private key? I haven't studied asymmetric cryptography, but as far as I understand it, the public key is a function of the two secret prime numbers: I would thus guess that the answer to my question is yes.
Oui.
Et non, la clé publique ne dépend que de la clé privée et du générateur (public, identique pour tout le monde)

If that is the case, how should I do it, practically?
La clé publique est un point de coordonnées (x,y) sur la courbe elliptique utilisée par Bitcoin. Donc y² = x³ + 7.
Sur la courbe on définit les opérations addition (point + point) et multiplication (point * nombre), et un point spécial qu'on appelle générateur (choisi "au hasard")
La clé publique est le générateur * clé privée

Concretely, I want to store my bitcoin wallet information on one QR code. I could very well store both the public/private keys (using the URI format for inst.) but I would prefer storing only the private key in order to reduce the complexity of the QR, if that is possible.
Comme tu le vois, oui c'est possible


Title: Re: Address from private key
Post by: adrient on May 11, 2013, 01:31:43 PM
Un grand merci jackjack pour ce complément d'informations, j'y vois déjà plus clair.


Title: Re: Address from private key
Post by: shantee on May 11, 2013, 02:35:53 PM
Salut

Je n'y connais rien du tout en cryptomachin :)
Mais je sais que si tu connais une clé privée tu peux obtenir :

- la clé publique
- l'adresse bitcoin


C'est très simple, il suffit d'utiliser l'outil Bitcoin Address Utility by Csascius