Skip to content

Instantly share code, notes, and snippets.

@jamesboehmer
Created July 29, 2018 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesboehmer/27c3a172319e7835c9888c45301af6e8 to your computer and use it in GitHub Desktop.
Save jamesboehmer/27c3a172319e7835c9888c45301af6e8 to your computer and use it in GitHub Desktop.
Node script to convert an Etherium private key to an EOS private key.
Eos = require('eosjs');
var ethPrivateKey=process.argv[process.argv.length-1];
if (ethPrivateKey.length!=64) {
console.error("Usage:", process.argv0, "{ETH Private Key}" );
process.exit(1);
}
eosPrivateKey = Eos.modules.ecc.PrivateKey.fromHex(Buffer.from(ethPrivateKey, 'hex')).toString();
console.log("EOS Private Key:", eosPrivateKey);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment