Created
March 9, 2018 11:31
-
-
Save lakshmankashyap/2b540bdeed764d78c08a50d3cfd1d2a9 to your computer and use it in GitHub Desktop.
Recover Ethereum keystore using the private key and keystore password
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/node | |
// https://github.com/ethereumjs/ethereumjs-wallet | |
// -> npm install ethereumjs-wallet | |
var Wallet = require('ethereumjs-wallet'); | |
var privateKey = '-> your private key here <-'; // in hex format | |
var keystorePassword = '-> your keystore password here <-'; | |
var wallet = Wallet.fromPrivateKey(Buffer.from(privateKey, 'hex')); | |
var keystore = wallet.toV3String(keystorePassword, { n: 1024 }); | |
console.log(keystore); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment