infincia / bip39-rs

A Rust implementation of BIP-0039
Apache License 2.0
54 stars 61 forks source link

Investigate how to process uppercase letters #2

Open steveatinfincia opened 7 years ago

steveatinfincia commented 7 years ago

BIP0039 says nothing about case.

The fact that validation/checksum fails by default when any letter is uppercase (word lookup fails, wordlists are necessarily lowercase) is a strong suggestion that it's an error to pass uppercase letters at all, but intuitively it seems like it should be case insensitive and should generate the same seed value lowercase would.

bip32-rs doesn't allow seed generation without validating checksums, but if you didn't look at that checksum before proceeding you would get a different seed due to the fact that pbkdf2 will happily eat whatever it is given.

A simple solution would seem to be forcing all phrases to lowercase when validating and generating seeds, but it may be something library consumers should do instead of the library.