0

I create a wallet with private keys disabled.

Then use importmulti like so:


command curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importmulti", "params":[[{ "scriptPubKey": { "address": "bcrt1qeappehxje9d46zjeyvh3cqslzzda9p92nx2xg495e8memcjvppvqhk6hcn" }, "label": "Imported Address", "timestamp": "now", "watchonly": true, "keypool": true, "internal": false }], ''{"rescan": false}''] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:18443/wallet/Test
result = Optional({
    error = "<null>";
    id = curltest;
    result =     (
                {
            success = 1;
        }
    );
})

But when I run getnewaddress it says keypool empty:

curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getnewaddress", "params":["", "bech32"] }' -H 'content-type: text/plain;' http://user:password@127.0.0.1:18443/wallet/Test
result = Optional({
    error =     {
        code = "-4";
        message = "Error: This wallet has no available keys";
    };
    id = curltest;
    result = "<null>";
})

This also happens when I use importmulti descriptor approach to import a multisig.

I am trying to create a watch-only wallet for my multisig, where the only key that is in the keypool is the multisig address, just to make building transactions with the wallet seamless.

2

Currently the keypool is not an address pool. You cannot put addresses in the keypool. You need to be importing public keys in order for anything to be added to the keypool.

  • Ok, so it is not possible to add a multi-sig address to the keypool then I take it? – Fontaine Jul 23 at 17:51
  • 1
    No, it is not possible. You currently cannot get any addresses from Bitcoin Core except for the standard single key addresses. – Andrew Chow Jul 23 at 21:08

Your Answer

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

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