Author

Topic: [SOLVED] Invalid private key encoding (code -5) (Read 4609 times)

legendary
Activity: 2786
Merit: 1031
January 31, 2015, 05:13:24 PM
#6
I have two keys to import, one starts with 'D' the other with 'C', same error with both.

Your private keys aren't in Wallet Import Format, they are base58 which doesn't work with Bitcoin Core.

On blockchain.info, go to import/export > export unencrypted and on the dropdown "select private key format" select "Bitcoin-Qt Format". They should begin with 5, K or L.

That's it!!!

Thanks Blazr and shorena for your help.
hero member
Activity: 882
Merit: 1006
I have two keys to import, one starts with 'D' the other with 'C', same error with both.

Your private keys aren't in Wallet Import Format, they are base58 which doesn't work with Bitcoin Core.

On blockchain.info, go to import/export > export unencrypted and on the dropdown "select private key format" select "Bitcoin-Qt Format". They should begin with 5, K or L.

I have no idea why blockchain.info uses base58 as the default format, they really should change that to WIF. Almost no clients use base58.
copper member
Activity: 1498
Merit: 1528
No I dont escrow anymore.
What is the first character of the private key?

Try importing it without a label:

Code:
importprivkey yourPrivateKeyInWalletImportFormat

I've tried that.

I have two keys to import, one starts with 'D' the other with 'C', same error with both.

Do they end with "==" or "="? It might be encrypted.

Quote
For private keys associated with uncompressed public keys, they are 51 characters and always start with the number 5 on mainnet (9 on testnet). Private keys associated with compressed public keys are 52 characters and start with a capital L or K on mainnet (c on testnet).

https://en.bitcoin.it/wiki/Private_key
legendary
Activity: 2786
Merit: 1031
What is the first character of the private key?

Try importing it without a label:

Code:
importprivkey yourPrivateKeyInWalletImportFormat

I've tried that.

I have two keys to import, one starts with 'D' the other with 'C', same error with both.
hero member
Activity: 882
Merit: 1006
What is the first character of the private key?

Try importing it without a label:

Code:
importprivkey yourPrivateKeyInWalletImportFormat
legendary
Activity: 2786
Merit: 1031
When trying to import a private key in Bitcoin core v0.10.0rc1 I'm getting:

Invalid private key encoding (code -5)

Address was generated at Blockchain.info.

I'm trying to import the address with:

Code:
importprivkey yourPrivateKeyInWalletImportFormat "TheLabelThatIWant"

As described here: https://en.bitcoin.it/wiki/How_to_import_private_keys_v7%2B
Jump to: