<p>When you create the wallet that you are importing your keys into, presumably with something like <code>bitcoin-cli -rpcwallet='mywallet' importmulti</code>, it needs to be created in watchonly mode, meaning with private keys disabled. To do that, create the wallet with <code>bitcoin-cli createwallet 'mywallet' true</code>, where true is the argument for <code>disable_private_keys</code>, creating a wallet for watch-only (public) keys.</p>

CC BY-SA 4.0
2019-11-18T03:47:14.720Z
right, but obviously it would be useful to import private keys with an xprv, it seems there is no way to add private keys to the keypool other then importing individual keys. why can't we import an xprv just like we can import an xpub?
Fontaine
CC BY-SA 4.0
2019-11-18T15:39:32.033Z
Ah, I see. Looks like you can currently just import private keys in WIF. According to Pieter Wuille's comment in https://bitcoin.stackexchange.com/questions/87610/how-do-you-import-an-xprv-using-descriptors-and-importmulti it might in 0.19.0 , but I have not tested it yet.
TheCharlatan
CC BY-SA 4.0
2019-11-19T00:40:45.713Z
yea this is also helpful, testing now https://bitcoin.stackexchange.com/questions/88463/when-i-use-importmulti-with-an-xprv-it-never-imports-the-private-keys-what-am-i/88466?noredirect=1#comment105060_88466
Fontaine
CC BY-SA 4.0
2019-11-06T15:20:12.637Z
2019-11-06T15:20:12.637Z
TheCharlatan
<p>I am creating a blank wallet with the intention of adding keys to the keypool but get an error <code>keys can only be imported to the keypool when private keys are disabled</code></p>

<p>Why? It would be beneficial for users to be able to import their own private keys and get full functionality of the wallet with those keys. Is there any PR for this?</p>

<bitcoin-core><json-rpc><bitcoin-cli>
Why can't a user import keys to the keypool for a blank wallet?
Fontaine
# Why can't a user import keys to the keypool for a blank wallet?

(Asked by: username_0 on 2019-09-24)

I am creating a blank wallet with the intention of adding keys to the keypool but get an error `keys can only be imported to the keypool when private keys are disabled`

Why? It would be beneficial for users to be able to import their own private keys and get full functionality of the wallet with those keys. Is there any PR for this?

**Tags:** bitcoin-core, json-rpc, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2019-11-06. Score: 1

When you create the wallet that you are importing your keys into, presumably with something like `bitcoin-cli -rpcwallet='mywallet' importmulti`, it needs to be created in watchonly mode, meaning with private keys disabled. To do that, create the wallet with `bitcoin-cli createwallet 'mywallet' true`, where true is the argument for `disable_private_keys`, creating a wallet for watch-only (public) keys.

> **Comments:**
> **username_0**: right, but obviously it would be useful to import private keys with an xprv, it seems there is no way to add private keys to the keypool other then importing individual keys. why can't we import an xprv just like we can import an xpub?  
> **username_1**: Ah, I see. Looks like you can currently just import private keys in WIF. According to Pieter Wuille's comment in https://bitcoin.stackexchange.com/questions/87610/how-do-you-import-an-xprv-using-descriptors-and-importmulti it might in 0.19.0 , but I have not tested it yet.  
> **username_0**: yea this is also helpful, testing now https://bitcoin.stackexchange.com/questions/88463/when-i-use-importmulti-with-an-xprv-it-never-imports-the-private-keys-what-am-i/88466?noredirect=1#comment105060_88466  

---

