Created
July 29, 2018 19:00
-
-
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.
This file contains 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
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