<p><code>getdescriptorinfo</code> always returns the non-private key from of the descriptor (security precaution).</p>

<p>From the commands help text:</p>

<p><code>"descriptor" :  (string) The descriptor in canonical form, without private keys</code></p>

CC BY-SA 4.0
2019-05-09T18:32:28.377Z
So the private keys will get automatically imported with the xprv descriptor?
Fontaine
CC BY-SA 4.0
2019-05-09T23:30:34.980Z
This is incorrect. `importprivkey` ignores private keys in descriptors; you need to provide them separately in WIF format (for now; this will likely be improved in 0.19).
Pieter Wuille
CC BY-SA 4.0
2019-05-10T07:20:50.330Z
I removed my missing/wrong comment (could not edit).
Jonas Schnelli
CC BY-SA 4.0
2019-05-09T18:25:15.870Z
2019-05-09T18:25:15.870Z
Jonas Schnelli
<p>I have figured out how to import an xpub, but when i use <code>getdescriptorinfo</code> on an xprv:</p>

<pre><code>getdescriptorinfo "wpkh(xprvA1Gpa5TRogN9eRoBFZLAEKjfvxzXTZpNpuJ9WXvTsRT3ZoW1EFnrAXji4aYPAktDc5ZYgAcS8XH5npiUdVztxdyrig2rZvNsrTEbhz1x2KQ/*)"
</code></pre>

<p>it returns</p>

<pre><code>{
  "descriptor": "wpkh(xpub6EGAyazKe3vSruseMasAbTgQUzq1s2YEC8DkJvL5Rkz2Sbq9mo76iL4Buq1opb9EeNfB2DzqeCuuDMcpx2ZTkcJdnp24Sa8Qo7CgwfbGrD1/*)#2p7j3v7x",
  "isrange": true,
  "issolvable": true,
  "hasprivatekeys": true
}
</code></pre>

<p>The descriptor is an xpub? Why? It sees that the key has private keys. If I use this descriptor with <code>importmulti</code> and specify a range will it import the private keys and addresses? I was expecting <code>getdescriptorinfo</code> to return an xprv. If this is not how you import an xprv then how do you?</p>

<bitcoin-core><json-rpc><bitcoin-cli>
How do you import an xprv using descriptors and importmulti?
Fontaine
# How do you import an xprv using descriptors and importmulti?

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

I have figured out how to import an xpub, but when i use `getdescriptorinfo` on an xprv:

```
getdescriptorinfo "wpkh(xprvA1Gpa5TRogN9eRoBFZLAEKjfvxzXTZpNpuJ9WXvTsRT3ZoW1EFnrAXji4aYPAktDc5ZYgAcS8XH5npiUdVztxdyrig2rZvNsrTEbhz1x2KQ/*)"

```

it returns

```
{
  "descriptor": "wpkh(xpub6EGAyazKe3vSruseMasAbTgQUzq1s2YEC8DkJvL5Rkz2Sbq9mo76iL4Buq1opb9EeNfB2DzqeCuuDMcpx2ZTkcJdnp24Sa8Qo7CgwfbGrD1/*)#2p7j3v7x",
  "isrange": true,
  "issolvable": true,
  "hasprivatekeys": true
}

```

The descriptor is an xpub? Why? It sees that the key has private keys. If I use this descriptor with `importmulti` and specify a range will it import the private keys and addresses? I was expecting `getdescriptorinfo` to return an xprv. If this is not how you import an xprv then how do you?

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


---

## 1 answers

### Answer by username_1 on 2019-05-09. Score: 0 | Accepted answer

`getdescriptorinfo` always returns the non-private key from of the descriptor (security precaution).

From the commands help text:

`"descriptor" : (string) The descriptor in canonical form, without private keys`

> **Comments:**
> **username_0**: So the private keys will get automatically imported with the xprv descriptor?  
> **username_2**: This is incorrect. `importprivkey` ignores private keys in descriptors; you need to provide them separately in WIF format (for now; this will likely be improved in 0.19).  
> **username_1**: I removed my missing/wrong comment (could not edit).  

---

