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?

1 Answer 1


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

  • So the private keys will get automatically imported with the xprv descriptor?
    – Fontaine
    Commented May 9, 2019 at 18:32
  • 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). Commented May 9, 2019 at 23:30
  • I removed my missing/wrong comment (could not edit). Commented May 10, 2019 at 7:20

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.