leather-io / desktop

Manage STX tokens and Stacking
https://leather.io/
192 stars 71 forks source link

Add link to FAQ for BIP-39 error during Secret Key entry #584

Open markmhendrickson opened 3 years ago

markmhendrickson commented 3 years ago

A user has reported that they see a Not a valid bip39 mnemonic error message when entering their 24-word Trezor recovery phrase in software mode with v4.0.4 that was previously used with the v3.x wallet.

I've inquired about the operating system they're using. This seems possibly related to the change made in https://github.com/blockstack/stacks-wallet/issues/239.

markmhendrickson commented 3 years ago

@kyranjamie @timstackblock Is there any additional information from the user you think might be helpful in diagnosing this behavior?

kyranjamie commented 3 years ago

I'm not sure what to recommend. The input mnemonic is validated against bip39.

I'd recommend the user trying to enter their seed phrase with the following formatting, incase it's the formatting that's breaking:

If it's a technically proficient user, they themselves should validate if it's valid bip39 or not.

aseoconnor commented 3 years ago

I'm the user who reported the issue. I'm using a brand new MacBook pro (m1 chip) on macOS 11.0.1.

I've validated that this key phrase is correct with my trezor. I also ordered a new ledger to see if I can transfer my stacks there and avoid this issue.

kyranjamie commented 3 years ago

Thanks @aseoconnor, let us know how it goes. This is not a particularly easy one to debug.

fluidvoice commented 3 years ago

There is one user on Telegram claiming same error. They are just using the Windows wallet without any hardware wallet. They say the seed phrase works on v3.1.1 but not on any of the v4 releases. https://t.me/BlockstackChat/224684

stackatron commented 3 years ago

Can we test this scenario just to confirm we can't reproduce it? Also, one permutation that could get to this state is if they are using the 25th word as well?

markmhendrickson commented 3 years ago

@aseoconnor Mind double checking that the phrase you tried entering from your Trezor has exactly 12 or 24 words?

markmhendrickson commented 3 years ago

There is one user on Telegram claiming same error. They are just using the Windows wallet without any hardware wallet. They say the seed phrase works on v3.1.1 but not on any of the v4 releases. https://t.me/BlockstackChat/224684

I've asked this user to email me so we can confirm if it's the same behavior initially reported with this issue.

fluidvoice commented 3 years ago

There is one user on Telegram claiming same error. They are just using the Windows wallet without any hardware wallet. They say the seed phrase works on v3.1.1 but not on any of the v4 releases. https://t.me/BlockstackChat/224684

I've asked this user to email me so we can confirm if it's the same behavior initially reported with this issue.

@markmhx This problem was reported on Telegram again with v4.1 wallet (no trezor) w/same error "Not a valid bip39 mnemonic" when the seed is typed in. Typing the seed into a text editor first then copy-pasting into the wallet worked. telegram thread >> https://t.me/BlockstackChat/229595 (user @Sitoshhi)

markmhendrickson commented 3 years ago

Typing the seed into a text editor first then copy-pasting into the wallet worked.

Hmm might that suggest an issue with whitespace, which somehow the text editor copy/paste step resolves? 🤔

markmhendrickson commented 3 years ago

I'm moving into the backlog and assigning @timstackblock so he can attempt to recreate soon.

markmhendrickson commented 3 years ago

Note for anyone who encounters this error message:

Please double check that all the exact words you've entered are found in the following list and doesn't consist of any others: https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt

markmhendrickson commented 3 years ago

@kyranjamie Are non-English words compatible as well as long as they're provided here for BIP-39? https://github.com/bitcoin/bips/tree/master/bip-0039

markmhendrickson commented 3 years ago

I'm modifying this issue to add a learn more link to the BIP-39 error message, which goes to:

https://www.hiro.so/questions/what-are-secret-keys-and-how-do-they-work#Secret%20Keys%20must%20be%20BIP39%20compatible

Let's update the error copy in general as well while we're at it:

Your Secret Key entry is not BIP39 compatible. Learn more

image

kyranjamie commented 3 years ago

Are non-English words compatible as well as long as they're provided here for BIP-39? @markmhx No.

I wasn't sure though. Also, I noticed this in the bip39 readme, https://github.com/bitcoinjs/bip39#reminder-for-developers

Ref: https://iancoleman.io/bip39/#spanish

markmhendrickson commented 3 years ago

Would it be easier to add all language word lists or the "warning and proceed" approach recommended by that first link?

timstackblock commented 3 years ago

This worked for me without an issue, just typed everything in and it opened the wallet. I did get an error the first time but it was because I missed a word

video of me doing this: http://somup.com/crenoJDJxW

kyranjamie commented 3 years ago

Would it be easier to add all language word lists or the "warning and proceed" approach recommended by that first link?

@markmhx Has anyone asked for this? It would complicate things, and I'm not sure why we'd do it when we generate english words.

markmhendrickson commented 3 years ago

@kyranjamie Nope, no requests yet. If it's not an easy change, I agree we can wait until someone says they need non-English entry for some reason. I'll update the FAQ.

tahamin26 commented 3 years ago

I can confirm this bug for both on Ubuntu and Windows 4.1.0 wallets. I have checked all the words against BIP-0039 English words. I have copied from a plain text file with only single white spaced between them.

kyranjamie commented 3 years ago

@ghostshirt Can you clarify where the seed came from? Is it also the same phrase as from a Trezor device?

tahamin26 commented 3 years ago

@kyranjamie Seed came from an earlier wallet long before 2.0, mainnet STX on it. 24-word seed. I've just downloaded the newest wallets and tested them to no avail. I'll try with 3.0 version wallet on a Windows box later.

kyranjamie commented 3 years ago

@ghostshirt This is a tricky one to debug. As far as I'm aware, we've never generated non-bip39 compliant seeds.

Do you have the STX CLI installed? This doesn't validate for bip39 compliance. You can derive your address from your seed using stx make_keychain "your seed phrase" command. Does this result in the address you expect?

tahamin26 commented 3 years ago

@kyranjamie Yes, this works (stx make_keychain command).

kyranjamie commented 3 years ago

Thanks @ghostshirt, that's really helpful to know.

@yknl any insights here? Did the old wallet previously not generate bip39 compliant seeds? Did it accept seeds for restore without checking for bip39 compliance?

yknl commented 3 years ago

The wallet has generated bip39 seed phrases since v1.0 See https://github.com/blockstack/stacks-wallet/blob/v1.0.0/app/actions/wallet.js#L84