Understanding listdescriptor and importdescriptor Commands

4 replies 426 views
eric_ninjaSenior Member
Posts: 1 · Reputation: 1731
#1Feb 27, 2024, 04:43 PM
Quick question here. If I run listdescriptor and then importdescriptor with an exported file on a new system, will I still have access to the same wallets and funds? I mean, does listdescriptor true and importdescriptor do the same job as dumpprivkey and importprivkey?
6 Reply Quote Share
matrix2021Full Member
Posts: 92 · Reputation: 612
#2Feb 27, 2024, 06:53 PM
Yep, just make sure you do a rescan afterward.
3 Reply Quote Share
Posts: 18 · Reputation: 116
#3Feb 27, 2024, 10:19 PM
So if my exported file has the private key, I can import it to a new machine and recover my wallet and funds? But what if it only has the public key? I can see the addresses but can’t spend anything, right?
4 Reply Quote Share
0xLynxMember
Posts: 113 · Reputation: 205
#4Feb 27, 2024, 11:16 PM
Exactly! If you set "true" for the private key argument in listdescriptor, then private keys get exported too. After importing those, you can spend the funds. Achow101 basically answered your question perfectly. In newer wallets, listdescriptor true and importdescriptor replace the older dumpprivkey and importprivkey commands.
2 Reply Quote Share
Posts: 83 · Reputation: 179
#5Feb 28, 2024, 01:26 AM
Also, check this link for importing xpriv according to its address type: How to import an xpriv to a descriptor wallet in bitcoin core? If you want to bring in individual private keys, just follow the same logic. I even made a thread about importing privkeys into a Bitcoin Core descriptor wallet.
1 Reply Quote Share

Related topics