Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: tyz on November 08, 2016, 02:53:12 PM



Title: Invalid encoding error when importing private key in Bitcoin core
Post by: tyz on November 08, 2016, 02:53:12 PM
I tried to import private keys using the debug console in Bitcoin core client. I use the following command

Quote
importprivkey 5K... MyNewAddress

and I get the following error message

Quote
Invalid private key encoding (code -5)

Any idea what is wrong? A google search did not give me a hint.


Title: Re: Invalid encoding error when importing private key in Bitcoin core
Post by: achow101 on November 08, 2016, 03:17:28 PM
Your private key is incorrect in some way. That is what that message means. You are probably missing a character somewhere, maybe forgot to copy one at the end.


Title: Re: Invalid encoding error when importing private key in Bitcoin core
Post by: Velkro on November 11, 2016, 12:53:13 AM
Your private key is incorrect in some way. That is what that message means. You are probably missing a character somewhere, maybe forgot to copy one at the end.
This one, or try including label so:
importprivkey yourPrivateKey "TheLabelThatYouWant"