0

I created an blank descriptor wallet and imported a xprv key.

importdescriptors '[{ "desc":"wpkh(tpr..../0h/*h)#td3snsa4", "timestamp":"now", "internal": true,"range": [0,5],"active":true}]'

I want to get the hardened address of path m/0h, but getnewaddress reports an error: 

Error: This wallet has no available keys (code -4).

I know deriveaddresses can show the hardened address, but it requires the private key to be included in the command.

I have imported the xprv key via the importdescriptors method, and I don't carry the xprv in daily use. I think the wallet can show the hardened address, but I don't know how to make it.

MonKong
  • 53
  • 3

1 Answers1

2

You've imported the descriptor with "internal": true which means that the descriptor will be used only for change addresses. You cannot retrieve any addresses from it with getnewaddress as that only retrieves receiving addresses. You can use getrawchangeaddress instead.

If you want to use getnewaddress, then either don't specify internal, or set it to false.

Andrew Chow
  • 67,209
  • 5
  • 76
  • 149