0

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?

0

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 May 9 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). – Pieter Wuille May 9 at 23:30
  • I removed my missing/wrong comment (could not edit). – Jonas Schnelli May 10 at 7:20

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.