<p>I have written a program in Python3 that allows you to search for any address on bitcoin core whether it belongs to your wallet or not.</p>
<p>Here is the github link:</p>
<p><a href="https://github.com/ORP967/Bitcoin_Core_RPC_par_address" rel="nofollow noreferrer">https://github.com/ORP967/Bitcoin_Core_RPC_par_address</a></p>
<p>Let me know what you think or if you have any improvements you might have.</p>

CC BY-SA 4.0
2022-01-23T23:14:08.990Z
2022-01-23T23:14:08.990Z
ORP967
<p><code>getaddressinfo</code> is a wallet RPC. It reports the information a specific wallet has about a receiving address <em>it created</em>. Without wallet, there is no information.</p>
<blockquote>
<p>It seems to me that it should not be that difficult to dump all the information that the local blockchain currently has for a given address, without the need for a wallet.</p>
</blockquote>
<p>The local blockchain database in Bitcoin Core has <em>no</em> information about addresses or the scripts they refer to at all. All it has is the raw block data, and a database of unspent transaction outputs (indexed only by the txid and output position that created them - as you can query using <code>gettxout</code>).</p>
<p>It is of course still possible to index the chain and compute information related to addresses/scripts, like various block explorer websites do. Such functionality does not exist in Bitcoin Core, as it is unnecessary for the features it provides (full block validation, wallet functions, ...).</p>
<blockquote>
<p>If not, is there some other way to do it (without creating a wallet)?</p>
</blockquote>
<p>Perhaps you're interested in the <code>scantxoutset</code> RPC. You give it a descriptor (which can contain an address, but also xpubs, ...) and it will scan the current set of unspent transaction outputs that are assigned to those. Note however that this doesn't use any index, so it is rather slow (several minutes) for a query.</p>
<p>If you want the ability to query things faster, various indexing software packages exist.</p>

CC BY-SA 4.0
2021-03-26T18:15:20.457Z
2021-03-26T18:15:20.457Z
Pieter Wuille
<p>I just started running my own full node.  IBD is finished, and I'm now learning how to use <code>bitcoin-cli</code>.</p>
<p>First I would like to extract all the available information for one or more public addresses from the downloaded blockchain.</p>
<p>For the most part <sup>1</sup>, I have not been able to find a way to do this that does not require creating a wallet.</p>
<p>For example, if I run</p>
<pre><code>% bitcoin-cli getaddressinfo 1XPTgDRhN8RFnzniWCddobD9iKZatrvH4
</code></pre>
<p>...I get an error message that says</p>
<pre><code>error code: -18
error message:
No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A \
default wallet is no longer automatically created)
</code></pre>
<p>(BTW, I get the same error as long as I provide one argument after <code>getaddressinfo</code>, irrespective of its value.)</p>
<p>It seems to me that it should not be that difficult to dump all the information that the local blockchain currently has for a given address, without the need for a wallet.</p>
<p>Can this be done with <code>bitcoin-cli</code>?</p>
<p>If not, is there some other way to do it (without creating a wallet)?</p>
<hr />
<p><sup><sup>1</sup>The only partial exception to this statement is that, <em>if</em> I have a transaction ID, I can use <code>bitcoin-cli gettxout</code> repeatedly, and look for the desired address(es) in the output.  This is not only absurdly laborious, but it requires having a specific transaction ID.</sup></p>

<bitcoin-core><api><full-node><bitcoin-cli>
How to get info for public address from bitcoin-cli + local db? (Can it be done without creating a wallet?)
kjo
# How to get info for public address from bitcoin-cli + local db? (Can it be done without creating a wallet?)

(Asked by: username_0 on 2021-03-26)

I just started running my own full node. IBD is finished, and I'm now learning how to use `bitcoin-cli`.

First I would like to extract all the available information for one or more public addresses from the downloaded blockchain.

For the most part 1, I have not been able to find a way to do this that does not require creating a wallet.

For example, if I run

```
% bitcoin-cli getaddressinfo 1XPTgDRhN8RFnzniWCddobD9iKZatrvH4

```

...I get an error message that says

```
error code: -18
error message:
No wallet is loaded. Load a wallet using loadwallet or create a new one with createwallet. (Note: A \
default wallet is no longer automatically created)

```

(BTW, I get the same error as long as I provide one argument after `getaddressinfo`, irrespective of its value.)

It seems to me that it should not be that difficult to dump all the information that the local blockchain currently has for a given address, without the need for a wallet.

Can this be done with `bitcoin-cli`?

If not, is there some other way to do it (without creating a wallet)?

---

1The only partial exception to this statement is that, *if* I have a transaction ID, I can use `bitcoin-cli gettxout` repeatedly, and look for the desired address(es) in the output. This is not only absurdly laborious, but it requires having a specific transaction ID.

**Tags:** bitcoin-core, api, full-node, bitcoin-cli


---

## 2 answers

### Answer by username_2 on 2021-03-26. Score: 4 | Accepted answer

`getaddressinfo` is a wallet RPC. It reports the information a specific wallet has about a receiving address *it created*. Without wallet, there is no information.

> It seems to me that it should not be that difficult to dump all the information that the local blockchain currently has for a given address, without the need for a wallet.

The local blockchain database in Bitcoin Core has *no* information about addresses or the scripts they refer to at all. All it has is the raw block data, and a database of unspent transaction outputs (indexed only by the txid and output position that created them - as you can query using `gettxout`).

It is of course still possible to index the chain and compute information related to addresses/scripts, like various block explorer websites do. Such functionality does not exist in Bitcoin Core, as it is unnecessary for the features it provides (full block validation, wallet functions, ...).

> If not, is there some other way to do it (without creating a wallet)?

Perhaps you're interested in the `scantxoutset` RPC. You give it a descriptor (which can contain an address, but also xpubs, ...) and it will scan the current set of unspent transaction outputs that are assigned to those. Note however that this doesn't use any index, so it is rather slow (several minutes) for a query.

If you want the ability to query things faster, various indexing software packages exist.


---

### Answer by username_1 on 2022-01-23. Score: 1

I have written a program in Python3 that allows you to search for any address on bitcoin core whether it belongs to your wallet or not.

Here is the github link:

<https://github.com/username_1/Bitcoin_Core_RPC_par_address>

Let me know what you think or if you have any improvements you might have.


---

