How do you import an xprv using descriptors and importmulti?

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?

Fontaine

Posted 2019-05-09T06:32:33.437

Reputation: 158

Answers

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

Jonas Schnelli

Posted 2019-05-09T06:32:33.437

Reputation: 5 465

So the private keys will get automatically imported with the xprv descriptor?Fontaine 2019-05-09T18:32:28.377

2This 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 2019-05-09T23:30:34.980

I removed my missing/wrong comment (could not edit).Jonas Schnelli 2019-05-10T07:20:50.330