-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workflow/mnemonic: generalize lastword_choices to 12/18/24 words #1068
Conversation
82a34bf
to
37c844c
Compare
I'm must here to show my support for this feature. |
727216e
to
22c2dd1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a problem with the implementation, but there are a few suggestions about the comments and messages.
tACK 👍
Ok(choice_idx) if choice_idx as usize == none_of_them_idx => { | ||
let params = confirm::Params { | ||
title: "", | ||
body: "Recovery words\ninvalid.\nRestart?", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A more explanatory warning here could be preferable. One recommendation we discussed with Jad was Invalid. Check\recovery words.\nRestart?
Was quite hard to read as it was such a big function.
The function computed all 8 possible 24th candidate words to make up a valid bip39 mnemonic given the first 23 words. The function is extended to also work with 12 and 18 word mnemonics, returning 128 (resp. 32) possible candidates for the final word. This function can then be used to make the entry of the final word easier for the 12th/18th word by restricting the keyboard to only allow entering from these candidates. This also allows easily importing seeds that were made without computers by rolling dices or similar, helping with the checksum issue, like we do now for 24 word mnemonics.
This will allow to set the autocomplete keyboard to a subset of the BIP39 wordlist to allow entering the last word of a 12/18 word mnemonic using the keyboard, similar to how the 24th word can be entered using a menu. The keyboard is needed for 12/18 words as there are too many candidates to show in a simple menu.
So far we've only been doing this for 24 words, where there are 8 list of valid candidate, so they could be shown in a menu. We do the same for 12/18 words, but since there are many more candidates (128 for 12 words, 32 for 18 words), we restrict the trinary keyboard entry to this list instead of showing them all in a menu. This allows easily importing seeds that were made without computers by rolling dices or similar, helping with the checksum issue, like we do now for 24 word mnemonics. One downside is that if the user has a typo in the previous words, they will be unable to enter the last word as it will be missing from the candidates, which could be confusing. With 24 words, there is an explicit "None of them" entry to tell the user that their words are invalid, but that only works in the menu. With the 12th/18th word still using the keyboard, there is no good way of doing this.
The function computed all 8 possible 24th candidate words to make up a valid bip39 mnemonic given the first 23 words.
The function is extended to also work with 12 and 18 word mnemonics, returning 128 (resp. 32) possible candidates for the final word.
This function can then be used to make the entry of the final word easier for the 12th/18th word by restricting the keyboard to only allow entering from these candidates. This also allows easily importing seeds that were made without computers by rolling dices or similar, helping with the checksum issue, like we do now for 24 word mnemonics.