<p>To export a private key from your Satoshi bitcoin-qt client:</p>

<ol>
<li>launch your bitcoin client as usual and wait for it to load the blockchain and start up</li>
<li>click on 'help' in the menu bar (top right) </li>
<li>click on 'debug window' </li>
<li>select the 'console' tab</li>
<li>type: walletpassphrase "your walletpassphrase here" 600</li>
<li>type: dumpprivkey [your Bitcoin address here] </li>
<li>this will return the private key, you can copy it now; ensure you clear your clipboard/history afterwards</li>
<li>type: walletlock</li>
</ol>

CC BY-SA 3.0
2013-04-08T01:48:16.553Z
This answer would benefit from adding *"How to get your public key"*; as i don't know my public key.
Ian Boyd
CC BY-SA 3.0
2015-10-11T03:21:43.347Z
FYI, if you didn't already encrypt the Bitcoin-QT wallet then skip the walletpassphrase part (line numbered 5. and 8.).
Stephen Gornick
CC BY-SA 3.0
2015-10-11T03:19:45.300Z
The Bitcoin address is what is to be used there.  I've edited it.
Stephen Gornick
CC BY-SA 3.0
2017-08-11T22:02:31.490Z
#5 isnt clear :it tells you to type quote:"walletpassphrase "your walletpassphrase here" 600". unquote which gets you no where.. and number 6 is the same
David Crawford
CC BY-SA 3.0
2017-08-12T02:31:11.153Z
@DavidCrawford: Did you try to replace the three words "your walletpassphrase here" with your wallet passphrase?
Murch
CC BY-SA 3.0
2017-12-24T02:24:57.053Z
@IanBoyd Your addresses are your public keys. View them under the receive tab.
deed02392
CC BY-SA 3.0
2012-12-28T16:54:28.857Z
2015-10-11T03:20:30.850Z
2015-10-11T03:20:30.850Z
rxon
<p><em>Note: Recent versions of the satoshi client offer a 'debug window' which can be used to export private keys.  This is described in <a href="https://bitcoin.stackexchange.com/a/5933/659">Miguel Moreno's answer to this question</a>, and is easier than the steps I describe below.</em></p>

<p>To export a private key from your satoshi client:</p>

<ol>
<li><p>run:  <code>bitcoin-qt -server</code> and wait for it to load the blockchain and start up</p></li>
<li><p>if your wallet is encrypted, run: <code>read -s x; bitcoin-cli walletpassphrase "$x" 600; unset x</code> to unlock it for 600 seconds (type your passphrase after hitting return, then hit return again; this 'read; ...; unset' prevents the password being written to your shell's history file on disk, and the '-s' in read prevents your password being displayed as you type it, and improves protection from screen-loggers and the shell log)</p></li>
<li><p>run this command using bitcoin-cli:  <code>bitcoin-cli dumpprivkey 1my1bitcoin1addres11111</code>   (replace 1my... with the bitcoin address of which you want the private key)</p></li>
<li><p>if your wallet is encrypted and you want to re-lock your wallet, run <code>bitcoin-cli walletlock</code></p></li>
</ol>

CC BY-SA 3.0
2013-12-12T18:36:43.187Z
How to dump all private keys at once?
opengrid
CC BY-SA 3.0
2018-01-22T23:40:14.103Z
@Sun You can use `bitcoind listaddressgroupings` to get all addresses.
user2428118
CC BY-SA 3.0
2018-01-23T16:18:48.810Z
@user2428118 I noticed dumpwallet is a command now in newer versions
Sun
CC BY-SA 3.0
2017-12-12T17:41:12.363Z
@opengrid - I had same question because I'm worried about change address. How do I know all the addresses in a wallet?
Sun
CC BY-SA 4.0
2018-07-03T20:16:58.267Z
It is perhaps a bit safer to use `read -i x` instead.
user1747134
CC BY-SA 3.0
2012-07-19T14:41:57.663Z
What if I've encrypted my wallet?
Stephen Gornick
CC BY-SA 3.0
2012-07-19T18:02:07.243Z
Good point.  I updated my answer to mention that.
Chris Moore
CC BY-SA 3.0
2012-09-15T12:37:09.577Z
I guess you do the "read x ..." shell stuff to prevent the shell writing your password to a history file. I think that's worth mentioning.
Jürgen Strobel
CC BY-SA 3.0
2012-09-16T03:26:25.193Z
Yes, that's exactly why.  I don't want my password being written to disk.
Chris Moore
CC BY-SA 3.0
2012-07-18T23:05:38.107Z
2018-03-18T02:45:26.230Z
2018-03-18T02:45:26.230Z
Chris Moore
<p>If I want to transfer an address from the satoshi client into a different client, how can I find its private key to do so?</p>

CC BY-SA 3.0
2012-09-30T01:06:12.623Z
Related question, if you don't know the address, how to export all: http://bitcoin.stackexchange.com/questions/4632
Stephen Gornick
<client><bitcoin-core><private-key>
How can I export the private key for an address from the satoshi client?
Chris Moore
# How can I export the private key for an address from the satoshi client?

(Asked by: username_0 on 2012-07-18)

If I want to transfer an address from the satoshi client into a different client, how can I find its private key to do so?

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

> **Comments:**
> **username_1**: Related question, if you don't know the address, how to export all: http://bitcoin.stackexchange.com/questions/4632  

---

## 2 answers

### Answer by username_0 on 2012-07-18. Score: 16 | Accepted answer

*Note: Recent versions of the satoshi client offer a 'debug window' which can be used to export private keys. This is described in [Miguel Moreno's answer to this question](https://bitcoin.stackexchange.com/a/5933/659), and is easier than the steps I describe below.*

To export a private key from your satoshi client:

1. run: `bitcoin-qt -server` and wait for it to load the blockchain and start up
2. if your wallet is encrypted, run: `read -s x; bitcoin-cli walletpassphrase "$x" 600; unset x` to unlock it for 600 seconds (type your passphrase after hitting return, then hit return again; this 'read; ...; unset' prevents the password being written to your shell's history file on disk, and the '-s' in read prevents your password being displayed as you type it, and improves protection from screen-loggers and the shell log)
3. run this command using bitcoin-cli: `bitcoin-cli dumpprivkey 1my1bitcoin1addres11111` (replace 1my... with the bitcoin address of which you want the private key)
4. if your wallet is encrypted and you want to re-lock your wallet, run `bitcoin-cli walletlock`

> **Comments:**
> **username_1**: What if I've encrypted my wallet?  
> **username_0**: Good point.  I updated my answer to mention that.  
> **username_11**: I guess you do the "read x ..." shell stuff to prevent the shell writing your password to a history file. I think that's worth mentioning.  
> **username_0**: Yes, that's exactly why.  I don't want my password being written to disk.  
> **username_7**: How to dump all private keys at once?  
> **username_9**: @username_7 - I had same question because I'm worried about change address. How do I know all the addresses in a wallet?  
> **username_8**: @username_9 You can use `bitcoind listaddressgroupings` to get all addresses.  
> **username_9**: @username_8 I noticed dumpwallet is a command now in newer versions  
> **username_10**: It is perhaps a bit safer to use `read -i x` instead.  

---

### Answer by username_2 on 2012-12-28. Score: 48

To export a private key from your Satoshi bitcoin-qt client:

1. launch your bitcoin client as usual and wait for it to load the blockchain and start up
2. click on 'help' in the menu bar (top right)
3. click on 'debug window'
4. select the 'console' tab
5. type: walletpassphrase "your walletpassphrase here" 600
6. type: dumpprivkey [your Bitcoin address here]
7. this will return the private key, you can copy it now; ensure you clear your clipboard/history afterwards
8. type: walletlock

> **Comments:**
> **username_3**: This answer would benefit from adding *"How to get your public key"*; as i don't know my public key.  
> **username_1**: The Bitcoin address is what is to be used there.  I've edited it.  
> **username_1**: FYI, if you didn't already encrypt the Bitcoin-QT wallet then skip the walletpassphrase part (line numbered 5. and 8.).  
> **username_4**: #5 isnt clear :it tells you to type quote:"walletpassphrase "your walletpassphrase here" 600". unquote which gets you no where.. and number 6 is the same  
> **username_5**: @username_4: Did you try to replace the three words "your walletpassphrase here" with your wallet passphrase?  
> **username_6**: @username_3 Your addresses are your public keys. View them under the receive tab.  

---

