Post
Topic
Board Bitcoin Technical Support
Re: Need Help Bitcoin Core "private key for address is not known (code -4)"
by
LoyceV
on 01/06/2025, 11:38:33 UTC
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. 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