Can I generate an offline Bitcoin wallet using only OpenSSL?

6

1

From what I understand about Bitcoin, a wallet is really just a pair of public/private keys.

So, if someone needs to send me Bitcoins, all I need to do is just generate a pair or public/private keys using OpenSSL or some other tool, and send the public key to that person, without actually downloading a Bitcoin client (which will download a 12 GB block chain), or saving a wallet.dat.

Am I correct?

sashoalm

Posted 2013-12-17T11:41:46.780

Reputation: 389

2

Take a look at https://www.bitaddress.org/. Actually generating usable bitcoin addresses is somewhat complicated

aland 2013-12-17T11:58:58.447

Is bitaddress.org a reputable site?sashoalm 2013-12-17T12:35:44.143

Judging from [source code](https://github.com/pointbiz/bitaddress.org], it generates address with JavaScript on your PC, so the server can not get your private key anyway.

aland 2013-12-17T12:45:33.800

Answers

10

You are almost correct ;-)

You can create a public/private key using OpenSSL (in fact, some wallets use OpenSSL libaries to generate the keys). However, the bitcoin address is not your public key but a function of such public key. The exact function is defined here https://en.bitcoin.it/wiki/Technical_background_of_Bitcoin_addresses

So, once you generate your pair of keys and compute the bitcoin address from your public key, you can receive bitcoins in such bitcoin address.

jordi

Posted 2013-12-17T11:41:46.780

Reputation: 116

Thanks for the answer. Are there reputable tools available that are lightweight (say less than 100kb download) and can create a wallet? I've heard that the official bitcoin client tries to download 12 GB of data.sashoalm 2013-12-17T12:36:28.867

2

Try the github repository for the bitaddress.org code. Whilst the fact that it is a javascript program to be executed by a browser may not evoke great trust, the code is public, well-publicized, widely used, and reasonably readable.

pyramids 2013-12-17T12:47:53.167

You can try the python source https://github.com/richardkiss/pycoin where some basic functions are implemented. For instance, the function public_pair_to_bitcoin_address is clearly defined. I'm not aware of its reputation, but python is really easy to follow and you can check the part of the code you want to use.

jordi 2013-12-17T14:28:31.993

@sashoalm: vanitygen can also be used conveniently for this purpose. Note that while you can receive Bitcoins this way, in order to spend them again, you will have to install a wallet client.

Nate Eldredge 2013-12-17T18:25:17.533

1

This is the clearest example I've seen of this - https://gist.github.com/colindean/5239812

matja 2013-12-17T22:14:39.833