Author

Topic: SOSHow to restore BitcoinCore wallet with passphrase+public address+private key? (Read 156 times)

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-snip-
I am pretty sure my priv key is correct, as i did copy it 3 times on 3 different papers, and they are all the same.
If that's the case, then the error must be a mistook character (eg.: letter case).
There's no way Bitcoin Core will return with that error if the WIF private key is correct.

It's quite easy to check for the wrong character since the WIF private key should only have BASE58 characters which shouldn't contain any I, l (lowercase L), O (uppercase o) or 0 (zero).
See if it has any of those characters and replace them with the similar character from the list below.
It should only have: https://en.bitcoin.it/wiki/Base58Check_encoding#Base58_symbol_chart (strictly case sensitive)
newbie
Activity: 3
Merit: 2
Can you try to check the Bitcoin data folder and maybe you created two wallet.dat with different names.

The default can be found here C:\Users\YourUserName\Appdata\Roaming\Bitcoin or open run and type this %APPDATA%\Bitcoin
Then look for the wallet folder to check if there are other files or make a screenshot of that folder. Let see if you created other wallets with another name.
If I'm right you can open it again with Bitcoin core to find the exact wallet.

This error "Invalid private key encoding (code -5)" usually popups if the private key has a missing character or has a compatibility issue but since you dump the private key on the same version maybe you copied the private key with a missing character. It's just my guess.


"maybe you created two wallet.dat with different names. "---> i am not sure what it means.  
What i did is:
I did created a wallet in the default path earlier last year. Now i deleted the wallet.dat(with a backup file created), and i changed the Bitcoin Core path of datadir to be my portable hard driver, and then restarted the bitcoin Core.. Then i see in the portable Hard driver a new wallet.dat file in the wallet folder.

I am pretty sure my priv key is correct, as i did copy it 3 times on 3 different papers, and they are all the same.

How can i fix all these mess?

Thanks again!

PS: my wallet was pruned with NO blockchain data synced up at all.



legendary
Activity: 3374
Merit: 3095
Playbet.io - Crypto Casino and Sportsbook
Can you try to check the Bitcoin data folder and maybe you created two wallet.dat with different names.

The default can be found here C:\Users\YourUserName\Appdata\Roaming\Bitcoin or open run and type this %APPDATA%\Bitcoin
Then look for the wallet folder to check if there are other files or make a screenshot of that folder. Let see if you created other wallets with another name.
If I'm right you can open it again with Bitcoin core to find the exact wallet.

This error "Invalid private key encoding (code -5)" usually popups if the private key has a missing character or has a compatibility issue but since you dump the private key on the same version maybe you copied the private key with a missing character. It's just my guess.
legendary
Activity: 952
Merit: 1385

Thanks for the help..! This is exactly what i provided in the Console window for privkey importing:
Code:
importprivkey Lx......X
which triggered the error of "Invalid private key encoding (code -5)"


Is it possible that you made a mistake when you were writing the key?
Maybe one or more characters are wrong.
You may go to website: https://iancoleman.io/bitcoin-key-compression/ or if you prefer, download it's source https://github.com/iancoleman/keycompression, disable internet connection and launch file "standalone.html".
Then copy your key into "Input Key" field and see if it is correctly decoded - to the address you expect.

If something is wrong and luckily only 1 or 2 characters are misspelled: You may use my program WifSolver (https://github.com/PawelGorny/WifSolver) - there is worker 'ROTATE' which should find the correct WIF.

legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-snip-
Thanks for the help..! This is exactly what i provided in the Console window for privkey importing:
Code:
importprivkey Lx......X
which triggered the error of "Invalid private key encoding (code -5)"
This is concerning since the error indicates that there's an issue with the provided private key.
My suggestion below will only work if your private keys is valid.

All in all, my goal is to transfer the btc in the legacy address to a hardware wallet. I am open to any solution that is better way to fulfill that, in a safe way.
You can set-up a cold-storage Electrum to fulfill that, create an imported Electrum in your Cold-storage PC and create a watch-only imported Electrum to the online PC.

Here are the simple steps:
  • Download Electrum from electrum.org | I also recommend you to verify its signature: how-to-verify-your-electrum-download
  • Install Electrum on both PC.
  • In the offline PC, create a wallet using the option in the installation wizard: "Import Bitcoin addresses or private keys"
  • Type the private key in the box, click next and finish the set-up, that should create an [imported] wallet.
  • In the online PC, select the same options but paste the address instead. It will create an [imported - watching only] wallet.
  • Wait for the balance to show in the online PC, then create a transaction that sends the funds to your hardware wallet, an advanced preview will display after clicking 'pay->send'.
  • In the advanced transaction preview, click "Export", then "Export to file", a (.psbt) file will be created to the selected directory, transfer it to your offline PC.
  • Back to the offline PC, load the transaction file using Electrum's menu "Tools->Load transaction->From file", the advanced transaction preview will show.
  • Click "Sign" and then use the same export options to export the signed transaction, transfer the signed raw transaction (.txn) to the online PC.
  • Back to the offline PC, use the same load transaction options to load it and in the advanced preview, [review everything especially the output address(es) and fee] click "broadcast" to finally send the transaction to the network.
newbie
Activity: 3
Merit: 2
The script type isn't important when recovering funds in Bitcoin core because it can look for all types when scanning for balance.
So if you've successfully imported the private key, it should be able to restore the previous balance once Bitcoin Core finished the rescan.

PS: tried cmd : importprivkey in the new wallet, it returns error: Invalid private key encoding (code -5)
You shouldn't include the <> in "";
but if you typed it correctly, then you've included invalid characters to your private key. It should start with K or L consisting of 52 characters.
example command:
Code:
importprivkey KxQ1ibqgPztpugBjWBuUrBp1TwbuJnzrNHTzhDrRVyzWScMZBmUp

Question: is your Bitcoin Core fully synced to the network after the reinstall? Have you disabled "prune" settings?


Thanks for the help..! This is exactly what i provided in the Console window for privkey importing:
Code:
importprivkey Lx......X
which triggered the error of "Invalid private key encoding (code -5)"

the thing is, i use this laptop as a COLD wallet, so there is no internet connected to it, and hence it is not synced with the "chain" at all. I have no plan to get it connected to internet to sync up, to keep it COLD(that means, absolutely SAFE).
I have a separate laptop with internet connected , and i also have a portable hard driver.  I was following some guidance via google to send out the btc. The guidance says :
0)both laptops should have bitcoin core wallet installed;
1)use the laptop with internet to sync up the main chain and save all the blockchain data(size is ~380 GB) into the portable hard driver;
2) connect the hard driver to the laptop w/o internet, where i can trigger the "sending" operation with a "request message",
3)then copy the "request message" to the hard driver, and then connect the hard driver back to the laptop with internet, to finish signing the request.
In this way , the signature is fulfilled "offline".
---> it is kinda confusing when i try out the solution and no luck so far...

"Have you disabled "prune" settings?"-->No idea what is that. what is "prune" for?

All in all, my goal is to transfer the btc in the legacy address to a hardware wallet. I am open to any solution that is better way to fulfill that, in a safe way.

Thanks again!!
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
The script type isn't important when recovering funds in Bitcoin core because it can look for all types when scanning for balance.
So if you've successfully imported the private key, it should be able to restore the previous balance once Bitcoin Core finished the rescan.

PS: tried cmd : importprivkey in the new wallet, it returns error: Invalid private key encoding (code -5)
You shouldn't include the <> in "";
but if you typed it correctly, then you've included invalid characters to your private key. It should start with K or L consisting of 52 characters.
example command:
Code:
importprivkey KxQ1ibqgPztpugBjWBuUrBp1TwbuJnzrNHTzhDrRVyzWScMZBmUp

Question: is your Bitcoin Core fully synced to the network after the reinstall? Have you disabled "prune" settings?
newbie
Activity: 3
Merit: 2
Bitcoin Client Software and Version Number:     Bitcoin Core V.20.1

Operating System:   Windows 7

Description of Problem:  I installed Bitcoin Core V0.20.1 wallet in my laptop earlier, and created an address and received some btc to it. After that i saved a paper copy of the public address and its private key. I also encrypted the wallet and i saved the wallet passphrase on paper also. (This laptop has been blocked from internet since then and i have checked via blockchain.com that the btc is still in that address currently.)
Now i need to transfer the btc out from that address to somewhere else. I tried to launch the Bitcoin Core wallet, but seems the legacy wallet.dat file is missed( maybe i did something nasty).
Tried re-install the BitCoin Core wallet, but i just cannot get the legacy wallet back..
So , with the Public Address/Private Key/ Wallet Passphrase all available, is there a way i can get the wallet back, so that i can transfer the btc inside the address to a new address somewhere else?

Help appreciated!


PS: tried cmd : importprivkey in the new wallet, it returns error: Invalid private key encoding (code -5)
Jump to: