<blockquote>
<p>Fetch any given address balance</p>
</blockquote>
<p>This cannot be done with Bitcoin Core. ElectrumX and electrs are examples of software that maintain an address index, which is a database that allows the lookup of the transactions, balance, UTXOs, etc. of any address. Bitcoin Core does not have an address index, and so it cannot be used for any task which requires fast lookup of this information.</p>
<p>You may see RPCs in Bitcoin Core which seem like they would allow for the arbitrary address information lookup. However these are often wallet RPCs and can only do these lookups for anything that the loaded wallets own, not any arbitrary address. There are also some RPCs that can compute this information as needed, but these end up being very slow and so unusable for the tasks that external address indexes are often used for.</p>

CC BY-SA 4.0
2023-01-01T11:45:55.873Z
Thank you! I have another follow-up. Do you think arbitrary tx lookups are also too slow via bitcoind RPC `getrawtransaction`? I have `txindex` enabled in the config. My node would crash after some time as it ran out of memory (because I was quering 5k txns every few mins in 5 batches of 1k). So doubled the memory. It hasn't run out yet, but I'll test it for another week.
Ravi Ojha
CC BY-SA 4.0
2023-01-01T18:32:23.003Z
`getrawtransaction` is relatively fast if you have txindex enabled (much faster than `scantxoutset` or rescanning), but whether it's fast enough for your particular purpose is something only you can assess.
Pieter Wuille
CC BY-SA 4.0
2023-01-03T08:36:38.150Z
You may also check out this somewhat related question, for details on the problems of using Bitcoin Core to retrieve the balance of an arbitrary address:
https://bitcoin.stackexchange.com/questions/116263/obtaining-balance-utxos-of-an-address-from-bitcoin-core-blockbook-or-some-othe
OptOut
CC BY-SA 4.0
2023-01-01T03:01:42.637Z
2023-01-01T03:01:42.637Z
Ava Chow
<p>I'm running a full bitcoin node. No pruning. Two primary use cases:</p>
<ul>
<li>Parse the most recent block and all the transactions in it</li>
<li>Fetch any given address balance</li>
</ul>
<p>Both these can be achieved by just the <code>bitcoind</code> service and using its RPC methods. Coming to the question, why has the community built <code>electrumx</code>, <code>electrs</code> on top of it? I read they make some queries faster. But none of them explain which queries and how much of an efficiency improvement over just running <code>bitcoid</code>.</p>

<bitcoin-core><bitcoind><electrum>
Why do we need electrs or electrumx alongside bitcoin-core?
Ravi Ojha
# Why do we need electrs or electrumx alongside bitcoin-core?

(Asked by: username_0 on 2023-01-01)

I'm running a full bitcoin node. No pruning. Two primary use cases:

* Parse the most recent block and all the transactions in it
* Fetch any given address balance

Both these can be achieved by just the `bitcoind` service and using its RPC methods. Coming to the question, why has the community built `electrumx`, `electrs` on top of it? I read they make some queries faster. But none of them explain which queries and how much of an efficiency improvement over just running `bitcoid`.

**Tags:** bitcoin-core, bitcoind, electrum


---

## 1 answers

### Answer by username_1 on 2023-01-01. Score: 8 | Accepted answer

> Fetch any given address balance

This cannot be done with Bitcoin Core. ElectrumX and electrs are examples of software that maintain an address index, which is a database that allows the lookup of the transactions, balance, UTXOs, etc. of any address. Bitcoin Core does not have an address index, and so it cannot be used for any task which requires fast lookup of this information.

You may see RPCs in Bitcoin Core which seem like they would allow for the arbitrary address information lookup. However these are often wallet RPCs and can only do these lookups for anything that the loaded wallets own, not any arbitrary address. There are also some RPCs that can compute this information as needed, but these end up being very slow and so unusable for the tasks that external address indexes are often used for.

> **Comments:**
> **username_0**: Thank you! I have another follow-up. Do you think arbitrary tx lookups are also too slow via bitcoind RPC `getrawtransaction`? I have `txindex` enabled in the config. My node would crash after some time as it ran out of memory (because I was quering 5k txns every few mins in 5 batches of 1k). So doubled the memory. It hasn't run out yet, but I'll test it for another week.  
> **username_2**: `getrawtransaction` is relatively fast if you have txindex enabled (much faster than `scantxoutset` or rescanning), but whether it's fast enough for your particular purpose is something only you can assess.  
> **username_3**: You may also check out this somewhat related question, for details on the problems of using Bitcoin Core to retrieve the balance of an arbitrary address: https://bitcoin.stackexchange.com/questions/116263/obtaining-balance-utxos-of-an-address-from-bitcoin-core-blockbook-or-some-othe  

---

