Closed johnconger closed 6 years ago
You should probably hash with something after the mnemonic seed to make sure it is both the correct size and unique to EOS..
This is more like a spec, you could just take part of this and use it: https://github.com/EOSIO/eosjs-ecc/issues/7#issuecomment-383617273
Could use this one for EOS keys?
const hdkey = require('hdkey') const wif = require('wif') const ecc = require('eosjs-ecc') const bip39 = require('bip39') const mnemonic = 'real flame win provide layer trigger soda erode upset rate beef wrist fame design merit' const seed = bip39.mnemonicToSeedHex(mnemonic) const master = hdkey.fromMasterSeed(Buffer(seed, 'hex')) const node = master.derive("m/44'/194'/0'/0/0") console.log("publicKey: "+ecc.PublicKey(node._publicKey).toString()) console.log("privateKey: "+wif.encode(128, node._privateKey, false))
result: publicKey: EOS61oRAVkx1rqPM8mEsBZxPAFAa9Nm6kLa7mQs6mRKTsRTFQaad7 privateKey: 5KX4T16FtxG9LvRJukA31TP9BKq3jYve3xQ3Px3ui8mzuJ7nUYE
In my opinion, HD Keys are better suited for change addresses. EOS does not have change addresses.
could use this one to generate EOS keys for EOSTM Token Distribution?
Up, I have the same question.
The above code creates a consistent Address & Private Key, but when passing my seed into the Buffer I get a warning message that my buffer is 64 bytes and the fromBuffer() is expecting 32. I can see from this post: https://github.com/EOSIO/eosjs-ecc/issues/7 that I need to divide my seed into a chain code? but I don't see how that is possible.