5

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.

1 Answer 1

8

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.

3
  • 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
    Jan 1 at 11:45
  • 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. Jan 1 at 18:32
  • 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: bitcoin.stackexchange.com/questions/116263/…
    – Adam B
    Jan 3 at 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.