PelagusWallet / pelagus-extension

Web Extension Wallet for Quai Network
GNU General Public License v3.0
30 stars 15 forks source link

[Pelagus] - Add ability for user to import a private key #176

Closed mibuono closed 2 months ago

mibuono commented 6 months ago

As a user, I want to be able to import my private key, so that I can create a wallet that I already own.

rileystephens28 commented 6 months ago

The Taho wallet explains their private key import implementation here. We basically want to match their implementation from a UI/UX perspective.

Here are a few design considerations:

  1. If a user chooses to recover their wallet using ONLY a private key, they will not be able to generate new addresses on demand, as there will be no seed phrase available for address derivation. In this case a user will be forced to generate a new seed phrase in order to have HD wallet functionality.
  2. If a user has created/recovered a wallet using a seed phrase and now wish to add another address to their wallet, they must specify whether they would like to generate the next address for a given zone or whether they want to import an address from a private key.
  3. Since a private key will correspond to an address in some zone's address space. The address, once derived, must be checked to ensure it is a valid according to QIP0002 and an error should be thrown if not.

Design Implementation When a user clicks the "+ Add Address" button, the slide up dialog should show the "Choose Shard" select as it does now as well as a button below it that says "Import from Private Key." The shard select and import button should be separated by a line divider with the word "Or" in the center of the line (this design is often seen in login pages when there is email/password OR social auth). We will do our best to get some mockups made for this, however, most of the UI implementation can be taken from Taho.

booleksandra commented 5 months ago

Verified. But there is a bug here with similar logic as in, for example, task #195. When logging in using a private key - if you wait 2+ minutes on the "Import private key" page before filling in the field, the same bug is reproduced Attachments: Video

@rileystephens28 Should I create a new issue for this bug? Or add comment to this one?