<p>I recommend simply using <a href="https://github.com/samr7/vanitygen" rel="nofollow">vanitygen</a> like this:</p>

<pre><code>vanitygen -1 1
</code></pre>

<p>This will generate a small number of addresses that you can use, as well as their private keys.</p>

<p><code>vanitygen</code> is <a href="https://github.com/samr7/vanitygen/blob/master/INSTALL" rel="nofollow">trivial to install</a> on any POSIX system and is proven to work.</p>

<p>Alternatively, you can try <a href="https://github.com/grondilu/bitcoin-bash-tools" rel="nofollow">bitcoin-bash-tools</a>. Source that from your <code>.bashrc</code> or simply run it, then you can create a new keypair with <code>newBitcoinKey</code>.</p>

CC BY-SA 3.0
2013-05-12T18:51:06.850Z
Thanks for this suggestion, the tool sounds good. However, it doesn’t seem to be included in (older) package archives of distributions (yet) (probably because it especially for Bitcoin, so still somewhat new), e.g. it’s [not in Debian](http://packages.debian.org/search?keywords=vanitygen&searchon=all&suite=all&section=all)/[Ubuntu](http://packages.ubuntu.com/search?keywords=vanitygen&searchon=all&suite=all&section=all)/[Arch](https://www.archlinux.org/packages/?q=vanitygen)/…. So I’m still looking for a way with tools included in package archives, e.g. from Debian.
unor
CC BY-SA 3.0
2013-05-12T20:03:16.037Z
Unfortunately, I don't think you're likely to be able to do it with tools included in the archives. You can generate a secp256k1 key and do the hashing, but the base58 step requires code. See also [this](http://bitcoin.stackexchange.com/a/7496/1409). `vanitygen` only requires `pcre` and `openssl`, both of which are likely already to be installed on any system. You'd just need to install `build-essential` to get the rest of the compiling environment ready.
Colin Dean
CC BY-SA 3.0
2013-05-12T20:11:06.017Z
I looked around for a bit on the Bitcointalk forums [a thread in which people are discussing command line generation](https://bitcointalk.org/index.php?topic=11606.0;all).
Colin Dean
CC BY-SA 3.0
2013-05-12T15:22:51.353Z
2013-05-12T20:09:48.683Z
2013-05-12T20:09:48.683Z
Colin Dean
<p>The following code snippets are taken from the blog post:
<a href="http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html" rel="nofollow">http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html</a></p>

<p>It is a great read and you should take a look at it. </p>

<pre><code>import random, keyUtils
#FOR DEMO ONLY.USE A CRYPTOGRAPHICALLY SECURE RANDOM  GENERATOR IN PRODUCTION
private_key = ''.join(['%x' % random.randrange(16) for x in range(0, 64)])
print private_key
print keyUtils.privateKeyToWif(private_key)
print keyUtils.keyToAddr(private_key)
</code></pre>

<p>The source code for keyUtils is on the followign github:
<a href="https://github.com/shirriff/bitcoin-code" rel="nofollow">https://github.com/shirriff/bitcoin-code</a></p>

<p>That is the example code from the blog post I shared above. </p>

CC BY-SA 3.0
2015-12-13T06:02:51.347Z
2015-12-13T06:02:51.347Z
Dean Dunbar
<p>Check out <a href="https://gist.github.com/colindean/5239812" rel="nofollow">this shell script</a>, which generate a public/private bitcoin address pair.</p>

CC BY-SA 3.0
2015-12-11T20:04:46.507Z
2015-12-11T20:04:46.507Z
mti2935
<p>If I understand it correctly, I could generate a valid Bitcoin address (key pair) following <a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses#How_to_create_Bitcoin_Address" rel="noreferrer">this algorithm</a>. </p>

<p>With an address generated in such a way I would be able to <strong>receive</strong> Bitcoin without ever having to install a Bitcoin client. Is this correct?</p>

<p>How could I follow this algorithm with common (command-line) tools, i.e. those typically available on (even older) GNU/Linux systems? (they don’t have to be installed by default, but they should be part of the distributor’s package archive)</p>

<p>Would there be any risks/problems using such a key instead of one generated by a Bitcoin client?</p>

CC BY-SA 3.0
2013-05-12T14:39:34.270Z
You should keep in mind that computers are not very good in creating randomness. Many applications that require a lot of randomness, get it from user input. Just make sure your private key is random enough :)
You could use Vanitygen to create keypairs.
Steven Roose
CC BY-SA 3.0
2015-12-14T12:53:23.377Z
Users be aware that typically you want a wallet program to manage your addresses and make sure you're monitoring the blockchain for any funds sent to your address. Generating them as described in the current answers means that no wallet software is monitoring your address to alert you when you receive your coins.
morsecoder
<address><linux><address-generation>
Generate address (for receiving) on GNU/Linux without Bitcoin client?
unor
# Generate address (for receiving) on GNU/Linux without Bitcoin client?

(Asked by: username_0 on 2013-05-12)

If I understand it correctly, I could generate a valid Bitcoin address (key pair) following [this algorithm](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses#How_to_create_Bitcoin_Address).

With an address generated in such a way I would be able to **receive** Bitcoin without ever having to install a Bitcoin client. Is this correct?

How could I follow this algorithm with common (command-line) tools, i.e. those typically available on (even older) GNU/Linux systems? (they don’t have to be installed by default, but they should be part of the distributor’s package archive)

Would there be any risks/problems using such a key instead of one generated by a Bitcoin client?

**Tags:** address, linux, address-generation

> **Comments:**
> **username_1**: You should keep in mind that computers are not very good in creating randomness. Many applications that require a lot of randomness, get it from user input. Just make sure your private key is random enough :) You could use Vanitygen to create keypairs.  
> **username_2**: Users be aware that typically you want a wallet program to manage your addresses and make sure you're monitoring the blockchain for any funds sent to your address. Generating them as described in the current answers means that no wallet software is monitoring your address to alert you when you receive your coins.  

---

## 3 answers

### Answer by username_3 on 2013-05-12. Score: 2 | Accepted answer

I recommend simply using [vanitygen](https://github.com/samr7/vanitygen) like this:

```
vanitygen -1 1

```

This will generate a small number of addresses that you can use, as well as their private keys.

`vanitygen` is [trivial to install](https://github.com/samr7/vanitygen/blob/master/INSTALL) on any POSIX system and is proven to work.

Alternatively, you can try [bitcoin-bash-tools](https://github.com/grondilu/bitcoin-bash-tools). Source that from your `.bashrc` or simply run it, then you can create a new keypair with `newBitcoinKey`.

> **Comments:**
> **username_0**: Thanks for this suggestion, the tool sounds good. However, it doesn’t seem to be included in (older) package archives of distributions (yet) (probably because it especially for Bitcoin, so still somewhat new), e.g. it’s [not in Debian](http://packages.debian.org/search?keywords=vanitygen&searchon=all&suite=all&section=all)/[Ubuntu](http://packages.ubuntu.com/search?keywords=vanitygen&searchon=all&suite=all&section=all)/[Arch](https://www.archlinux.org/packages/?q=vanitygen)/…. So I’m still looking for a way with tools included in package archives, e.g. from Debian.  
> **username_3**: Unfortunately, I don't think you're likely to be able to do it with tools included in the archives. You can generate a secp256k1 key and do the hashing, but the base58 step requires code. See also [this](http://bitcoin.stackexchange.com/a/7496/1409). `vanitygen` only requires `pcre` and `openssl`, both of which are likely already to be installed on any system. You'd just need to install `build-essential` to get the rest of the compiling environment ready.  
> **username_3**: I looked around for a bit on the Bitcointalk forums [a thread in which people are discussing command line generation](https://bitcointalk.org/index.php?topic=11606.0;all).  

---

### Answer by username_4 on 2015-12-13. Score: 3

The following code snippets are taken from the blog post:
<http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html>

It is a great read and you should take a look at it.

```
import random, keyUtils
#FOR DEMO ONLY.USE A CRYPTOGRAPHICALLY SECURE RANDOM  GENERATOR IN PRODUCTION
private_key = ''.join(['%x' % random.randrange(16) for x in range(0, 64)])
print private_key
print keyUtils.privateKeyToWif(private_key)
print keyUtils.keyToAddr(private_key)

```

The source code for keyUtils is on the followign github:
<https://github.com/shirriff/bitcoin-code>

That is the example code from the blog post I shared above.


---

### Answer by username_5 on 2015-12-11. Score: 3

Check out [this shell script](https://gist.github.com/username_3/5239812), which generate a public/private bitcoin address pair.


---

