Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: nick80 on April 10, 2014, 10:13:54 PM



Title: Need Help Bitcoin Core "private key for address is not known (code -4)"
Post by: nick80 on April 10, 2014, 10:13:54 PM
Need some help.

Downloaded the newest bitcoin core
Running windows 8.1
Fully synced blockchain
Put my wallet.dat in place


doing the following in bitcoin console,

walletpassphrase "password" 1000

dumpprivkey "address"

and get error saying Private Key for Address ****** is not known (code -4)


I have searched everywhere and read every thread with no solution. I have a wallet.dat file with a couple Receiving addresses, if anyone has any suggestions please let me know.

Unfortunately my skills are limited so I don't really know how to use pywallet, but don't see why bitcoin core would not be able to dump privkey, but if someone has step by step of what to do for pywallet on windows or MAC OSX 10.9 I would appreciate that, Im a noob and don't understand the threads about pywallet,

Thank you in advanced.


Title: Re: Need Help Bitcoin Core "private key for address is not known (code -4)"
Post by: Dare on April 10, 2014, 10:38:55 PM
Need some help.

Downloaded the newest bitcoin core
Running windows 8.1
Fully synced blockchain
Put my wallet.dat in place


doing the following in bitcoin console,

walletpassphrase "password" 1000

dumpprivkey "address"

and get error saying Private Key for Address ****** is not known (code -4)


I have searched everywhere and read every thread with no solution. I have a wallet.dat file with a couple Receiving addresses, if anyone has any suggestions please let me know.

Unfortunately my skills are limited so I don't really know how to use pywallet, but don't see why bitcoin core would not be able to dump privkey, but if someone has step by step of what to do for pywallet on windows or MAC OSX 10.9 I would appreciate that, Im a noob and don't understand the threads about pywallet,

Thank you in advanced.

Are you sure you copied the address correctly, and that it's in that wallet? A missed letter or digit would cause this error, as would attempting to dump the key for an address in a different wallet.


Title: Re: Need Help Bitcoin Core "private key for address is not known (code -4)"
Post by: Abdussamad on April 10, 2014, 10:42:43 PM
Usually this means that the wallet was not unlocked because you entered the wrong password. My suggestion is to run bitcoin-qt (the GUI version), pick an address and try to sign a message with that address. You will be asked to unlock the wallet then and at that point if you manage to unlock it and sign a message you know you have the right password. Then you can try to dump the priv key in the console.


Title: Re: Need Help Bitcoin Core "private key for address is not known (code -4)"
Post by: mot477 on June 01, 2025, 10:38:25 AM
Hello,
Same problem for me too and i know the password is correct. I get "null" in bitcoin core when I execute "walletpassphrase" command.
Any suggestions?


Title: Re: Need Help Bitcoin Core "private key for address is not known (code -4)"
Post by: LoyceV on June 01, 2025, 11:38:33 AM
Same problem for me too and i know the password is correct. I get "null" in bitcoin core when I execute "walletpassphrase" command.
That's normal: it worked. Just continue what you wanted to do.

You did just reply to a post from 11 years ago.
I hate it when I miss that :(


Title: Re: Need Help Bitcoin Core "private key for address is not known (code -4)"
Post by: DaveF on June 01, 2025, 01:57:31 PM
and get error saying Private Key for Address ****** is not known (code -4)
You probably created a descriptor wallet. I understand there are good reasons for Bitcoin Core to switch, but I find it annoying to deal with. Getting a private key is a lot of work.

I'm not even sure if the latest version still allows non-descriptor wallets, so I just used version 26.1 (https://bitcointalk.org/index.php?topic=5543560.0). That link shows how I did it from the command line. In short:
Code:
~/bitcoin-26.1/bin/bitcoind -noconnect -deprecatedrpc=create_bdb -datadir=/dev/shm/bitcoin
sleep 5 #wait a few seconds
~/bitcoin-26.1/bin/bitcoin-cli -named -datadir=/dev/shm/bitcoin createwallet qr descriptors=false
~/bitcoin-26.1/bin/bitcoin-cli -datadir=/dev/shm/bitcoin getnewaddress

Running windows 8.1
Are you sure you want to be using outdated Windows software for this?

Same problem for me too and i know the password is correct. I get "null" in bitcoin core when I execute "walletpassphrase" command.
That's normal: it worked. Just continue what you wanted to do.

You did just reply to a post from 11 years ago. The last reply from mot477 was a necro-bump.

Hello,
Same problem for me too and i know the password is correct. I get "null" in bitcoin core when I execute "walletpassphrase" command.
Any suggestions?

What happens when you try to send?
Null is the proper response as @LoyceV said.

https://bitcoincore.org/en/doc/0.20.0/rpc/wallet/walletpassphrase/

-Dave