web3 version 1.x has the decrypt method, which decrypts a keystore v3 JSON.

By using it the following way, I can get the private key easily:

web3.eth.accounts.decrypt(keystoreJsonV3, password);

But how to get the private key with web3 version 0.2.x ?


Web3 v0.20.xx doesn't have such functionality. You can use a third party library like Ethereumjs Wallet.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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