2

I'm trying to fill my wallet's internal/change address keypool by passing a multisig descriptor to importmulti, but the wallet's internal keypool is 0 before and after running the following shell script:

keypoolinitial=$(bitcoin-cli -testnet getwalletinfo | jq -r '.keypoolsize_hd_internal')
echo "internal keypool initial: $keypoolinitial"

rawdescriptor="wsh(multi(2,tpubD6NzVbkrYhZ4YgUWMmeBh1b7hrYyHwXowUrMn3mQ6QRxJNaLiVEA3jGLJDdaSpzEMTCgNF2JRukSqUxEkgX3J8Mf8tMParwTWABsjFzTsUA/*,tpubD6NzVbkrYhZ4XaWhpCwqSPgdnmqHxjPksHjdt6sgsBmQ37ohNNUFnyykgstn1UTKz21SzdKM6C3V7qEiXHkeEKWRALWMb1am8voLW72ZXDr/*,tpubD6NzVbkrYhZ4X3DR4FgNdjBjmdxvnX2TjmbkoNWquXaXQz6uMfF7kUF6rsXA26vRMzW3WP4iQgP1A8gJCSYD47qAQbsCCtnvhtRiD57jAEw/*))"

descriptor=$(bitcoin-cli -testnet getdescriptorinfo $rawdescriptor | jq -r '.descriptor')

bitcoin-cli -testnet importmulti '[{"desc": "'$descriptor'", "timestamp": "now", "range": [0, 10], "watchonly": true, "keypool": true, "internal": true}]' >> /dev/null

keypoolfinal=$(bitcoin-cli -testnet getwalletinfo | jq -r '.keypoolsize_hd_internal')
echo "internal keypool final: $keypoolfinal"

Running it gives me:

internal keypool initial: 0
internal keypool final: 0

But the same script works if I change the rawdescriptor line to use a simple P2PKH descriptor such as:

rawdescriptor="pkh(tpubD6NzVbkrYhZ4YgUWMmeBh1b7hrYyHwXowUrMn3mQ6QRxJNaLiVEA3jGLJDdaSpzEMTCgNF2JRukSqUxEkgX3J8Mf8tMParwTWABsjFzTsUA/*)"

Then it outputs:

internal keypool initial: 0
internal keypool final: 11
0

1 Answer 1

4

The keypool (currently) is not an address pool, it does not hold individual addresses, it holds keys. Those keys are then converted to addresses when you want them. Because of this, you cannot import P2SH or P2WSH addresses into the keypool as you are trying to do.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.