<p>You've imported the descriptor with <code>&quot;internal&quot;: true</code> which means that the descriptor will be used only for change addresses. You cannot retrieve any addresses from it with <code>getnewaddress</code> as that only retrieves receiving addresses. You can use <code>getrawchangeaddress</code> instead.</p>
<p>If you want to use <code>getnewaddress</code>, then either don't specify <code>internal</code>, or set it to <code>false</code>.</p>

CC BY-SA 4.0
2023-04-23T02:11:58.540Z
As you said, I set `"internal":false`, and it works! May I ask you, could I retrieve the addresses before the `next` index in  a descriptor?
MonKong
CC BY-SA 4.0
2023-04-23T02:24:27.390Z
Oh, I find them in address book, Thx~!
MonKong
CC BY-SA 4.0
2023-04-22T15:22:30.000Z
2023-04-22T15:22:30.000Z
Ava Chow
<p>I created an blank descriptor wallet and imported a xprv key.</p>
<pre><code>importdescriptors '[{ &quot;desc&quot;:&quot;wpkh(tpr..../0h/*h)#td3snsa4&quot;, &quot;timestamp&quot;:&quot;now&quot;, &quot;internal&quot;: true,&quot;range&quot;: [0,5],&quot;active&quot;:true}]'
</code></pre>
<p>I want to get the hardened address of path <code>m/0h</code>, but <code>getnewaddress</code> reports an error:
￼</p>
<pre><code>Error: This wallet has no available keys (code -4).
</code></pre>
<p>I know <code>deriveaddresses</code> can show the hardened address, but it requires the private key to be included in the command.</p>
<p>I have imported the xprv key via the <code>importdescriptors</code> 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.</p>

<bitcoin-core><address><bech32-address><hardened-derivation>
How to explore hardened addresses in bitcoin core descriptor wallet
MonKong
# How to explore hardened addresses in bitcoin core descriptor wallet

(Asked by: username_0 on 2023-04-22)

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.

**Tags:** bitcoin-core, address, bech32-address, hardened-derivation


---

## 1 answers

### Answer by username_1 on 2023-04-22. Score: 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`.

> **Comments:**
> **username_0**: As you said, I set `"internal":false`, and it works! May I ask you, could I retrieve the addresses before the `next` index in  a descriptor?  
> **username_0**: Oh, I find them in address book, Thx~!  

---

