sui
sui copied to clipboard
[wallet] Encrypt wallet keystore and add password protection
The wallet.key file should be encrypted and protected by a password to make it a little bit more secure.
handing this issue over to @joyqvq to decide if we still need this or not.
yes this is on my plate (closing the other ticket to track this here) - I dont think encrypting the keystore itself is a good idea, since it will not allow retrieval by address, and we already need to load all keys to memory (in fact all hardware wallet assumes single key as well).
I think this is the most efficient:
sui keytool generatecan generate a single key file with encryption to $KEYFILE_PATHsui client serialize-transfer-suican generate the tx bytes to signsui keytool sign --data $TX_BYTES --path=$KEYFILE_PATHprompt user to enter password, and can output the signed data with the pathsui client execute-signed-txcan execute the signed data returned from the previous step.
so the default behavior for user is still use the unencrypted keystore. if they decide to encrypt or do offline signing, they can use the more flexible interface above.
with https://github.com/MystenLabs/sui/pull/5345 step 2, 4 are doable, will send a PR for step 1 and 3
@joyqvq I'll close this as I think most of the things are now already in place.