Closed sophoah closed 4 years ago
So I'll document here answers from the dev:
mnemonic words is just the seed used to derive the private key. It should be 12, 15, 18, 21 or 24 . The more words, the more entropy, at the wallet level, we only check : 1) each word is a valid word in mnemonic words dictionary 2) size is 12, 15, 18, 21 or 24 if the check passes, then the wallet just use the mnemonic words as a whole string "xx xx xx ... xx" and hash it, do some transformation to derive the private key, so you will get different keys if you don't input mnemonic words correctly
not only that, even if you input difference number of spaces between mnemonic words, you will get different keys, as the mnemonic string is used, instead of individual words.
mnemonic words is just a way for users to better memorize the password, it is up to the user to make sure the 24 words are correctly input (with only 1 space between them).
if some words are removed, the wallet (hmy cli) will derive different keys...
there's a BIP39 standard for this the code is here https://github.com/harmony-one/go-sdk/blob/25f55e739cec589c098a16bbb575ec467b4018e4/pkg/keys/mnemonic.go#L15
So, it seems it is an expected behavior
Credit goes to our community member @C7Stake who discovered the issue. I was able to replicate here successfully:
24 words
21 words
11 words
is that expected ?