bitpay / bitcore-mnemonic

BIP39 Mnemonics implemented for Bitcore
http://bitcore.io
MIT License
155 stars 212 forks source link

From seed to mnemonic not possible ? #51

Open rllola opened 7 years ago

rllola commented 7 years ago

Hello,

I have so master seed that I want to translate into a mnemonic so I can enter it in a device. I tried to generate a new Mnemonic from a seed but the result is different. I am doing it wrong or it is just simply not possible ?

> var code = new Mnemonic()
undefined
> code
<Mnemonic: echo visual paddle amount craft art ticket receive guard slender promote edge >
> code.toSeed()
<Buffer 55 f9 2e 68 c3 32 01 14 6f 8e ab e2 2d 1c  ... >
> new Mnemonic(code.toSeed())
<Mnemonic: field siren olive major cactus mechanic sail ... >
dabura667 commented 7 years ago

Not possible.

.toSeed() runs hashing algorithms that are irreversible.

However, if you would like to generate 16 bytes of random bytes and store that, you can store those 16 bytes and use that to re-generate the same 12 word phrase over and over.

But there is no way to turn the result of .toSeed() back into its original phrase