Skip to content

Commit 9830de1

Browse files
authored
fixing wallet dumps
CandidateBlock
1 parent 5706618 commit 9830de1

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

03_3_Setting_Up_Your_Wallet.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,43 +76,41 @@ Invalid address
7676

7777
## Optional: Dump Your Wallet
7878

79-
It might seem dangerous having all of your irreplaceable private keys in a single file. That's what `bitcoin-cli backupwallet` is for. It lets you make a copy of your wallet.dat:
79+
It might seem dangerous having all of your irreplaceable private keys in a single file. That's what `bitcoin-cli dumpwallet` is for. It lets you make a copy of your wallet.dat:
8080
```
81-
$ bitcoin-cli backupwallet ~/backup.dat
81+
$ bitcoin-cli dumpwallet ~/mywallet.txt
8282
```
83+
The `mywallet.txt` file in your home directory will have a long list of private keys, addresses, and other information. Mind you, you'd never want to put this data out in a plain text file on a Bitcoin setup with real funds!
84+
8385
You can then recover it with `bitcoin-cli importwallet`.
8486
```
85-
$ bitcoin-cli importwallet backup.dat
87+
$ bitcoin-cli importwallet ~/mywallet.txt
8688
```
8789
But note this requires an unpruned node!
8890
```
89-
$ bitcoin-cli importwallet ~/backup.dat
91+
$ bitcoin-cli importwallet ~/mywallet.txt
9092
error code: -4
9193
error message:
9294
Importing wallets is disabled when blocks are pruned
9395
```
9496

9597
## Optional: View Your Private Keys
9698

97-
Sometimes, you might want to actually look at the private keys associated with your Bitcoin addresses. Perhaps you want to be able to sign a message or spend bitcoins from a different machine. Perhaps you just want to back up certain important private keys.
98-
99-
To look at _all_ the keys in your wallet, type `bitcoin-cli dumpwallet ~/mywallet.txt`.
99+
Sometimes, you might want to actually look at the private keys associated with your Bitcoin addresses. Perhaps you want to be able to sign a message or spend bitcoins from a different machine. Perhaps you just want to back up certain important private keys. You can also do this with your dump file, since it's human readable.
100100
```
101101
$ bitcoin-cli dumpwallet ~/mywallet.txt
102102
{
103103
"filename": "/home/standup/mywallet.txt"
104104
}
105105
```
106-
This will create a `mywallet.txt` file in your home directory with a long list of private keys, addresses, and other information. Mind you, you'd never want to put this data out in a plain text file on a Bitcoin setup with real funds!
107-
108106
More likely, you just want to look at the private key associated with a specific address. This can be done with the `bitcoin-cli dumpprivkey` command.
109107
```
110108
$ bitcoin-cli dumpprivkey "moKVV6XEhfrBCE3QCYq6ppT7AaMF8KsZ1B"
111109
cTv75T4B3NsG92tdSxSfzhuaGrzrmc1rJjLKscoQZXqNRs5tpYhH
112110
```
113111
You can then save that key somewhere safe, preferably somewhere not connected to the internet.
114112

115-
You can import any private key, from a wallet dump or an individual key dump, as follows:
113+
You can also import any private key, from a wallet dump or an individual key dump, as follows:
116114
```
117115
$ bitcoin-cli importprivkey cW4s4MdW7BkUmqiKgYzSJdmvnzq8QDrf6gszPMC7eLmfcdoRHtHh
118116
```

0 commit comments

Comments
 (0)