<p>You can choose the private key to be whatever you want, and calculate the corresponding public key and bitcoin address.</p>
<p>Adding to this answer, there is really no reason to want to do this. But if one really insisted, here is a way to do it with <a href="https://github.com/stevenroose/hal/" rel="nofollow noreferrer">hal</a>. First start with generating a random private key</p>
<pre><code>$ hal key generate
{
  &quot;raw_private_key&quot;: &quot;7019c07716861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898&quot;,
  &quot;wif_private_key&quot;: &quot;KzycuDEqJaMyjHWJDD9cdyPeH1rtCTgE5m1EHfCdnTs4ng2D43Bt&quot;,
  &quot;public_key&quot;: &quot;02260106e42d7aef51b92c6c4aa2d0a5a6f3e0c6ad68ee9fadd8bd50d8cbe1a0b4&quot;,
  &quot;uncompressed_public_key&quot;: &quot;04260106e42d7aef51b92c6c4aa2d0a5a6f3e0c6ad68ee9fadd8bd50d8cbe1a0b4349d9106ee1724cf51c954e6aec9522febd7fcb46d7248a0ce390810fc0ac6a0&quot;,
  &quot;addresses&quot;: {
    &quot;p2pkh&quot;: &quot;1J6wqBd7QVGt7vGCNfUShoDEwQg2LFTgRR&quot;,
    &quot;p2wpkh&quot;: &quot;bc1qhwvl6yyrtheep7rmsxmf536m45dzfz4wrxdacu&quot;,
    &quot;p2shwpkh&quot;: &quot;3QLdovvKokkyiyX3jTzgfaMCv9MiaoVW5C&quot;
  }
}%                                     
</code></pre>
<p>Then change the beginning of the raw private key to <code>deadbeef</code> or whatever you want</p>
<pre><code>7019c07716861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898
-&gt;
deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898
</code></pre>
<p>Then get the address for it</p>
<pre><code>$ hal key inspect deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898
{
  &quot;raw_private_key&quot;: &quot;deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898&quot;,
  &quot;public_key&quot;: &quot;02de9367c92d7a42953e1afdf74d509d3992ba78bfb93f448859a1557e2685ca60&quot;,
  &quot;uncompressed_public_key&quot;: &quot;04de9367c92d7a42953e1afdf74d509d3992ba78bfb93f448859a1557e2685ca60b142aa0a4f495e16f80f811ec4556e3d33be28c930fab6e6a051e9a5bdc91d52&quot;,
  &quot;addresses&quot;: {
    &quot;p2pkh&quot;: &quot;1BhftRM4fNZRYdDYMUdujq9C84bRX84Qf8&quot;,
    &quot;p2wpkh&quot;: &quot;bc1qw439kmezxvdff0hnalmeqvfsnttd9gkjux5rct&quot;,
    &quot;p2shwpkh&quot;: &quot;34KVR36eoQrf48bmjQ46JU5dGVg1gqdUFg&quot;
  }
}%   
</code></pre>

CC BY-SA 3.0
2013-03-20T11:35:51.170Z
However, the more predictable the private key is, the weaker your security is. You don't want your private key to be "password" or expect your wallet to be empty.
David Schwartz
CC BY-SA 3.0
2013-03-20T12:04:57.303Z
No I just want to know a specific part of it so that I can write the rest down and add additional security to remember a part myself.
Steven Roose
CC BY-SA 3.0
2013-03-20T12:05:15.573Z
@AlgolCobol, How can I create such a priv/pub key pair?
Steven Roose
CC BY-SA 3.0
2013-05-12T14:35:51.070Z
Still the question is only answered partially. "Are there tools that already do this? How should it be done theoretically?"
Steven Roose
CC BY-SA 4.0
2021-03-12T17:19:04.447Z
@StevenRoose: At this point, you wrote the complete answer. Might have been better to post it as your own and accept that then. ;)
Murch
CC BY-SA 4.0
2013-03-20T11:09:48.987Z
2021-03-12T16:37:45.297Z
2021-03-12T16:37:45.297Z
Algol Cobol
<p>The most common way is to create the public address, compressed or uncompressed from a hex value, through the elliptic curve, hashing and so on.</p>
<p>Please check this awesome web to see the whole process and with different options to start: <a href="https://www.mobilefish.com/services/cryptocurrency/cryptocurrency.html" rel="nofollow noreferrer">link</a></p>
<p>And if you like to check python code to see the whole process: <a href="https://bitcoin.stackexchange.com/questions/102994/how-convert-bitcoin-privat-key-compression-to-public-address/103046#103046">here</a></p>

CC BY-SA 4.0
2021-02-26T11:57:56.987Z
2021-02-26T11:57:56.987Z
Nand0san
<p>I was not sure how to formulate the question title. What I want to achieve is the same as VanityGen and many other tools do to create an address starting with a predefined part, but with private keys.</p>

<p>So basically I want to create a Bitcoin public/private key pair of which the private key begins with a string I define.</p>

<p>Are there tools that already do this? If not, is it possible? How should it be done theoretically? </p>

<address><private-key><vanity-address><vanitygen>
Is it possible to create an address from a predefined private key?
Steven Roose
# Is it possible to create an address from a predefined private key?

(Asked by: username_0 on 2013-03-18)

I was not sure how to formulate the question title. What I want to achieve is the same as VanityGen and many other tools do to create an address starting with a predefined part, but with private keys.

So basically I want to create a Bitcoin public/private key pair of which the private key begins with a string I define.

Are there tools that already do this? If not, is it possible? How should it be done theoretically?

**Tags:** address, private-key, vanity-address, vanitygen


---

## 2 answers

### Answer by username_1 on 2013-03-20. Score: 2 | Accepted answer

You can choose the private key to be whatever you want, and calculate the corresponding public key and bitcoin address.

Adding to this answer, there is really no reason to want to do this. But if one really insisted, here is a way to do it with [hal](https://github.com/username_0/hal/). First start with generating a random private key

```
$ hal key generate
{
  "raw_private_key": "7019c07716861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898",
  "wif_private_key": "KzycuDEqJaMyjHWJDD9cdyPeH1rtCTgE5m1EHfCdnTs4ng2D43Bt",
  "public_key": "02260106e42d7aef51b92c6c4aa2d0a5a6f3e0c6ad68ee9fadd8bd50d8cbe1a0b4",
  "uncompressed_public_key": "04260106e42d7aef51b92c6c4aa2d0a5a6f3e0c6ad68ee9fadd8bd50d8cbe1a0b4349d9106ee1724cf51c954e6aec9522febd7fcb46d7248a0ce390810fc0ac6a0",
  "addresses": {
    "p2pkh": "1J6wqBd7QVGt7vGCNfUShoDEwQg2LFTgRR",
    "p2wpkh": "bc1qhwvl6yyrtheep7rmsxmf536m45dzfz4wrxdacu",
    "p2shwpkh": "3QLdovvKokkyiyX3jTzgfaMCv9MiaoVW5C"
  }
}%                                     

```

Then change the beginning of the raw private key to `deadbeef` or whatever you want

```
7019c07716861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898
->
deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898

```

Then get the address for it

```
$ hal key inspect deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898
{
  "raw_private_key": "deadbeef16861030e9334b88c24ee595b6fd922514a13de812e36cf6f910a898",
  "public_key": "02de9367c92d7a42953e1afdf74d509d3992ba78bfb93f448859a1557e2685ca60",
  "uncompressed_public_key": "04de9367c92d7a42953e1afdf74d509d3992ba78bfb93f448859a1557e2685ca60b142aa0a4f495e16f80f811ec4556e3d33be28c930fab6e6a051e9a5bdc91d52",
  "addresses": {
    "p2pkh": "1BhftRM4fNZRYdDYMUdujq9C84bRX84Qf8",
    "p2wpkh": "bc1qw439kmezxvdff0hnalmeqvfsnttd9gkjux5rct",
    "p2shwpkh": "34KVR36eoQrf48bmjQ46JU5dGVg1gqdUFg"
  }
}%   

```

> **Comments:**
> **username_2**: However, the more predictable the private key is, the weaker your security is. You don't want your private key to be "password" or expect your wallet to be empty.  
> **username_0**: No I just want to know a specific part of it so that I can write the rest down and add additional security to remember a part myself.  
> **username_0**: @username_1, How can I create such a priv/pub key pair?  
> **username_0**: Still the question is only answered partially. "Are there tools that already do this? How should it be done theoretically?"  
> **username_3**: @username_0: At this point, you wrote the complete answer. Might have been better to post it as your own and accept that then. ;)  

---

### Answer by username_4 on 2021-02-26. Score: -1

The most common way is to create the public address, compressed or uncompressed from a hex value, through the elliptic curve, hashing and so on.

Please check this awesome web to see the whole process and with different options to start: [link](https://www.mobilefish.com/services/cryptocurrency/cryptocurrency.html)

And if you like to check python code to see the whole process: [here](https://bitcoin.stackexchange.com/questions/102994/how-convert-bitcoin-privat-key-compression-to-public-address/103046#103046)


---

