Bitcoin Tutorials - Herong's Tutorial Examples - v1.06, by Herong Yang
"bitcoin-cli encryptwallet" - Set Wallet Password
This section describes how to use 'bitcoin-cli encryptwallet' command to set a password to protect my wallet.
If you have obtained some Bitcoin funds in your wallet, you should consider to encrypt with a password using the "bitcoin-cli encryptwallet" command.
Here is what the "bitcoin-cli encryptwallet" can do for us:
C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli -testnet help encryptwallet encryptwallet "passphrase" Encrypts the wallet with 'passphrase'. This is for first time encryption. After this, any calls that interact with private keys such as sending or signing will require the passphrase to be set prior the making these calls. Use the walletpassphrase call for this, and then walletlock call. If the wallet is already encrypted, use the walletpassphrasechange call. Note that this will shutdown the server. Arguments: 1. "passphrase" (string) The pass phrase to encrypt the wallet with. It must be at least 1 character, but should be long. Examples: Encrypt your wallet > bitcoin-cli encryptwallet "my pass phrase" Now set the passphrase to use the wallet, such as for signing or sending bitcoin > bitcoin-cli walletpassphrase "my pass phrase" Now we can do something like sign > bitcoin-cli signmessage "address" "test message" Now lock the wallet again by removing the passphrase > bitcoin-cli walletlock
Ok. Let me encrypt my test wallet.
C:\>\local\bitcoin-0.15.1\bin\bitcoin-cli -testnet encryptwallet xxxxxx wallet encrypted; Bitcoin server stopping, restart to run with encrypted wallet. The keypool has been flushed and a new HD seed was generated (if you are using HD). You need to make a new backup.
Ok. I restarted my Bitcoin Core Daemon on the Test Network.
Table of Contents
Access Bitcoin Test Network "-testnet"
"bitcoin-cli getclock" Command
bitcoin-cli Transaction Commands
►"bitcoin-cli encryptwallet" - Set Wallet Password
"bitcoin-cli walletpassphrase" - Unlock Wallet
"bitcoin-cli backupwallet" - Backup Wallet