Bitcoin Forum
May 26, 2024, 10:56:55 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Not able to export my public keys with pywallet  (Read 83 times)
Kratomiseur (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
November 17, 2021, 12:48:24 PM
 #1

Hi Guys,

so I found this old wallet from 2012. Downloaded Bitcoin Core and waited patiently for the blockchain to
sync. Unfortunately Bitcoin Core was running in pruning mode so now it doesnt let me open my wallet.dat, instead
it creates a new one. Since my internet connection is terrible and I dont have enough space on my
harddrive, I wanted to try out pywallet to check, if there is any balances on the wallet.

I installed python and put the wallet.dat and the pywallet.py files in the same folder (C:\Python27\).
Problem is, when I navigate to the folder in cmd and then use the command "python pywallet.py --dumpwallet --datadir=. > wallet.txt"
it creates a .txt that only includes the pywallet options instead of my public keys.

What am I doing wrong? Also, I'm a complete python noob.

Many thanks in advance!  Smiley
PawGo
Legendary
*
Offline Offline

Activity: 952
Merit: 1367


View Profile
November 17, 2021, 01:13:30 PM
Merited by mocacinno (1), ABCbits (1)
 #2

Did not you forget to specify which file should be opened?  Wink
Code:
--datadir=DATADIR     wallet directory (defaults to bitcoin default)
--wallet=WALLETFILE   wallet filename (defaults to wallet.dat)

Something like:
Code:
python pywallet.py --dumpwallet  --datadir=DATADIR --wallet=WALLETFILE 
And do not forget about
Code:
--passphrase=PASSPHRASE
if you have one
Kratomiseur (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
November 17, 2021, 01:21:45 PM
 #3

Hi and thank you so much for your fast reply! That was it, I actually forgot to define which file should be opened  Grin Roll Eyes
So now it seems to have worked as it shows me a bunch of adresses, must be about 50 or more including privates.
So  these are all my adresses? Meaning, if it shows up a balance on one of them, its one of my adresses? Sorry, have
 no idea  Huh Roll Eyes
PawGo
Legendary
*
Offline Offline

Activity: 952
Merit: 1367


View Profile
November 17, 2021, 02:41:36 PM
Last edit: November 20, 2021, 12:42:44 PM by PawGo
Merited by HCP (5)
 #4

Yes.

The best would be to export private keys and import into other client (I would suggest Electrum), to have fully functional wallet.
You may also import only addresses (no priv keys), to create read-only wallet - that way you will see balance, but you will not be able to spend.

HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4316

<insert witty quote here>


View Profile
November 19, 2021, 10:23:41 PM
 #5

So now it seems to have worked as it shows me a bunch of adresses, must be about 50 or more including privates.
So  these are all my adresses? Meaning, if it shows up a balance on one of them, its one of my adresses?
The older (non-HD) Bitcoin Core wallet.dat's would maintain a keypool of around 100 private keys/addresses. Nowadays, the default keypool size is 1000... so it could be worse! Tongue Wink

And yes, they are all addresses that are generated from keys in your wallet.dat file.

As PawGo suggested, the best method to ensure you don't miss anything... is to simply export all] the private keys from your wallet.dat and then import them into another wallet. That way the wallet will be able to find all your coins for you and you won't accidentally miss one.

Note that you will need to get the private keys from your wallet.dat (the "sec" field in the pywallet output is the WIF format private key, "hexsec" and "secret" are hex format)... just importing addresses will mean that you can see the coins, but you can't spend them.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!