[Ethereum] How to import a plain private key into geth or Mist

go-ethereumimportprivate-key

This is such a basic question, but I can not figure out how to import a plain, unencrypted private key into geth or mist?

I tried geth account import 7[......]bla but it seems this command is always looking for an unencrypted keyfile.

Any ideas?

Best Answer

Paste the key into a text file, save it to disk and use the path to that file with geth account import. Here are some example Windows instructions that might help:

  1. Open Notepad
  2. Paste key into notepad without any extra characters or quotations
  3. Save the file as nothing_special_delete_me.txt at C:\
  4. Run the command, geth account import C:\nothing_special_delete_me.txt
  5. After successful import, delete the file at C:\nothing_special_delete_me.txt

If you do not have geth installed already, do the following steps after step 3, and the continue to step 4:

  • Open command prompt (cmd.exe).
  • Inside the Command Prompt, type the following command to go to the folder containing your Geth.exe file: cd c:\Ethereum-Wallet-win64-0-7-3\resources\node\geth (insert your correct path there)
Related Topic