How to View & Recover Bitcoin Wallet.dat Content
wallet.dat is the file in which Bitcoin Core keeps a wallet’s keys and transactions. To see what one holds and get the coins out of it, load a copy in a current Bitcoin Core: a descriptor wallet opens directly, while an old legacy wallet, the default before version 23.0, has to be migrated first. Bitcoin Core 30.0 removed the legacy format and with it the dumpprivkey command that older tutorials rely on. Everything below was checked against Bitcoin Core 31.1, the current release in October 2026, and applies to old files from a forgotten laptop or backup drive too.
- Where it is: in a
walletsfolder inside Bitcoin Core’s data directory; the table below gives the path for each system. - How to view it: on a copy, with File > Open Wallet for a descriptor wallet, or after migration for a legacy one.
- An old legacy file: migrate it with the latest release, never with 30.0 or 30.1.
- A forgotten password: it cannot be reset or recovered; BTCRecover can only test your guesses.
- The private keys: there is no
dumpprivkeysince 30.0; export the descriptors or, usually better, move the coins to a new wallet.
What Is a wallet.dat File?
wallet.dat is the database file of a Bitcoin Core wallet. According to the Bitcoin Wiki, it holds your private and public keys, scripts (which correspond to addresses), key metadata such as labels, and your transactions; HD wallets also store the seed the keys are derived from. Two formats share the name:
| Legacy wallet | Descriptor wallet | |
|---|---|---|
| Database | Berkeley DB (BDB) | SQLite |
| Default for new wallets | Before Bitcoin Core 23.0 | Since 23.0 (introduced in 0.21.0) |
| In Bitcoin Core 30.0 and later | Can’t be created or loaded, only migrated | The normal wallet format |
Most files found on old disks are legacy wallets. Their coins are still recoverable, but current Bitcoin Core has to migrate them first.
If the file and every backup are lost, Bitcoin Core’s wallet documentation says the bitcoins become permanently inaccessible.
Warning: wallet.dat is not encrypted by default. Anyone who gets a copy of an unencrypted file can steal your bitcoins, so treat every copy with extreme caution.
How to Locate Your wallet.dat File
Current Bitcoin Core keeps wallets in a wallets folder inside its data directory. A named wallet is a subfolder with its own wallet.dat; an unnamed default wallet sits directly in wallets. The default wallet directories:
| Operating system | Default wallet directory |
|---|---|
| Windows | C:\Users\<user>\AppData\Local\Bitcoin\wallets |
| macOS | /Users/<user>/Library/Application Support/Bitcoin/wallets |
| Linux | /home/<user>/.bitcoin/wallets |
Older installs differ:
- Windows before 28.0 used
C:\Users\<user>\AppData\Roaming\Bitcoin, and current versions keep using that folder if it exists. - Before 0.16.0, wallet files sat at the top level of the data directory, for example
~/.bitcoin/wallet.dat. Upgraded nodes keep that layout. - Since 0.15.0 a node can hold several wallets, and the
-datadirand-walletdiroptions can move them anywhere.
In the GUI, Window > Information shows the data directory (Datadir), and File > Open Wallet lists the wallets Bitcoin Core finds; bitcoin-cli listwalletdir does the same. For other places to search, see our guide to finding old wallet backups.
Creating Proper Backups Before Proceeding
Essential Step: Before you view, migrate or recover your wallet, make several copies and work only on a copy. Migration rewrites the file it works on.
- If Bitcoin Core is running, use File > Backup Wallet… or
backupwallet. The documentation says one of these must be used so the file is in a safe state when it’s copied:
bitcoin-cli -rpcwallet="wallet-01" backupwallet /home/node01/Backups/backup-01.dat
- To copy by hand, shut Bitcoin Core down completely and copy the whole wallet folder, including a
wallet.dat-journalfile (descriptor wallets) or adatabase/folder (old BDB wallets). The documentation says to keep both as safe aswallet.datitself. - Store copies in several places on different media and, as Bitcoin.org’s security guide advises, encrypt any backup that is stored online.
- Verify each copy by comparing checksums, and keep one untouched original offline:
sha256sum wallet.dat # Linux
shasum -a 256 wallet.dat # macOS
certutil -hashfile wallet.dat SHA256 # Windows
Methods to View wallet.dat Contents
Check Which Kind of wallet.dat You Have
Put a copy in its own folder inside the wallets directory, for example wallets/old-2013/wallet.dat (the folder name becomes the wallet name). Since Bitcoin Core 30.0, File > Open Wallet shows a legacy file greyed out and marked “(needs migration)”, and bitcoin-cli listwalletdir warns that it “will need to be migrated with migratewallet before it can be loaded”. Without a running node, the bitcoin-wallet tool prints the format and encryption status of a descriptor wallet and refuses a legacy one with a pointer to the migration tool:
bitcoin-wallet -wallet=old-2013 info
Using Bitcoin Core
A descriptor wallet opens normally through File > Open Wallet. Once your node has fully synced, the Overview, Transactions and Receive tabs show balances and history, and Window > Receiving addresses lists your addresses.
For details, open Window > Console, select the wallet there and type the commands below without bitcoin-cli. Or run bitcoind and use bitcoin-cli (bitcoin-qt only accepts bitcoin-cli commands when started with -server):
bitcoin-cli -rpcwallet="old-2013" getwalletinfo
bitcoin-cli -rpcwallet="old-2013" getbalances
bitcoin-cli -rpcwallet="old-2013" listtransactions "*" 100
bitcoin-cli -rpcwallet="old-2013" listreceivedbyaddress 0 true
bitcoin-cli -rpcwallet="old-2013" listdescriptors
getwalletinfo should report "format": "sqlite" and "descriptors": true. listdescriptors (since Bitcoin Core 22.0) shows the descriptors the wallet derives its addresses from, each with the extended key and path it starts from. listdescriptors true adds the private keys; an encrypted wallet has to be unlocked first:
bitcoin-cli -rpcwallet="old-2013" walletpassphrase "passphrase" 120
bitcoin-cli -rpcwallet="old-2013" listdescriptors true
bitcoin-cli -rpcwallet="old-2013" walletlock
Security Note: Private descriptors give full control over the funds. Never display them on a computer that might be compromised or while sharing your screen.
Bitcoin Core 30.0 removed the legacy-only commands dumpprivkey, dumpwallet, importprivkey, importwallet, importaddress, importpubkey, importmulti, addmultisigaddress, newkeypool, sethdseed and upgradewallet. Current releases answer them with “Method not found”.
Viewing an Old Legacy wallet.dat
Since 30.0, Bitcoin Core can’t open a legacy file at all, not even read-only. Migrate a copy as described in the next section, then use the commands above.
Old guides suggest PyWallet (its README still lists Python 2.x as a requirement) or wallet-key-tool (last updated in 2017). Both are third-party, read only Berkeley DB files and export keys in readable form; with migration built into Bitcoin Core, you don’t need them. Never upload a wallet file, key export or descriptor to a website or “online importer”: whoever receives it can take the coins.
Recovering an Old Legacy wallet.dat with Current Bitcoin Core
The Bitcoin Core 30.0 release notes say legacy wallets “can no longer be created or loaded. They can be migrated to the new descriptor wallet format.” Migration uses the migratewallet command (added in 24.0.1) or the Migrate Wallet menu (since 26.0) and moves your addresses and private keys into a descriptor wallet with the same name.
Before You Migrate
- Use a current release: 31.1 at the time of writing, never 30.0 or 30.1. Bitcoin Core warned in January 2026 that a failed migration in those two versions could delete all files in the wallet directory; 30.2 shipped the fix.
- Migrate a copy in its own folder such as
wallets/old-2013/, never your only file or a file inside an old data directory. Migration deletes the legacy file it works on and writes the new SQLite wallet in its place, after saving a backup with the extension.legacy.bak. - Use a synced node without pruning. An old wallet has to catch up from the last block it saw. If a pruned node no longer has that block, migration stops with “last wallet synchronisation goes beyond pruned data” and the file stays a legacy wallet.
Migrating in the GUI
In Bitcoin Core 31.x, choose File > Migrate Wallet > Restore and Migrate Wallet File…, select your copy and name the wallet; the confirmation dialog says the original file will not be modified. A copy that is already in the wallets directory is listed directly under File > Migrate Wallet (since 28.0). Bitcoin Core asks for the passphrase if the wallet is encrypted and names any extra wallets it creates.
Migrating with bitcoin-cli
bitcoin-cli listwalletdir
bitcoin-cli -rpcclienttimeout=0 migratewallet "old-2013"
For an encrypted wallet, pass the passphrase as the second argument:
bitcoin-cli -rpcclienttimeout=0 migratewallet "old-2013" "your passphrase"
To keep the passphrase out of your shell history, add -stdin instead and type the passphrase on its own line (end the input with Ctrl-D on macOS and Linux). The command’s help warns that migration can take a long time and recommends a longer client timeout; -rpcclienttimeout=0 switches it off. The result lists the new wallet names and backup_path, where the backup of the original file was saved.
What Happens to Passphrases and Watch-Only Addresses
- Encrypted wallets: without the right passphrase, migration stops with “Error: Wallet decryption failed, the wallet passphrase was not provided or was incorrect.” The migrated wallet stays encrypted with the same passphrase.
- Watch-only parts: a descriptor wallet can’t mix private keys and watch-only scripts, so migration may add
old-2013_watchonly(watched addresses) andold-2013_solvables(scripts the wallet knows but doesn’t watch). A legacy wallet without any private keys becomes onlyold-2013_watchonly, with private keys disabled. - New addresses: an HD wallet keeps its BIP 32 seed but derives new addresses along the standard BIP 44, 49, 84 and 86 derivation paths.
- Best effort: the documentation warns that unusual setups may leave some scripts out, so keep your original copy and the
.legacy.bakfile.
Then check getbalances and back up every new wallet right away; the documentation says migration requires a new backup.
Recovering Encrypted wallet.dat Passwords
Bitcoin Core’s documentation is clear: “There is no way to recover a passphrase.” You can only test guesses based on what you remember, and since 30.0 an encrypted legacy wallet can’t be migrated without its passphrase. Encryption only covers the private keys, so transactions and other wallet data stay readable.
Using BTCRecover for Password Recovery
BTCRecover is an open-source password recovery tool that supports Bitcoin Core wallets. Install it as its documentation describes, copy (never move) your wallet.dat into its folder, describe what you remember about the password in a tokens file and run:
python btcrecover.py --wallet wallet.dat --tokenlist tokens.txt
For a plain list of candidate passwords, use --passwordlist passwords.txt instead of --tokenlist. Depending on how much you remember and on your hardware, recovery takes minutes or never finishes.
Using Advanced Recovery Services
If you hire help, never send your wallet.dat. BTCRecover’s extract script for Bitcoin Core outputs only the encrypted master key, which its documentation says contains no addresses or private keys. A helper can run the search on that output with BTCRecover’s --data-extract option:
python3 extract-bitcoincore-mkey.py wallet.dat
Even so, research any service’s reputation extensively and consider legal agreements that penalize theft of funds.
How to Extract Private Keys from wallet.dat
Since Bitcoin Core 30.0 there is no dumpprivkey or dumpwallet, so you can’t print one key per address, in WIF format, anymore.
Using Bitcoin Core Command Line
listdescriptors true (shown above) exports the private descriptors, which contain the keys. Another Bitcoin Core wallet can import them with importdescriptors, which then rescans the blockchain.
Moving the Funds Instead of Exporting Keys
Usually it’s safer to leave the keys where they are and send the coins to a fresh wallet that you back up before it receives anything:
bitcoin-cli createwallet "new-wallet"
bitcoin-cli -rpcwallet="new-wallet" backupwallet /home/node01/Backups/new-wallet.dat
bitcoin-cli -rpcwallet="new-wallet" getnewaddress
bitcoin-cli -rpcwallet="old-2013" walletpassphrase "passphrase" 120
bitcoin-cli -rpcwallet="old-2013" sendall '["<new address>"]'
sendall (since 24.0.1, still marked experimental) spends all confirmed coins and unconfirmed change in the wallet to the given address. In the GUI, use the Send tab with Use available balance.
Critical Security Warning: Private keys and private descriptors represent total control over your funds. Never share them, store them in plaintext, or enter them on websites.
Common Issues and Troubleshooting
Corrupted Wallet File
Symptoms: Bitcoin Core refuses to open or migrate the file, or reports errors while reading it.
Solutions:
- Restore another copy (always the best option). A descriptor wallet backup is restored with File > Restore Wallet… or:
bitcoin-cli restorewallet "restored-wallet" /home/node01/Backups/backup-01.dat
- “LSNs are not reset, this database is not completely flushed” means a legacy file wasn’t closed cleanly, for example because it was copied while Bitcoin Core was running. As the message says, reopen and close it with a version that has BDB support (Bitcoin Core 29.x or older), on a copy, then migrate that copy with the current release.
- There is no repair tool anymore.
-salvagewalletwas removed in 0.21.0 in favour of an experimentalsalvagecommand in thebitcoin-wallettool, and since 30.0 the tool only offerscreate,createfromdump,dumpandinfo. The current documentation describes no way to repair a damaged wallet file, so rely on several independent copies. If the file comes from a failing disk, image the disk and work on the image.
Wallet Version Incompatibility
Symptoms: “The wallet appears to be a Legacy wallet, please use the wallet migration tool (migratewallet RPC or the GUI option).”
Solutions: migrate the file as described above. The -upgradewallet option (removed in 0.21.0) and the upgradewallet command (removed in 30.0) no longer exist, and releases older than 0.21.0 can’t open descriptor wallets at all.
Missing or Incomplete Transaction History
Symptoms: Your balance is wrong, or transaction history appears incomplete.
Solutions:
- Allow Bitcoin Core to fully synchronize with the network
- The
-rescanstartup option was removed in 23.0; userescanblockchain, which is much faster if the node runs with-blockfilterindex=1(an index of the same compact block filters that BIP 157 light clients download):
bitcoin-cli -rpcwallet="old-2013" rescanblockchain
- A pruned node can’t rescan blocks it has deleted and reports “Prune: last wallet synchronisation goes beyond pruned data”. Switching pruning off means downloading the entire blockchain again, which takes many hours.
Security Considerations and Best Practices
Working in a Secure Environment
- Download Bitcoin Core only from bitcoincore.org and verify the release
- Use a trusted, malware-free computer, ideally offline, whenever keys or descriptors are on screen
- Never upload wallet files, key exports or descriptors to websites, online “checkers” or chats
After Recovery
- Transfer funds to a new wallet if there’s any chance the original keys were compromised
- Securely delete temporary files that contain keys, such as exported descriptors or screenshots
- Back up the migrated or new wallet and update your backup strategy
- Want a seed phrase backup instead? Move the coins with a normal transaction from Bitcoin Core to a wallet that gives you a phrase, rather than typing keys into another app
- Keep old wallet.dat files, properly secured, in case they hold forgotten funds
Frequently Asked Questions
Can I open wallet.dat with a text editor?
No. It’s a binary database (Berkeley DB for legacy wallets, SQLite for descriptor wallets) and appears as gibberish in a text editor; saving it from one can corrupt it. Use Bitcoin Core on a copy.
Can current Bitcoin Core still open my old wallet.dat?
Not directly. Since 30.0, legacy files can only be migrated. Use the latest release (at least 30.2) and migrate a copy as described above.
How do I recover a wallet.dat from a formatted or crashed hard drive?
Data recovery software like TestDisk, PhotoRec, or R-Studio can help recover deleted wallet.dat files. Stop using the drive immediately so the data isn’t overwritten; physically damaged drives may need a professional service. A file rescued from a crashed system may not have been closed cleanly; see the “LSNs are not reset” fix above.
Is it safe to store wallet.dat in cloud storage?
An unencrypted wallet.dat in cloud storage is extremely risky, and even Bitcoin Core’s encryption leaves addresses and transactions readable. A copy that leaks can also be attacked offline, so the password is the only barrier left (testing your own wallet). If you must, encrypt the wallet within Bitcoin Core, then add another layer with VeraCrypt or 7-Zip and a strong, unique password before uploading.
How often should I back up my wallet.dat file?
Wallets created since Bitcoin Core 0.13 are HD wallets, so one backup can recover the coins at any time. The documentation still recommends weekly backups, or backups after many new transactions, to keep labels and other metadata. Non-HD wallets created before 0.13 must be backed up every 100 keys used. Always make a new backup after encrypting, changing the passphrase or migrating.
What’s the difference between wallet.dat and wallet seed phrases?
A seed phrase (usually 12 or 24 words) is a human-readable encoding of the random data from which an HD wallet’s master key is derived. Bitcoin Core doesn’t use one: BIP39 isn’t on its list of implemented BIPs. Its HD seed lives inside wallet.dat, so the file, or a backup made with backupwallet, is your backup. Our Bitcoin Core seed phrase guide explains the difference.
Do old wallet.dat guides still work?
Partly. Descriptor wallets open directly, but legacy files must be migrated first, with the latest release, on a copy, on a synced node that isn’t pruned. The dumpprivkey and -salvagewallet instructions in older guides no longer apply, and uploading a wallet to a website was never safe.