21

Just the opposite of this question How to import a plain private key into geth or Mist? I would like to know how can I obtain the private keys of the accounts created with geth in this way:

$ geth --testnet account new

I've been looking for private key files on ~/.ethereum/keystore but there is only one file for coinbase account. No files for the rest of accounts created.

How can I obtain those missing files? Why are they missing? Thx!

I've already seen How can I import geth accounts into eth? but problem is in my system keystore files don't even exist for most of the geth accounts created, except coinbase.

1 Answer 1

11

For test net, the folder you are looking for is ~/.ethereum/testnet/keystore/.

6
  • Thx! Absolutely right. Sep 16, 2016 at 12:22
  • 1
    in case you will use windows check %AppData%\Roaming\Ethereum\testnet\keystore
    – Badr Bellaj
    Sep 16, 2016 at 21:39
  • 4
    On Mac, it's ~/Library/Ethereum/testnet Jul 24, 2017 at 4:57
  • 5
    this answer is incorrect. JSON account file is not the private key. Private key is a 64 byte sequence encoded in HEX.To get this key you have to decrypt the JSON file first.
    – Nulik
    Oct 10, 2018 at 18:56
  • @Nulik and how do you do that?
    – Andyc
    Dec 6, 2021 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.