Open placer14 opened 5 years ago
Related to #1397
It is standard practice to accept any string as a mnemonic and not force it to be a specific string. This allows users to use a custom seed .. such as one with more entropy if they want.
I wasn't aware of this practice. Then what is the point of the Valid check in the mnemonic package? Should we raise a warning while still accepting the "invalid" input?
Currently, any amount of entropy can be passed in to generate a new identity seed. To prevent the user from accidentally using an invalid mnemonic, we should validate the mnemonic against the bip39 package we use in ob-go instead of assuming it's valid.
Todo:
bip39.NewSeed
to usebip39.NewSeedWithErrorChecking
and properly handle errorsInputs to patch:
cmd/start.go
accepts as a parsed flagcmd/restore.go
accepts as a parsed flagcmd/init.go
accepts as a parsed flagschema/manager.go
should handle this validation as wellmobile/node.go
accepts as argwallet/builder.go
appears to process it, unsure if validation is required here