BREAKING NEWS! has been acquired by VC firm Morningstar Ventures. Read more

$42,400.32 0.22%
BTC · 3w

Made a stupid wallet backup script for unencrypted descriptor wallets

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 []( 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 []( 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](
Continue on self.Bitcoin
Recent News
BTC +0.22% · · 8h

Is This the Year bitcoin Goes Green?

Bitcoin, the world’s largest cryptocurrency, has a well-established history of negative environmental impact, and this reputation has carried broadly ac...