cosmostation / keystation

🔑 Keystation - decentralized keychain-bassed authenticator enables browsing blockchains built with Cosmos SDK
https://keystation.cosmostation.io/
125 stars 57 forks source link

Mnemonic import error on the latest version #6

Closed fadeev closed 4 years ago

fadeev commented 4 years ago

Describe the bug

In April I used a 12-word mnemonic to import a wallet in Keystation. Everything went well. When I'm trying to import the same wallet right now it raises an error Invalid mnemonics checksum error.

To Reproduce

I decided to try it out locally and in edaf7de536d2e40dd6c3e9f9534f7e692864c5b4 (Feb) it imports fine, in 3f6879a358a473990720ae3740dc8cf1f498cd6a (May) it doesn't.

The same mnemonic gets imported on one version of Keystation and doesn't on a newer one. I'm blocked out of my wallet.

Can you give some pointers on how to run Keystation locally? (version edaf7de536d2e40dd6c3e9f9534f7e692864c5b4)

Booyoun-Kim commented 4 years ago

When importing mnemonic phrase into the Keystation, the checksum function should have been inserted first, but the checksum function was omitted in the early version. As a result, some users sometimes import and use an invalid mnemonic (like a mnemonic line break that I did not intend) was added. If the checksum is simply inserted, the address used by the initial user cannot be accessed. For the early users, I created a option parameter that to skip checksum. I have created an escape url path so that users can use it by importing invalid mnemonics.

https://github.com/cosmostation/keystation/commit/15ba04e00a7d06bbab9c534ba0f8ebe278c73f90

If disablechecksum is included in the option param, the invalid mnemonic can be used without cleanMnemonics().

The explanation was complicated, but anyway, here's how to skip the checksum.

  1. Connect to Cosmostation Web Wallet.

  2. Click the [Connect Wallet] button and click [Connect to Keystation].

  3. When the Keystation Sign In screen appears, click the lower left part. (If you place the mouse near the corner, it turns into a finger shape. This is a function that simply attaches &option=disablechecksum to the import screen.)

  4. By skipping the existing checksum, you can use an invalid mnemonic.

This is the confusion caused by not adding the checksum function to the Keystation initially. I will be careful with development so that this problem does not occur next time. Please let me know if you don't understand.

To run Keystation in local, you need to install google-cloud-sdk. Installation can be found here. https://cloud.google.com/appengine/docs/standard/go/quickstart

And you can run it locally with "$ go run main.go" and check it at localhost:8080. In this case, you need to change the JavaScript code inside the Keystation to localhost:8080 instead of keystation.cosmostation.io. I commented it out in the JavaScript file, so you can find it.

fadeev commented 4 years ago

@Booyoun-Kim thank you so much! 🙏 It worked.