2

I'm not sure why this is so tough but I can't find easy answer to do what I'm trying to do, which is following:

  1. Generate a new ETH address using passphrase using Geth (I can do this using "geth account new", and I see public key)

  2. It generates a keystore file (which I have after step 1)

  3. All I want to do now is extract public as well as unencrypted private key (I have the file and the passphrase) via command line (either using geth, or openssl or whatever). I can see both after importing it manually using MyEtherWallet but I need to be able to do this for multiple keys so need to do it via command line.

Is there ANY way to do the step 3 without doing it manually using some web interface like MEW?

Thanks in advance.

JT

2

If you have file and password you can use keythereum library.

  const wallet = JSON.parse("<wallet_file>");
  const key = keythereum.recover("<your_password>", wallet);
  console.log(key.privateKey.toString('hex'));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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