2

I have tried to import three xpub in a watch-only wallet as keypool with importmulti and a multisig output descriptor and to fill the first address with some BTCs. When I try to spend the newly created multisig UTXO, creating a walletcreatefundedpsbt, there's an error instead of creating a psbt. For context, my intention is to protect the wallet with three Hardware wallets. I' m doing this tests in regtest. Here are the details: I have generated three xpub:

pubkey1 tpubD6NzVbkrYhZ4YKMs9TvzemC7FaKYnNxESKvYN9V6PDnDwBXrHQk97rNC71fCXxyobFgcZDfesc5ThCMkUYjA5edd8J1qUQoR4P3kPywrGw6
pubkey2 tpubD6NzVbkrYhZ4X2MQYSo3wVWBPGjV3fUcN4DywfR2ZcM1F56A2bapN54YJqa47yDvwuTajWqkBHxRmdGHLQJj5ae7V1NXDN2JP8AKcyurzsa
pubkey3 tpubD6NzVbkrYhZ4XYeFSXzJ9fFu91eiSEpanzbhifxuSAb7m4piv9QxXsHi2a9jnspQpeKpnpdsyNhoMWb6traBXErL9TPjP3EKnPVFuzyv7Ed

then I have created a disable_private_keys wallet.

bitcoin-cli -regtest createwallet multi

then imported the output descriptors in the new wallet.

bitcoin-cli -regtest -rpcwallet=multi importmulti [{"desc": "wsh(multi(2,tpubD6NzVbkrYhZ4YKMs9TvzemC7FaKYnNxESKvYN9V6PDnDwBXrHQk97rNC71fCXxyobFgcZDfesc5ThCMkUYjA5edd8J1qUQoR4P3kPywrGw6/1/*,tpubD6NzVbkrYhZ4X2MQYSo3wVWBPGjV3fUcN4DywfR2ZcM1F56A2bapN54YJqa47yDvwuTajWqkBHxRmdGHLQJj5ae7V1NXDN2JP8AKcyurzsa/1/*,tpubD6NzVbkrYhZ4XYeFSXzJ9fFu91eiSEpanzbhifxuSAb7m4piv9QxXsHi2a9jnspQpeKpnpdsyNhoMWb6traBXErL9TPjP3EKnPVFuzyv7Ed/0/*))#hnd2wec3", "internal": true, "range": [0, 10], "timestamp": "now", "keypool": true, "watchonly": true},{"desc": "wsh(multi(2,tpubD6NzVbkrYhZ4YKMs9TvzemC7FaKYnNxESKvYN9V6PDnDwBXrHQk97rNC71fCXxyobFgcZDfesc5ThCMkUYjA5edd8J1qUQoR4P3kPywrGw6/0/*,tpubD6NzVbkrYhZ4X2MQYSo3wVWBPGjV3fUcN4DywfR2ZcM1F56A2bapN54YJqa47yDvwuTajWqkBHxRmdGHLQJj5ae7V1NXDN2JP8AKcyurzsa/0/*,tpubD6NzVbkrYhZ4XYeFSXzJ9fFu91eiSEpanzbhifxuSAb7m4piv9QxXsHi2a9jnspQpeKpnpdsyNhoMWb6traBXErL9TPjP3EKnPVFuzyv7Ed/0/*))#6jvyd6m3", "internal": false, "range": [0, 10], "timestamp": "now", "keypool": true, "watchonly": true}]

I have filled the first multisig address:

bitcoin-cli -regtest -rpcwallet="" sendtoaddress $(bitcoin-cli -regtest -rpcwallet=multi getaddressesbylabel ""|jq -r 'keys|.[0]') 10
bitcoin-cli -regtest -rpcwallet="" generatetoaddress 1 $(bitcoin-cli -regtest -rpcwallet="" getnewaddress)

but then, when I do:

bitcoin-cli -regtest -rpcwallet=multi walletcreatefundedpsbt [] "{\"$(bitcoin-cli -regtest -rpcwallet="" getnewaddress)\":0.5}" 0 "{\"subtractFeeFromOutputs\":[0], \"includeWatching\":true}"

I get:

    error code: -4
error message:
Can't generate a change-address key. No keys in the internal keypool and can't generate any keys.

What am I doing wrong?

Is there a way to manage the internal keypool so to have a multisig whatch-only wallet I can use with two or three HWW?

Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.