simpleledger / Electron-Cash-SLP

Electron Cash for SLP Tokens
https://simpleledger.cash/project/electron-cash-slp-edition/
MIT License
67 stars 53 forks source link

Restore from seed input should be converted to all lowercase #102

Closed jcramer closed 5 years ago

jcramer commented 5 years ago

A user was having trouble restoring seed because the entered text is not automatically converted to lowercase characters before checking for valid seed.

cculianu commented 5 years ago

I am not sure what to think of this. Maybe warn the user but don't force lowercase? I remember reading in the BIP39 that basically any freeform string can potentially be a seed -- and any string in any language and any character set.

Like BIP39 leaves room for "unknown" words and just lets you proceed anyway with calculating the numeric seed based on the unicode codepoint values.

So perhaps "forcing" lowercase unconditionally might annoy some future users?

Like I can see it at least asking "hey-- you typed a mixed case seed. that's suspicious -- are you sure? want me to convert to lowercase for you? it matches a lowercase seed fine!"

That might be more useful than a unilateral forced conversion to Catholicism? Idk. My two cents.

jcramer commented 5 years ago

My approach was simply to run "to lower" method when checking the seed. So the user could type in all caps or just capitalized words and the seed would still work without the user knowing otherwise. Based on the user's report, his seed worked in mainline, but not in SLP edition, so my assumption was that mainline must already behave this way.

cculianu commented 5 years ago

Yeah ok do it that way. Just saying you may be sacrificing some flexibility by restricting it to all lowercase.

In the real world right now no seeds use mixed case so it would work, for sure.

I am just saying strictly speaking one COULD have a seed of mixed case in some imaginary nerd masturbation scenario.

Yeah, go ahead and force lowercase if you are fine with that reality. :P

jcramer commented 5 years ago

resolved in d5eed6c.