Bitcoin Forum
May 06, 2024, 01:23:34 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to get wallet.dat balance from command line?  (Read 141 times)
codekrash (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
December 22, 2020, 08:14:06 PM
 #1

I have many bitcoin core wallets from years ago (encrypted). How do I check their balance from command line? Loading each one in bitcoin core GUI is a painfully slow process that will take weeks/months.
At the very least, how can I extract addresses so I can check them online for their balance?
Been struggling with pywallet..
Thanks,

1714958614
Hero Member
*
Offline Offline

Posts: 1714958614

View Profile Personal Message (Offline)

Ignore
1714958614
Reply with quote  #2

1714958614
Report to moderator
1714958614
Hero Member
*
Offline Offline

Posts: 1714958614

View Profile Personal Message (Offline)

Ignore
1714958614
Reply with quote  #2

1714958614
Report to moderator
I HATE TABLES I HATE TABLES I HA(╯°□°)╯︵ ┻━┻ TABLES I HATE TABLES I HATE TABLES
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714958614
Hero Member
*
Offline Offline

Posts: 1714958614

View Profile Personal Message (Offline)

Ignore
1714958614
Reply with quote  #2

1714958614
Report to moderator
1714958614
Hero Member
*
Offline Offline

Posts: 1714958614

View Profile Personal Message (Offline)

Ignore
1714958614
Reply with quote  #2

1714958614
Report to moderator
DaveF
Legendary
*
Offline Offline

Activity: 3472
Merit: 6263


Crypto Swap Exchange


View Profile WWW
December 22, 2020, 09:22:51 PM
 #2

How many wallet.dat files? Dozens? How many addresses?

You can remove the blockchain data and take the machine offline.
Then open each wallet one at a time and use dumpwallet to get the addresses. It will be quick since it does not have to scan the blockchain.

Copy the addresses notepad and then check in a block explorer.

-Dave

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6728


bitcoincleanup.com / bitmixlist.org


View Profile WWW
December 22, 2020, 09:30:42 PM
 #3

Start the bitcoind program instead of bitcoin-qt and use bitcoin-cli loadwallet <wallet-name> followed by bitcoin-cli -rpcwallet <wallet-name> getbalance.

The -rpcwallet option needs to be passed so Core knows which wallet you want to get the balance for.

Example:

Code:
notatether@localhost$ bitcoin-cli loadwallet defaultman
{
  "name": "defaultman",
  "warning": ""
}
notatether@localhost$ bitcoin-cli getbalance
error code: -19
error message:
Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).
Try adding "-rpcwallet=<filename>" option to bitcoin-cli command line.
notatether@localhost$ bitcoin-cli -rpcwallet="defaultman" getbalance
0.00000000
notatether@localhost$


.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5588


Self-proclaimed Genius


View Profile
December 23, 2020, 04:16:58 AM
 #4

I have many bitcoin core wallets from years ago (encrypted). How do I check their balance from command line? Loading each one in bitcoin core GUI is a painfully slow process that will take weeks/months.
The command line will be as slow as the GUI when it comes with scanning a wallet file once you've loaded it, so querying for the balance using Bitcoin-cli will have the same pace as Bitcoin-qt.

At the very least, how can I extract addresses so I can check them online for their balance?
If they were previously scanned with balance and history, then there should be readable addresses after the string: name" when you open them with a text editor.
But that won't show you the correct balance of the wallet, just a hint that it may be hodling some bitcoins.
If the wallet has clear history (eg. when previously used -zapwallettxes), all you'll see are 'jumbled' strings.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
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!