massalabs/massa

[massa-client] handling multiple wallet files

sebastien-forestier opened this issue · 3 comments

Currently, we cannot use two different wallet files in massa-client/wallets/, e.g. yaml files created with Massa Station with different passwords: the client will prompt for a password and fail.

Improvements:

  • wallet_info should not ask for password as it does not sign anything
  • commands that sign something should ask the password of the corresponding address (designated in the command) if a corresponding file is found in wallets/ otherwise fail
  • wallet_get_secret_key could be used with only one address instead of several, to ask only one password
  • match the vocabulary with the usage: when we read comments like wallet_add_secret_keys ...: add a list of secret keys to the wallet, we understand that a wallet can contain several addresses so a wallet file should be able to contain several addresses with the same password, and the client should integrate them to the file when using commands like wallet_add_secret_keys and wallet_generate_secret_key (e.g. with the wallet nickname as parameter), while instead curently they create a new wallet in wallets/

Also, for security purposes, forget the password immediately after signing something!
Otherwise

  • we can easily make a mistake when going up with arrows to find a previous command, and re-execute a previous command
  • someone else finding the client open can send tokens

Also, it looks like the wallets/ folder should be created and empty in the beginning, if I'm not mistaken it's not there and we have to create it by hand when we import a yaml file

One password for all addresses seems like a superior choice in terms of user experience. Most product on the market do the that. User are already experiencing difficulties with our interfaces, maybe we shouldn't had yet another complex layer.