Created
October 22, 2018 07:32
-
-
Save hyunsikjeong/8497002729b420e4d0e860290934ea4b to your computer and use it in GitHub Desktop.
blog_keystore_hdw_example.js
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
var keystore = require("codechain-keystore"); | |
var CCKey = keystore.CCKey; | |
async function main() { | |
var passphrase = "codechain"; | |
var cckey = await CCKey.create({ dbType: "in-memory" }); | |
console.log(cckey); | |
var seedHash = await cckey.hdwseed.createSeed({ passphrase }); | |
console.log(`Created a seed with hash: ${seedHash}`); | |
var publicKey = await cckey.hdwseed.getPublicKeyFromSeed({ | |
seedHash, | |
path: "m/1/2/3", | |
passphrase | |
}); | |
console.log(`Created a public key from the hash with the path "m/1/2/3": ${publicKey}`); | |
} | |
main().catch(console.error); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment