Bitcoin Forum
May 11, 2024, 05:38:15 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to send passphrase to bitcoin core using bitcoin-cli?  (Read 1777 times)
p100 (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
April 08, 2017, 05:17:36 PM
 #1

How to send passphrase to bitcoin core using bitcoin-cli in Linux terminal? I've got my decrypted wallet and would like to check which of the passwords is correct by sending passphrases via bitcoin-cli. What commands should I use? Thanks.
1715405895
Hero Member
*
Offline Offline

Posts: 1715405895

View Profile Personal Message (Offline)

Ignore
1715405895
Reply with quote  #2

1715405895
Report to moderator
Make sure you back up your wallet regularly! Unlike a bank account, nobody can help you if you lose access to your BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715405895
Hero Member
*
Offline Offline

Posts: 1715405895

View Profile Personal Message (Offline)

Ignore
1715405895
Reply with quote  #2

1715405895
Report to moderator
1715405895
Hero Member
*
Offline Offline

Posts: 1715405895

View Profile Personal Message (Offline)

Ignore
1715405895
Reply with quote  #2

1715405895
Report to moderator
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
April 08, 2017, 10:53:18 PM
 #2

How to send passphrase to bitcoin core using bitcoin-cli in Linux terminal? I've got my decrypted wallet and would like to check which of the passwords is correct by sending passphrases via bitcoin-cli. What commands should I use? Thanks.

Isn't the password stored in the config file, do you have access to that?
If not, you'll probably have to create one and assign a number to the variable for the password each time based on the command line commands.
Code:
rpcpassword=<your password>

Also you should be able to run that as a cli command:
bitcoin-qt -rpcpassword=<your password>
and see if it loads.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
April 09, 2017, 05:05:03 AM
 #3

How to send passphrase to bitcoin core using bitcoin-cli in Linux terminal? I've got my decrypted wallet and would like to check which of the passwords is correct by sending passphrases via bitcoin-cli. What commands should I use? Thanks.
Do you mean the password that you use to unlock an encrypted wallet?

If so, you have to use
Code:
walletpassphrase <passphrase> <timeout>
where <passphrase> is your passphrase and <timeout> is an amount of time in seconds to keep the wallet unlocked.

p100 (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
April 09, 2017, 08:30:28 AM
 #4

Yes, I ment password to unlock the wallet. Achow101 - thanks, it worked!
columbo
Jr. Member
*
Offline Offline

Activity: 45
Merit: 1


View Profile
October 24, 2017, 04:16:42 PM
 #5

Is there a safer way to not post the password directly on command line?
This command is also stored on bash history, and it would require removing the history file every time you decrypt your wallet for a short period of time.
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
October 24, 2017, 06:23:00 PM
 #6

Is there a safer way to not post the password directly on command line?
This command is also stored on bash history, and it would require removing the history file every time you decrypt your wallet for a short period of time.
Use bitcoin-cli with the -stdin parameter. The parameters will then be entered on stdin after you enter the command, one on each line. This keeps it out of the bash history. So you would do something like
Code:
$ bitcoin-cli -stdin walletpassphrase
<passphrase>
<timeout>
and complete the command with Ctrl + D to signal EOF. Then the command will be sent and you will get a response.

columbo
Jr. Member
*
Offline Offline

Activity: 45
Merit: 1


View Profile
October 25, 2017, 09:21:56 AM
 #7

Is there a safer way to not post the password directly on command line?
This command is also stored on bash history, and it would require removing the history file every time you decrypt your wallet for a short period of time.
Use bitcoin-cli with the -stdin parameter. The parameters will then be entered on stdin after you enter the command, one on each line. This keeps it out of the bash history. So you would do something like
Code:
$ bitcoin-cli -stdin walletpassphrase
<passphrase>
<timeout>
and complete the command with Ctrl + D to signal EOF. Then the command will be sent and you will get a response.

Thank you. However, although this won't save the password to history, even with -stdin, the password gets displayed without any encryption on the screen. Is there a workaround to this?

And one more thing. I noticed that the newest version of bitcoin core has support for multiple wallets. How do I set this up to have for example 5 different wallets but all using the same blockchain, so basically I do not want to download the entire blockchain again and store the blockchain 5 times, I only need the bitcoin-cli or the RPC to view / spend bitcoins from any wallet I want. Are there specific bitcoin-cli commands that are useful for selecting the wallet file I want to use?
achow101
Moderator
Legendary
*
Offline Offline

Activity: 3388
Merit: 6635


Just writing some code


View Profile WWW
October 25, 2017, 03:07:40 PM
 #8

Thank you. However, although this won't save the password to history, even with -stdin, the password gets displayed without any encryption on the screen. Is there a workaround to this?
Once you get the data you need, you can do clear a bunch of times.

And one more thing. I noticed that the newest version of bitcoin core has support for multiple wallets. How do I set this up to have for example 5 different wallets but all using the same blockchain, so basically I do not want to download the entire blockchain again and store the blockchain 5 times, I only need the bitcoin-cli or the RPC to view / spend bitcoins from any wallet I want. Are there specific bitcoin-cli commands that are useful for selecting the wallet file I want to use?
Start Bitcoin Core with as many -wallet=<wallet name> arguments (or add them to your bitcoin.conf file) as you want wallets to use. When you use bitcoin-cli with any wallet related command, you will need to use the -rpcwallet=<walet name> argument to specify the wallet that you want to use. For example, you might do
Code:
$ bitcoind -daemon -wallet=wallet1 -wallet=wallet2
To start Bitcoin Core with two wallets, wallet1 and wallet2. If you want to do stuff with wallet1, you would do
Code:
$ bitcoin-cli -rpcwallet=wallet1 getwalletinfo

LoyceV
Legendary
*
Offline Offline

Activity: 3304
Merit: 16633


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
October 27, 2017, 09:49:54 AM
 #9

Is there a safer way to not post the password directly on command line?
This command is also stored on bash history, and it would require removing the history file every time you decrypt your wallet for a short period of time.
Kill Bash, it won't update .bash_history:
Code:
kill -9 $$

Thank you. However, although this won't save the password to history, even with -stdin, the password gets displayed without any encryption on the screen. Is there a workaround to this?
I feel you, when I use walletpassphrase in Debug window Console. I just use it as a reminder to never enter my password with anybody around.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!