In my attempt to learn Taproot with Bitcoin Core, I started poking around at the descriptor wallets, and how to make them. One thing that is interesting is that they can't really be backed up in v22.0. PR#21500 fixes this, but it's not released yet. But thanks to @achow101 I got the bits I need to make a crappy backup utility. Unfortunately I didn't port over any of the CCrypter
class, so I can't decrypt encrypted wallets. But if you make a descriptor wallet and keep it unencryupted, you can run this python, or a lower level sqldump.py to pull out the private key data. After that, you can encrypt it without concern. Or I suppose you could just wait for the next release with PR#2100 in it.
Anyway, here's sql-privkey.py that will rebuild your tprv
BIP32 key from your tpub
descriptors. It's hardcoded for testnet right now, but it would be trivial to add mainnet to it. I also did a few address derivations since "How to make P2TR addresses" was one of my original questions.
The code requires the bitcoin-core functional test libraries, as well as pycoin and sql-utils.
References
These are some other questions and answers that filled in my gaps of knowlege.
- Script to list all commands and configs to create / use the 7 wallet formats
- How to make all 7 wallet formats from one BIP39 seed-mnemonic
- How to make a Taproot wallet using the importdescriptors command
- How to dump a descriptor wallet using sqlite-utils
- The four types of Bitcoin Core wallets, and how to make them
- How are P2TR addresses created from a pubkey
[link] [comments]
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments