I'm probably missing something fundamental... I expected address.NewMnemonic() and address.MnemonicToByteArray() to be the inverse of one another.
seed, err := address.GenerateSeed(address.RecommendedSeedLen)
mnemonic, err := address.NewMnemonic(seed)
sanity, err := address.MnemonicToByteArray(mnemonic)
if !bytes.Equal(seed, sanity) {
log.Panic("Seed sanity check failed.")
}
In the above code, sanity has more bytes than seed. I suspect this has to do with checksum added in NewMnemonic(), but I'm not certain.
I'm wondering how can I get back the bytes that I originally passed into NewMnemonic() ?
Thanks for any help.