<blockquote>
<p><strong>So does anyone know what exactly to do in this situation and what the optimal solution is?</strong></p>
</blockquote>
<p>I don't, however the btc-rpc-explorer <a href="https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample" rel="nofollow noreferrer">document you referred to</a>) says</p>
<pre><code># Select optional &quot;address API&quot; to display address tx lists and balances
# Options: electrum, electrumx, blockchain.com, blockchair.com, blockcypher.com
</code></pre>
<p>Which seems to me to suggest you might need one of those to use with the <code>addrindex</code> api it provides.</p>
<hr />
<blockquote>
<p><strong>I'm looking to create an index on addresses in my bitcoin full node in order to fetch the balances of a list of addresses from the blockchain for an academic project without using the public explorers.</strong></p>
</blockquote>
<p>This seems like it <em>might</em> be similar to <a href="https://bitcoin.stackexchange.com/q/114804/13866">How can I take a &quot;snapshot&quot; of the bitcoin blockchain and analyze it?</a> - maybe you could consider a similar approach and perhaps build your own indexes if you need to track changing balances forward in time?</p>
<p>If the number of addresses of interest is small and known in advance, I <em>think</em> you can import them and perform a rescan and then use the Bitcin core RPC API <code>getbalance</code>, <code>getbalances</code> or <code>listreceivedbyaddress</code> to retrieve balances for those specific imported &quot;watch-only&quot; addresses.</p>
<hr />
<p>Related:</p>
<ul>
<li><a href="https://bitcointalk.org/index.php?topic=3016279.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=3016279.0</a></li>
<li>comments on <a href="https://bitcoin.stackexchange.com/q/116053/13866">Analyse huge amount of blockchain data</a></li>
</ul>

CC BY-SA 4.0
2022-11-22T09:08:01.067Z
Yes, I've seen the optional address api which seems to tae an electrum server as input or some other public server. but I dont understand the need for one of those. Shouldn't Bitcoin core support such a necessary index? I did some research on ElectrumX and it seems to require some similar resources to that of the bitcoin full node, which what I'd like to avoid. So I'm looking into exploring the addrindex patches if there's any decent functioning one.
Unfortunately, the number of addresses is not small enough to insert them manually, for each rescan takes about a minute (I've tried it)
Helmi
CC BY-SA 4.0
2022-11-22T12:04:29.950Z
I guess Bitcoin core is primarily a wallet and not a research tool. Obviously a wallet only needs to keep an index of addresses and transactions relevant to the normal wallet user. That is those relating to private keys in the wallet or to imported addresses
RedGrittyBrick
CC BY-SA 4.0
2022-11-22T13:55:01.433Z
is there any way to create this address index? I've seen mention of addrindex patch to the bitcoin core and mention of electrum server and electrum wallet but I'm not sure if it will help me reach what I want.
Helmi
CC BY-SA 4.0
2022-11-22T14:12:53.317Z
See amended answer. Patch seems abandoned. Writing your own index seems worth considering. Either from block data or using callback?
RedGrittyBrick
CC BY-SA 4.0
2022-12-23T20:32:25.003Z
Bitcoin Core is primarily a full node, which is used to create your own verified copy of the UTXO set (the “ledger”), by parsing the blockchain (the “transaction journal”). It's not a block explorer. Bitcoin Core has never provided address information with the exception of the Bitcoin Core wallet tracking its own addresses.
Murch
CC BY-SA 4.0
2022-11-21T23:46:36.730Z
2022-11-22T14:10:40.807Z
2022-11-22T14:10:40.807Z
RedGrittyBrick
<p>I'm looking to create an index on addresses in my bitcoin full node in order to fetch the balances of a list of addresses from the blockchain for an academic project without using the public explorers. For that I installed the Bitcoin Core client (version 22) and configured it as follows:</p>
<pre><code># [core]
# Maintain a full transaction index, used by the getrawtransaction rpc call.
txindex=1
addrindex=1

# Maintain coinstats index used by the gettxoutsetinfo RPC.
coinstatsindex=1
# Run in the background as a daemon and accept commands.
daemon=1


# [rpc]
# Accept command line and JSON-RPC commands.
server=1
# Accept public REST requests.
rest=1
# rpc auth settings
rpcauth=*******

dbcache=1000
</code></pre>
<p>And after that, I installed the <code>bitcoin-rpc-explorer</code> to create a private explorer which is pointed to my bitcoin node correctly (below in my env file for this explorer with the rest of the parameters set to default):</p>
<pre><code>BTCEXP_COIN=BTC
BTCEXP_BITCOIND_HOST=127.0.0.1
BTCEXP_BITCOIND_PORT=8332
BTCEXP_BITCOIND_USER=*******
BTCEXP_BITCOIND_PASS=*******
BTCEXP_BITCOIND_COOKIE=/path/to/bitcoind/.cookie
BTCEXP_BITCOIND_RPC_TIMEOUT=5000
</code></pre>
<p>However, when I insert an address in the search bar, I get this message</p>
<pre><code>No address API is configured.
See the example configuration file for help setting up an address API.
</code></pre>
<p>which points me to the sample config file of the bitcoin node github repo (<a href="https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample" rel="nofollow noreferrer">https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample</a>)</p>
<p>so I checked my node's indexes with the <strong>getindexinfo</strong> command and I got this:</p>
<pre><code>{
  &quot;txindex&quot;: {
    &quot;synced&quot;: true,
    &quot;best_block_height&quot;: 764153
  },
  &quot;coinstatsindex&quot;: {
    &quot;synced&quot;: true,
    &quot;best_block_height&quot;: 764153
  }
}
</code></pre>
<p>So it would seem that <code>addrindex</code> is not working for some reason. I did some research and a comment mentioned that support for this index has been removed from recent versions of Bitcoin Core and that I should use an Electrum server and Electrum Wallet for this and another link mentioned an <code>addrindex</code> patch to install.</p>
<p>So does anyone know what exactly to do in this situation and what the optimal solution is?
And is there any recommended <code>addrindex</code> patch for Bitcoin Core if any?</p>

CC BY-SA 4.0
2022-11-21T17:53:12.823Z
`addrindex` has never been a supported feature in Bitcoin Core.
Pieter Wuille
CC BY-SA 4.0
2022-11-22T11:11:34.257Z
is there any alternative for it that you know of? How do the public blockchain explorers provide the service of viewing an address' data and balance so quickly?
Helmi
CC BY-SA 4.0
2022-11-22T14:01:16.990Z
There are lots of software indexers, including Electrum servers like electrs, that can provide pre-aggregated address information. Bitcoin Core just isn't one of those.
Pieter Wuille
<bitcoin-core><bitcoin-cli>
How do I get Bitcoin Core's addrindex to work?
Helmi
# How do I get Bitcoin Core's addrindex to work?

(Asked by: username_0 on 2022-11-21)

I'm looking to create an index on addresses in my bitcoin full node in order to fetch the balances of a list of addresses from the blockchain for an academic project without using the public explorers. For that I installed the Bitcoin Core client (version 22) and configured it as follows:

```
# [core]
# Maintain a full transaction index, used by the getrawtransaction rpc call.
txindex=1
addrindex=1

# Maintain coinstats index used by the gettxoutsetinfo RPC.
coinstatsindex=1
# Run in the background as a daemon and accept commands.
daemon=1

# [rpc]
# Accept command line and JSON-RPC commands.
server=1
# Accept public REST requests.
rest=1
# rpc auth settings
rpcauth=*******

dbcache=1000

```

And after that, I installed the `bitcoin-rpc-explorer` to create a private explorer which is pointed to my bitcoin node correctly (below in my env file for this explorer with the rest of the parameters set to default):

```
BTCEXP_COIN=BTC
BTCEXP_BITCOIND_HOST=127.0.0.1
BTCEXP_BITCOIND_PORT=8332
BTCEXP_BITCOIND_USER=*******
BTCEXP_BITCOIND_PASS=*******
BTCEXP_BITCOIND_COOKIE=/path/to/bitcoind/.cookie
BTCEXP_BITCOIND_RPC_TIMEOUT=5000

```

However, when I insert an address in the search bar, I get this message

```
No address API is configured.
See the example configuration file for help setting up an address API.

```

which points me to the sample config file of the bitcoin node github repo (<https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample>)

so I checked my node's indexes with the **getindexinfo** command and I got this:

```
{
  "txindex": {
    "synced": true,
    "best_block_height": 764153
  },
  "coinstatsindex": {
    "synced": true,
    "best_block_height": 764153
  }
}

```

So it would seem that `addrindex` is not working for some reason. I did some research and a comment mentioned that support for this index has been removed from recent versions of Bitcoin Core and that I should use an Electrum server and Electrum Wallet for this and another link mentioned an `addrindex` patch to install.

So does anyone know what exactly to do in this situation and what the optimal solution is?
And is there any recommended `addrindex` patch for Bitcoin Core if any?

**Tags:** bitcoin-core, bitcoin-cli

> **Comments:**
> **username_1**: `addrindex` has never been a supported feature in Bitcoin Core.  
> **username_0**: is there any alternative for it that you know of? How do the public blockchain explorers provide the service of viewing an address' data and balance so quickly?  
> **username_1**: There are lots of software indexers, including Electrum servers like electrs, that can provide pre-aggregated address information. Bitcoin Core just isn't one of those.  

---

## 1 answers

### Answer by username_2 on 2022-11-21. Score: 1

> **So does anyone know what exactly to do in this situation and what the optimal solution is?**

I don't, however the btc-rpc-explorer [document you referred to](https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample)) says

```
# Select optional "address API" to display address tx lists and balances
# Options: electrum, electrumx, blockchain.com, blockchair.com, blockcypher.com

```

Which seems to me to suggest you might need one of those to use with the `addrindex` api it provides.

---

> **I'm looking to create an index on addresses in my bitcoin full node in order to fetch the balances of a list of addresses from the blockchain for an academic project without using the public explorers.**

This seems like it *might* be similar to [How can I take a "snapshot" of the bitcoin blockchain and analyze it?](https://bitcoin.stackexchange.com/q/114804/13866) - maybe you could consider a similar approach and perhaps build your own indexes if you need to track changing balances forward in time?

If the number of addresses of interest is small and known in advance, I *think* you can import them and perform a rescan and then use the Bitcin core RPC API `getbalance`, `getbalances` or `listreceivedbyaddress` to retrieve balances for those specific imported "watch-only" addresses.

---

Related:

* <https://bitcointalk.org/index.php?topic=3016279.0>
* comments on [Analyse huge amount of blockchain data](https://bitcoin.stackexchange.com/q/116053/13866)

> **Comments:**
> **username_0**: Yes, I've seen the optional address api which seems to tae an electrum server as input or some other public server. but I dont understand the need for one of those. Shouldn't Bitcoin core support such a necessary index? I did some research on ElectrumX and it seems to require some similar resources to that of the bitcoin full node, which what I'd like to avoid. So I'm looking into exploring the addrindex patches if there's any decent functioning one. Unfortunately, the number of addresses is not small enough to insert them manually, for each rescan takes about a minute (I've tried it)  
> **username_2**: I guess Bitcoin core is primarily a wallet and not a research tool. Obviously a wallet only needs to keep an index of addresses and transactions relevant to the normal wallet user. That is those relating to private keys in the wallet or to imported addresses  
> **username_0**: is there any way to create this address index? I've seen mention of addrindex patch to the bitcoin core and mention of electrum server and electrum wallet but I'm not sure if it will help me reach what I want.  
> **username_2**: See amended answer. Patch seems abandoned. Writing your own index seems worth considering. Either from block data or using callback?  
> **username_3**: Bitcoin Core is primarily a full node, which is used to create your own verified copy of the UTXO set (the “ledger”), by parsing the blockchain (the “transaction journal”). It's not a block explorer. Bitcoin Core has never provided address information with the exception of the Bitcoin Core wallet tracking its own addresses.  

---

