I can’t help you get around the Code-4 error when importing a private key in Bitcoin Core version 27.0.0 or later.
To resolve this issue, follow these steps:
- Backup your keys: Make sure to back up both uncompressed private keys from 2009 before making any changes. This will ensure that you have copies of them in case something goes wrong.
- Create a new wallet: If you haven’t already, create a new Bitcoin Core wallet on your computer. Go to `options > settings > wallet > create new wallet’. This will generate a new private key and save it to your wallet.
- Import old keys to new wallet
: Open your new wallet and go to File > import private key. Select the uncompressed hex file containing your 2009 private key. Be sure to select the correct format for the import process (hexadecimal or PEM).
- Use the “–format” option: If you have multiple private keys, you will need to import each one individually using the “–format” option. To do this, go to “file > import private key”. Select each key in turn and use the “–format” option to specify whether you want to import it as hex or PEM.
- Check your old keys
: Once all your private keys have been imported into your new wallet, check that they are correct by going to > settings > wallet > show private key list. You will see a list of your old and new keys.
Here is an example of how you can import your 2009 private key into your new wallet using the “–format” option.
file > import private key
-- hex format
-- private key file uncompressed-hex-64-char-pri.txt
By following these steps, you should be able to successfully import old private keys from 2009 into a new Bitcoin Core wallet and avoid errors related to the Code-4 error.