bitcoin-cli console walletpassphrase can't unlock wallet Password with some special characters will not work #14681

issue douglasdeodato opened this issue on November 7, 2018
  1. douglasdeodato commented at 4:47 PM on November 7, 2018: none

    bitcoin-cli console walletpassphrase can't unlock wallet Password with some special characters will not work

    <!-- Describe the issue -->

    I am trying unlock my wallet by console using: walletpassphrase, my problem is in my password i have a lot special characters, like: `^"'@-#&%*;_ I tried include \ before the special characters and did not help.

    can you guys share for me what is considered be a special characters here in bitcoin cli? as well could guys give a sample of solve this problem here?

    the commnand i used to open the wallet for 20 minutes was: walletpassphrase "`^"'@-#&%*;_" 1200

    so my question is how to fix this problem and make my wallet understand what is special characters and what is not.

    thank you.

  2. MarcoFalke added the label RPC/REST/ZMQ on Nov 7, 2018
  3. douglasdeodato commented at 5:09 PM on November 7, 2018: none

    rpcauth

    cool thank you for your reply, how could use this rpcauth command? I tried read here: https://en.bitcoin.it/wiki/Running_Bitcoin and i could understand well, what this rpcauth command does? thank you.

  4. ken2812221 commented at 11:18 AM on November 9, 2018: contributor

    @MarcoFalke I don't think that you can use rpcauth to unlock your wallet. @douglasdeodato Can you try if the following would work?

    bitcoin-cli -stdin walletpassphrase
    <your password>
    <timeout (seconds)>
    <Ctrl-D>
    
  5. MarcoFalke commented at 4:35 PM on November 9, 2018: member

    @ken2812221 Thanks. I completely missed that this wasn't talking about rpc authentication.

    Edit: Deleted my comments.

  6. MarcoFalke commented at 4:46 PM on November 9, 2018: member

    Though, the underlying issue is probably the same. I just tested that the special characters work fine in a walletpassphrase [1]. So it seems that bash strips the passphrase after the first #?

    Would be nice to have the exact error message (and maybe exact steps to reproduce)

    [1]

    diff --git a/test/functional/wallet_encryption.py b/test/functional/wallet_encryption.py
    index ab9ebed8d4..08605138f0 100755
    --- a/test/functional/wallet_encryption.py
    +++ b/test/functional/wallet_encryption.py
    @@ -23,7 +23,7 @@ class WalletEncryptionTest(BitcoinTestFramework):
             self.skip_if_no_wallet()
     
         def run_test(self):
    -        passphrase = "WalletPassphrase"
    +        passphrase = "WalletPassphrase`^\"'@-#&%*;_"
             passphrase2 = "SecondWalletPassphrase"
     
             # Make sure the wallet isn't encrypted first
    
  7. kristapsk commented at 4:47 PM on November 9, 2018: contributor

    These are special characters in bash, don't think it's a problem with bitcoin-cli.

    echo "`^"'@-#&%*;_" will also not work.

    Proper escaping, like echo '`^"'"'"'@-#&%*;_' will work.

    But using bitcoin-cli walletpassphrase "passphrase" 1200 is not a good idea anyway, as it will be saved in ~/.bash_history.

  8. douglasdeodato commented at 10:17 AM on November 10, 2018: none

    These are special characters in bash, don't think it's a problem with bitcoin-cli.

    echo "`^"'@-#&%*;_" will also not work.

    Proper escaping, like echo '`^"'"'"'@-#&%*;_' will work.

    But using bitcoin-cli walletpassphrase "passphrase" 1200 is not a good idea anyway, as it will be saved in ~/.bash_history.

    could not make this work always I get error: Invalid command line.

    could you please give a sample how supose be the command line?

    tried all of this and does not work walletpassphrase echo `^"'@-#&%*;{"@)\ 1200

    with ' ' walletpassphrase '`^"'@-#&%*;{"@)' 1200

    with " " walletpassphrase ''`^"'@-#&%*;{"@)'' 1200

    if I try with non special characters the command works but of course says it is a invalid character.

  9. kristapsk commented at 2:16 PM on November 10, 2018: contributor

    bitcoin-cli -stdin walletpassphrase should be preferred, as in @ken2812221's comment above.

    with ' ' walletpassphrase '`^"'@-#&%*;{"@)' 1200

    You have problem with ' inside ' ' block, that's why you should use '`^"'"'"'@-#&%*;_' instead (note "'"'"' part in a middle).

  10. MarcoFalke added the label Questions and Help on Nov 10, 2018
  11. MarcoFalke closed this on Apr 26, 2020

  12. MarcoFalke locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me