<p>For those of you looking to import your Vanity address into your BitCoin QT client, here are the instructions (<a href="https://en.bitcoin.it/wiki/How_to_import_private_keys_v7+" rel="nofollow noreferrer">source</a>):</p>

<p><strong>Backup Your Wallet</strong>
Although this process is well tested and used you should always take another backup of your wallet.dat file before starting.</p>

<p><strong>Open Debug Window</strong>
Then go to menu: /Help/Debug Window and click on the tab - Console.</p>

<p><strong>Unlock your wallet</strong>
If your wallet is encrypted (I hope it is!) you must unlock it. If not just skip this step.</p>

<p>To do this just type into the box at the bottom:</p>

<pre><code>walletpassphrase "YourLongPassphrase" 600
</code></pre>

<p>You need the quotes if there is a space in your phrase else there is no need for them. The 600 means your wallet is unlocked for 10 minutes (600 seconds).</p>

<p><strong>Run Import Command in Debug Window</strong>
In the console at the very bottom is a text entry box. In here enter:</p>

<pre><code>importprivkey yourPrivateKeyInWalletImportFormat "TheLabelThatIWant"
</code></pre>

<p>The private key must not have any spaces, remove them if they existt in your backup. The label may have spaces, the quotes are only needed if you want a space in the label.</p>

<p>You now have to be patient. On a fast PC it takes 2 minutes to import, and during this time it looks like you application has hung. You are now done. But always best to check it worked.</p>

<p><strong>Check Key Imported OK</strong>
Once Imported you can check that you have the address by closing the Debug window and going back to your address book. You should see the address here. </p>

<ul>
<li>Restart your BitCoin QT Client to see the new address in your Receive
"Tab"</li>
</ul>

<p><strong>Backup Wallet</strong>
Your backup of your wallet will not have this key in obviously. So before you do anything else backup the wallet.dat file as normal.</p>

CC BY-SA 4.0
2021-01-20T18:41:56.767Z
re: "yourPrivateKeyInWalletImportFormat"
is that WIF Compressed or WIF Uncompressed?
JDOaktown
CC BY-SA 3.0
2014-06-16T19:35:46.927Z
2017-01-24T16:42:26.070Z
2017-01-24T16:42:26.070Z
Serj Sagan
<ol>
<li>Run Bitcoin-Core</li>
<li>Select <strong>Help</strong> (to the right of Settings)</li>
<li>Select <strong>Debug Window</strong></li>
<li>Select <strong>Console</strong></li>
<li>If you encrypted your wallet, unlock it by entering <code>walletpassphrase "YourLongPassphrase" 600</code> next to the > input box</li>
<li>Next to the > input box type <code>importprivkey &lt;bitcoinprivkey&gt;</code> (Note that the private key must not have spaces, remove them if they are included in your backup)</li>
</ol>

<p>Example: <code>importprivkey 5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS</code></p>

CC BY-SA 3.0
2012-12-31T05:23:16.960Z
Thanks! I had to do it twice, though. The first time it didn't show up and the second time it said error code -4 and it worked. Whatever works!
lurf jurv
CC BY-SA 3.0
2014-02-21T00:32:05.343Z
This might also be of help: http://bitcoin.stackexchange.com/a/13303/6375
Scott
CC BY-SA 3.0
2015-11-04T05:44:20.933Z
This is how you do it, too bad that this method seems like an "odd" place to have this.  It reminds me of the IDE Eclipse when you want to import packages...
Tom Stickel
CC BY-SA 3.0
2017-01-24T07:24:27.333Z
While adding multiple keys you may want to avoid a time consuming rescan after each key. To do so use the command `importprivkey <bitcoinprivkey> '' false` for each key and `importprivkey <bitcoinprivkey> '' true` for the last one. The blank label is needed to pass the true/false flag.
pixelbrackets
CC BY-SA 4.0
2020-01-09T23:01:55.353Z
This only works for non-pruned mode.  If pruned, you can't import private keys.  Also, Console is under 'Window' now, not Help.  Latest version here: https://en.bitcoin.it/wiki/Help:How_to_import_private_keys_in_Bitcoin_Core_0.7%2B
wordsforthewise
CC BY-SA 4.0
2022-12-19T21:58:10.703Z
If you get "Only legacy wallets are supported by this command (code -4)" it means that you try to import a private key into a descriptor wallet. Either [use a legacy wallet](https://bitcoin.stackexchange.com/questions/115743/import-private-key-into-bitcoincore-getting-error) or [create descriptors for your private keys prior import](https://bitcoin.stackexchange.com/questions/113846/how-can-a-private-key-be-imported-to-a-descriptor-wallet). The latter is recommend.
Martin Braun
CC BY-SA 3.0
2012-12-31T03:51:20.983Z
2018-01-30T09:04:03.837Z
2018-01-30T09:04:03.837Z
Rick
<p>How do I import a private key into Bitcoin-Qt? bitcoind is nowhere to be found, and pywallet says it requires "bsddb" when I run it, which is also nowhere to be found. I generated some vanity addresses and I want to use them.</p>

<bitcoin-core><private-key><import>
How do I import a private key into Bitcoin-Core?
lurf jurv
# How do I import a private key into Bitcoin-Core?

(Asked by: username_0 on 2012-12-31)

How do I import a private key into Bitcoin-Qt? bitcoind is nowhere to be found, and pywallet says it requires "bsddb" when I run it, which is also nowhere to be found. I generated some vanity addresses and I want to use them.

**Tags:** bitcoin-core, private-key, import


---

## 2 answers

### Answer by username_3 on 2012-12-31. Score: 47 | Accepted answer

1. Run Bitcoin-Core
2. Select **Help** (to the right of Settings)
3. Select **Debug Window**
4. Select **Console**
5. If you encrypted your wallet, unlock it by entering `walletpassphrase "YourLongPassphrase" 600` next to the > input box
6. Next to the > input box type `importprivkey <bitcoinprivkey>` (Note that the private key must not have spaces, remove them if they are included in your backup)

Example: `importprivkey 5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS`

> **Comments:**
> **username_0**: Thanks! I had to do it twice, though. The first time it didn't show up and the second time it said error code -4 and it worked. Whatever works!  
> **username_4**: This might also be of help: http://bitcoin.stackexchange.com/a/13303/6375  
> **username_5**: This is how you do it, too bad that this method seems like an "odd" place to have this.  It reminds me of the IDE Eclipse when you want to import packages...  
> **username_6**: While adding multiple keys you may want to avoid a time consuming rescan after each key. To do so use the command `importprivkey <bitcoinprivkey> '' false` for each key and `importprivkey <bitcoinprivkey> '' true` for the last one. The blank label is needed to pass the true/false flag.  
> **username_7**: This only works for non-pruned mode.  If pruned, you can't import private keys.  Also, Console is under 'Window' now, not Help.  Latest version here: https://en.bitcoin.it/wiki/Help:How_to_import_private_keys_in_Bitcoin_Core_0.7%2B  
> **username_8**: If you get "Only legacy wallets are supported by this command (code -4)" it means that you try to import a private key into a descriptor wallet. Either [use a legacy wallet](https://bitcoin.stackexchange.com/questions/115743/import-private-key-into-bitcoincore-getting-error) or [create descriptors for your private keys prior import](https://bitcoin.stackexchange.com/questions/113846/how-can-a-private-key-be-imported-to-a-descriptor-wallet). The latter is recommend.  

---

### Answer by username_1 on 2014-06-16. Score: 7

For those of you looking to import your Vanity address into your BitCoin QT client, here are the instructions ([source](https://en.bitcoin.it/wiki/How_to_import_private_keys_v7+)):

**Backup Your Wallet**
Although this process is well tested and used you should always take another backup of your wallet.dat file before starting.

**Open Debug Window**
Then go to menu: /Help/Debug Window and click on the tab - Console.

**Unlock your wallet**
If your wallet is encrypted (I hope it is!) you must unlock it. If not just skip this step.

To do this just type into the box at the bottom:

```
walletpassphrase "YourLongPassphrase" 600

```

You need the quotes if there is a space in your phrase else there is no need for them. The 600 means your wallet is unlocked for 10 minutes (600 seconds).

**Run Import Command in Debug Window**
In the console at the very bottom is a text entry box. In here enter:

```
importprivkey yourPrivateKeyInWalletImportFormat "TheLabelThatIWant"

```

The private key must not have any spaces, remove them if they existt in your backup. The label may have spaces, the quotes are only needed if you want a space in the label.

You now have to be patient. On a fast PC it takes 2 minutes to import, and during this time it looks like you application has hung. You are now done. But always best to check it worked.

**Check Key Imported OK**
Once Imported you can check that you have the address by closing the Debug window and going back to your address book. You should see the address here.

* Restart your BitCoin QT Client to see the new address in your Receive
  "Tab"

**Backup Wallet**
Your backup of your wallet will not have this key in obviously. So before you do anything else backup the wallet.dat file as normal.

> **Comments:**
> **username_2**: re: "yourPrivateKeyInWalletImportFormat" is that WIF Compressed or WIF Uncompressed?  

---

