4

I am trying to take the encrypted keyfile from icebox and import into Geth. However I am coming up with this error when I try

geth account import icebox.txt

Fatal: Failed to load the private key: encoding/hex: invalid byte: U+007B '{'

The keystore file is a v2 keystore file. I would import via something like myetherwallet but there is no v2 compatibility. I was told that geth still had compatibility to import v2 keystore files and automatically import them into v3.

The reason I am trying to do this is to get my private key for this account. So, if anyone knows another way to get a private key from a v2 keystore file (like found in icebox) that solution would work too.

q9f
  • 32,913
  • 47
  • 156
  • 395
Amazing
  • 352
  • 2
  • 12

2 Answers2

1

Oh hey. You know what I just realized. You have it in your keystore folder and can see it in the accounts list in geth right? What if you then do:

> eth account update [<uuid>|<address> , ... ] // Decrypt and re-encrypt given keys.

Source

That will prompt for a new password I believe and therefore re-encrypt and hopefully re-encrypt with v3 of the JSON?

You know what would be even easier? If MyEtherWallet just supported v2 of JSONs! I've added it to the to-do list but, life is crazy right now. Maybe we can push with HF stuff.

tayvano
  • 15,961
  • 4
  • 45
  • 74
  • No, unfortunately I can't see the file in the accounts list in geth. I think I just can't use icebox until they have v3 capability because I have no way to find my private key from their encrypted keystore. – Amazing Jul 20 '16 at 10:29
0

You can use pyicebox to extract a geth compatible keyfile from a given mnemonic.

Follow these steps:

  1. download https://github.com/badmofo/pyicebox/blob/master/icebox.py
  2. install dependencies: pip install mnemonic scrypt bitcoin ethereum
  3. extract private keys: python icebox.py keys, enter your mnemonic
  4. export keyfile: python icebox.py export, enter the corresponding key
luclu
  • 141
  • 1
  • 4