Author

Topic: How to create a watch-only wallet for an old (but migrated) Core wallet? (Read 80 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
Or the corresponding button in the GUI?
That's actually a different mechanism from sendall, although it should have the same effect.

1. I have imported one of the descriptors (pkh) on the online machine. The daemon has started a rescan. This probably takes a very long time in my case. The RPC call ended with a timeout at some point. But the daemon continued rescanning. Then I terminated the daemon during the rescan as a test and started it again. But it does not continue with the rescan after restart.  I know that the displayed balance is correct, but why doesn't it continue the rescan or start it again? I have also reloaded the wallet.
Rescan state is not persisted in all instances. You can trigger another rescan using rescanblockchain.

2. I have received 4 descriptors with the same pubkey for each legacy address. The types are pk, pkh, sh(wpkh), wpkh. I have now used the pkh descriptor. But could I also use the others? What should I use? I would like to transfer the balance of the legacy address to a segwit address (bc1).
Legacy wallets could receive to each of these address types for any key in the wallet, so the migration creates these (or a combo() descriptor). To be safe, you can import them all, but if you know which address type you had used, then you can just import that specific one.
jr. member
Activity: 42
Merit: 48
However, you can create a blank descriptor wallet and import the watchonly descriptors for the 2 addresses you used. You can then use this wallet to create a PSBT sending the coins somewhere else. The PSBT can be transferred to the offline machine to be signed, and back to the online one for broadcast.

With such a wallet, there is no risk for loss because of change as the wallet will be unable to generate any change addresses, so if any change is needed, it will simply fail to create the transaction. You can further reduce risk here by using the sendall RPC.

Or the corresponding button in the GUI? Thanks for the explanation, that helps me a lot!

I have two more questions if you have time to answer.  

1. I have imported one of the descriptors (pkh) on the online machine. The daemon has started a rescan. This probably takes a very long time in my case. The RPC call ended with a timeout at some point. But the daemon continued rescanning. Then I terminated the daemon during the rescan as a test and started it again. But it does not continue with the rescan after restart.  I know that the displayed balance is correct, but why doesn't it continue the rescan or start it again? I have also reloaded the wallet.

2. I have received 4 descriptors with the same pubkey for each legacy address. The types are pk, pkh, sh(wpkh), wpkh. I have now used the pkh descriptor. But could I also use the others? What should I use? I would like to transfer the balance of the legacy address to a segwit address (bc1).
staff
Activity: 3458
Merit: 6793
Just writing some code
There's no such thing as legacy descriptors.

You cannot mix both watchonly descriptors and descriptors with private keys in the same wallet.

However, you can create a blank descriptor wallet and import the watchonly descriptors for the 2 addresses you used. You can then use this wallet to create a PSBT sending the coins somewhere else. The PSBT can be transferred to the offline machine to be signed, and back to the online one for broadcast.

With such a wallet, there is no risk for loss because of change as the wallet will be unable to generate any change addresses, so if any change is needed, it will simply fail to create the transaction. You can further reduce risk here by using the sendall RPC.
jr. member
Activity: 42
Merit: 48
Given: A copy of an old non descriptor wallet without special features (originally created 2013) on an new offline system. Only two addresses were used at the time (2013-2014). Bitcoin Core 28 was able to open this old wallet and it was possible to migrate it to a descriptor wallet. Now listdescriptors shows me thousands of descriptors that I don't actually need. All this on an offline machine.

What I would like to do: I would like to set up a watch-only wallet for the two addresses (i think i need to use the corresponding pkh descriptors) on an online machine and then create a unsigned transaction that transfers the coins from the old addresses to a new hd wallet. I could then sign this transaction offline.

The problem I see is that the core client can't generate new keys in a legacy non-hd watch-only wallet (if there is such a thing at all). Change addresses shouldn't actually be necessary in my case, but I still have the feeling that I'm on the wrong track here. What would be the safest course of action in my case?

Is it possible to have legacy descriptors and hd descriptors in one wallet? Would the core client then derive the change addresses from the xpub keys?
Jump to: