<p>Use <code>validateaddress [address]</code>.</p>

<p>It will give you all information about that address, including whether it has the private key (it will <code>"ismine" : true</code> and <code>"iswatchonly" : false</code>.</p>

CC BY-SA 3.0
2017-05-17T08:06:34.860Z
2017-05-17T08:06:34.860Z
Pieter Wuille
<p>Does the bitcoin-core client have any RPC API to query the key pool? I have certain bitcoin address which I want to check if the wallet has access to (either via private key or via HD-private key derivation).</p>

<p>Is there a way to programmatically check this? I was going to use <code>signmessage</code> but that would need me to unlock the wallet with the passphrase first.</p>

<bitcoin-core><json-rpc><bip32-hd-wallets><keypool>
API to know if bitcoin-core has the private key (in the wallet.dat file) of a certain Bitcoin address?
knocte
# API to know if bitcoin-core has the private key (in the wallet.dat file) of a certain Bitcoin address?

(Asked by: username_0 on 2017-05-17)

Does the bitcoin-core client have any RPC API to query the key pool? I have certain bitcoin address which I want to check if the wallet has access to (either via private key or via HD-private key derivation).

Is there a way to programmatically check this? I was going to use `signmessage` but that would need me to unlock the wallet with the passphrase first.

**Tags:** bitcoin-core, json-rpc, bip32-hd-wallets, keypool


---

## 1 answers

### Answer by username_1 on 2017-05-17. Score: 2 | Accepted answer

Use `validateaddress [address]`.

It will give you all information about that address, including whether it has the private key (it will `"ismine" : true` and `"iswatchonly" : false`.


---

