I am trying to understand two commands listed in the following link.

1. walletpassphrase

Stores the wallet decryption key in memory for <timeout> seconds.

2. walletlock

Removes the wallet encryption key from memory, locking the wallet. After calling this method, you will need to call walletpassphrase again before being able to call any methods which require the wallet to be unlocked.

So if I am clear in my understanding, to encrypt my wallet I need to call the walletlockcommand and to decrypt it I need to call walletpassphrase command. Am I correct?


No, use encryptwallet to encrypt the wallet, read this document:


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.