Skip to content

Instantly share code, notes, and snippets.

@hm0429
Created March 11, 2018 01:22
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 hm0429/83694f9faef83cc234c8ff0504544ccf to your computer and use it in GitHub Desktop.
Save hm0429/83694f9faef83cc234c8ff0504544ccf to your computer and use it in GitHub Desktop.
var Wallet = require('ethereumjs-wallet');
// 新たなウォレットを生成
const wallet = Wallet.generate();
// ウォレットの秘密鍵を取得
const privateKey = wallet.getPrivateKeyString();
console.log(privateKey);
// ウォレットの公開鍵を取得
const publicKey = wallet.getPublicKeyString();
console.log(publicKey);
// ウォレットのアドレスを取得
const address = wallet.getAddressString();
console.log(address);
// keystore の名前を取得
const keystoreFilename = wallet.getV3Filename();
console.log(keystoreFilename);
// keystore (JSONフォーマット) を取得
const keystore = wallet.toV3("PASSWORD");
console.log(keystore);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment