Bitcoin Forum
April 19, 2024, 02:52:58 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [SOLVED] Invalid private key encoding (code -5)  (Read 4577 times)
pedrog (OP)
Legendary
*
Offline Offline

Activity: 2772
Merit: 1031



View Profile
January 31, 2015, 09:50:34 PM
Last edit: January 31, 2015, 11:16:07 PM by pedrog
 #1

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

1713538378
Hero Member
*
Offline Offline

Posts: 1713538378

View Profile Personal Message (Offline)

Ignore
1713538378
Reply with quote  #2

1713538378
Report to moderator
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713538378
Hero Member
*
Offline Offline

Posts: 1713538378

View Profile Personal Message (Offline)

Ignore
1713538378
Reply with quote  #2

1713538378
Report to moderator
1713538378
Hero Member
*
Offline Offline

Posts: 1713538378

View Profile Personal Message (Offline)

Ignore
1713538378
Reply with quote  #2

1713538378
Report to moderator
1713538378
Hero Member
*
Offline Offline

Posts: 1713538378

View Profile Personal Message (Offline)

Ignore
1713538378
Reply with quote  #2

1713538378
Report to moderator
Blazr
Hero Member
*****
Offline Offline

Activity: 882
Merit: 1005



View Profile
January 31, 2015, 09:53:55 PM
 #2

What is the first character of the private key?

Try importing it without a label:

Code:
importprivkey yourPrivateKeyInWalletImportFormat

pedrog (OP)
Legendary
*
Offline Offline

Activity: 2772
Merit: 1031



View Profile
January 31, 2015, 10:01:51 PM
 #3

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.

shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1499


No I dont escrow anymore.


View Profile WWW
January 31, 2015, 10:05:22 PM
 #4

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

Im not really here, its just your imagination.
Blazr
Hero Member
*****
Offline Offline

Activity: 882
Merit: 1005



View Profile
January 31, 2015, 10:07:31 PM
 #5

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.

pedrog (OP)
Legendary
*
Offline Offline

Activity: 2772
Merit: 1031



View Profile
January 31, 2015, 10: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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!