BitBoxSwiss / bitbox02-firmware

Firmware code of the BitBox02 hardware wallet
https://bitbox.swiss/bitbox02
Apache License 2.0
217 stars 81 forks source link

workflow/mnemonic: generalize lastword_choices to 12/18/24 words #1068

Closed benma closed 8 months ago

benma commented 1 year ago

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.

charlespax commented 1 year ago

I'm must here to show my support for this feature.