Encrypt Komodo’s wallet.dat File¶
How to Encrypt Komodo wallet.dat with password to make it more secure?¶
encryptwallet RPC to secure your wallet.dat file. After encrypting your wallet, you need to unlock it before making any transaction or dumping privkey of an address. This prevents unauthorized access to the coins stored in your wallet.
- Native wallet daemon for KMD and/or any
-ac_publicchains. (This feature is not applicable to SPV or Lite mode)
Precautions / Best Practices:¶
- Don’t encrypt any wallet with private addresses (
z-addresses). Transfer your funds from a private z address to transparent R address first (Guide).
- Don’t forget your password. If you do, you will lose access to your funds.
- Use a strong password containing letters (UPPERCASE, lowercase), numbers, special characters.
- Always keep a backup or write down your password, passphrase and private keys in a safe place.
- Always back up your wallet.dat in a safe place. It is recommended to do it after every send transaction.
- You are responsible for your funds, not the developers. Always ask when in doubt.
Encrypt your Wallet with a Password¶
encryptwallet command will encrypt your wallet.dat with a password that you provide. Usage:
./komodo-cli encryptwallet Y0urSecureP@$$phras3
Issuing this command will return you the following output and shut down the daemon.
wallet encrypted; Komodo server stopping, restart to run with encrypted wallet. The keypool has been flushed, you need to make a new backup.
Now, start your native coin wallet again. Your wallet.dat is already encrypted. Most of the wallet features will now require you to unlock the wallet first before performing those actions. You will get output like below:
error code: -13 error message: Error: Please enter the wallet passphrase with walletpassphrase first.
That means, without unlocking your wallet, you can’t send funds or dump private key of any address that the wallet holds. Follow the next step for commands to unlock your wallet.
You need to use
walletpassphrase command with your password and timeout time to unlock your wallet for sending funds or some other actions. Use the
timeout option to set a timer for how many seconds the wallet will be unlocked before locking automatically. Usage:
walletpassphrase "passphrase" timeout
./komodo-cli walletpassphrase Y0urSecureP@$$phras3 60
This above command will unlock your wallet for 60 seconds and will NOT return any output in your console. You can perform any actions with your wallet without any restrictions in the next 60 seconds. Change the timeout numbers to your liking.
Issuing the above command again while the wallet is still unlocked will just reset the timeout and the value of the new timeout becomes the time limit at which the wallet is locked again.
If you want to lock the wallet before the
timeout specified is reached, use the command
How to change password?¶
walletpassphrasechange "oldpassphrase" "newpassphrase"
./komodo-cli walletpassphrasechange Y0urSecureP@$$phras3 YourNewSecur3Pa$$phr@se
After issuing this command, there will be no output in your teminal console. But,
debug.log will print a similar line:
2018-12-05 15:39:38 Wallet passphrase changed to an nDeriveIterations of 299405
This means your password has been changed successfully. Use the new password for unlocking your wallet from this time onward until you change it again.
Keep in mind that if you forget your password, you will not be able to access your funds. So, keep it safely backed up.