<p>In Core, go to "Help" and "Debug Window". Go to the console and type <code>importprivkey [key]</code>. This might also interest you: <a href="https://bitcoin.stackexchange.com/questions/5941/how-do-i-import-a-private-key-into-bitcoin-qt">How do I import a private key into Bitcoin-Qt?</a></p>

CC BY-SA 3.0
2017-08-18T20:09:32.160Z
It might also be worth mentioning [WIF](https://bitcoin.stackexchange.com/questions/5941/how-do-i-import-a-private-key-into-bitcoin-qt) in the answer as for what format that key needs to be in.
Corey Ogburn
CC BY-SA 3.0
2017-08-18T20:08:28.600Z
2017-08-18T20:08:28.600Z
Christoph Winter
<p>I've got some Go code that successfully generates private keys and vanity addresses <a href="https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses" rel="nofollow noreferrer">as described by the wiki</a>.</p>

<p>So I have all the parameters around the private key but I'm not sure what to do with that info to make it usable by the bitcoin core application.</p>

<p>Should I build a wallet.dat file to point the wallet software at? What's the format for that file? Is there an alternative format so I can import my new key alongside my old keys instead of replacing the existing file so that the software has more control of what the structure of the wallet.dat is?</p>

<p>I could layout the key in the same format that paper wallet QR codes use but I'm not sure what I'd do with that string for a desktop computer to accept it.</p>

<p>What format should I put the raw private key into and where should I put it for wallet software to use it?</p>

CC BY-SA 3.0
2017-08-18T20:07:11.867Z
That sounds perfect! The second answer calls it [Wallet Import Format or WIF](https://en.bitcoin.it/wiki/Wallet_import_format) and that's 100% what I was after! I guess that makes this question a duplicate. EDIT: they deleted their comment, but not after linking to [this question](https://bitcoin.stackexchange.com/questions/5941/how-do-i-import-a-private-key-into-bitcoin-qt).
Corey Ogburn
CC BY-SA 3.0
2017-08-18T20:09:07.640Z
My bad didnt mean to post as comment. Reposted as an answer
Christoph Winter
<wallet.dat><address-generation><private-key-import>
After generating my own private key, what's the proper way to add it to official wallet software?
Corey Ogburn
# After generating my own private key, what's the proper way to add it to official wallet software?

(Asked by: username_0 on 2017-08-18)

I've got some Go code that successfully generates private keys and vanity addresses [as described by the wiki](https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses).

So I have all the parameters around the private key but I'm not sure what to do with that info to make it usable by the bitcoin core application.

Should I build a wallet.dat file to point the wallet software at? What's the format for that file? Is there an alternative format so I can import my new key alongside my old keys instead of replacing the existing file so that the software has more control of what the structure of the wallet.dat is?

I could layout the key in the same format that paper wallet QR codes use but I'm not sure what I'd do with that string for a desktop computer to accept it.

What format should I put the raw private key into and where should I put it for wallet software to use it?

**Tags:** wallet.dat, address-generation, private-key-import

> **Comments:**
> **username_0**: That sounds perfect! The second answer calls it [Wallet Import Format or WIF](https://en.bitcoin.it/wiki/Wallet_import_format) and that's 100% what I was after! I guess that makes this question a duplicate. EDIT: they deleted their comment, but not after linking to [this question](https://bitcoin.stackexchange.com/questions/5941/how-do-i-import-a-private-key-into-bitcoin-qt).  
> **username_1**: My bad didnt mean to post as comment. Reposted as an answer  

---

## 1 answers

### Answer by username_1 on 2017-08-18. Score: 1 | Accepted answer

In Core, go to "Help" and "Debug Window". Go to the console and type `importprivkey [key]`. This might also interest you: [How do I import a private key into Bitcoin-Qt?](https://bitcoin.stackexchange.com/questions/5941/how-do-i-import-a-private-key-into-bitcoin-qt)

> **Comments:**
> **username_0**: It might also be worth mentioning [WIF](https://bitcoin.stackexchange.com/questions/5941/how-do-i-import-a-private-key-into-bitcoin-qt) in the answer as for what format that key needs to be in.  

---

