<p>The first problem is that Bitcoin does not use the addresses for working, so Bitcoin does not have the need to give the information for addresses.</p>

<p>So with your test have some problem, that is:</p>

<ul>
<li>Bitcoin Core (bitcoind): not have the method for calculating the balance of the address because a wallet has more addresses and more private keys, for extract all addresses with the balance you can scanning the blockchain and store the information of the address.</li>
<li>btcd: Have the method for calculating the balance of the address but you don't have all addresses used inside the bitcoin blockchain, so for extract all address you can scan the blockchain.</li>
</ul>

<p>So If you want to calculate the "balance" of the address, you can scan the blockchain from the genesis block to the last block and save the address (contains inside the scriptPubKey) for calculating the balance with the simple sum.</p>

<p>if you use the bitcoin core you can get the information with the RPC commands, but you must manage "how to calculate the balance of the address" or you can use and parser for a scan the blk file (with the parser you can be faster in your analysis).</p>

<p>I want to add more information to the address of bitcoin.</p>

<p>The bitcoin wallet works with more addresses and more private keys, so in the more cases, the balance of the wallet is different from the balance of the address.</p>

CC BY-SA 4.0
2019-10-21T20:32:35.943Z
2019-10-21T20:37:39.923Z
2019-10-21T20:37:39.923Z
vincenzopalazzo
<p>I would like to be able to query the balance of an address (not belonging to me). The data should come from a fully synced bitcoin full node inside the local LAN and I do not want to query any api services outside my LAN like blockchain or blockcypher. Of course, API calls inside my LAN would be fine and even preferred. </p>

<p>Which query technique could you recommend me? What's the minimum hardware requirement? I guess that would imply a large index of addresses, would I have to count with the same space as the blockchain data itself?  </p>

<p>I know this question has been treated before, but most solutions posted there are not really up to date or not supported anymore. What's out there as currently supported solutions? </p>

<p>Thank you in advance</p>

<p><strong>Edit:</strong></p>

<p>So far, my research is that <code>bitcoin-cli</code> cannot reveal transactions based on an address, the <code>txindex=1</code>is only useful for using the RPC call <code>getrawtransaction</code> which doesn't allow searching for addresses. </p>

<p>On the other hand, I've installed <code>btcd</code>: it allows using <code>btcctl searchrawtransactions address</code> which at least prints out ALL transactions. That brings me closer, but still doesn't provide me the final balance. Would that have to calculated from the single transactions? If so, how?</p>

CC BY-SA 4.0
2019-10-20T23:45:30.177Z
I'm sorry, I wrote my reply thinking of transactions (while mentioning addresses) and you were asking about addresses. Also thanks to @Murch for pointing it out on my answer's comments. Deleted to avoid further confusion.
Jose Fonseca
CC BY-SA 4.0
2019-10-21T13:18:36.167Z
*"What's out there as currently supported solutions?"*  -- [Software recommendations are off-topic](https://bitcoin.stackexchange.com/help/on-topic) here. Please edit the question to focus on a single problem.
RedGrittyBrick
<api><full-node><query>
Local balance query for Bitcoin address
Michael
# Local balance query for Bitcoin address

(Asked by: username_0 on 2019-10-20)

I would like to be able to query the balance of an address (not belonging to me). The data should come from a fully synced bitcoin full node inside the local LAN and I do not want to query any api services outside my LAN like blockchain or blockcypher. Of course, API calls inside my LAN would be fine and even preferred.

Which query technique could you recommend me? What's the minimum hardware requirement? I guess that would imply a large index of addresses, would I have to count with the same space as the blockchain data itself?

I know this question has been treated before, but most solutions posted there are not really up to date or not supported anymore. What's out there as currently supported solutions?

Thank you in advance

**Edit:**

So far, my research is that `bitcoin-cli` cannot reveal transactions based on an address, the `txindex=1`is only useful for using the RPC call `getrawtransaction` which doesn't allow searching for addresses.

On the other hand, I've installed `btcd`: it allows using `btcctl searchrawtransactions address` which at least prints out ALL transactions. That brings me closer, but still doesn't provide me the final balance. Would that have to calculated from the single transactions? If so, how?

**Tags:** api, full-node, query

> **Comments:**
> **username_1**: I'm sorry, I wrote my reply thinking of transactions (while mentioning addresses) and you were asking about addresses. Also thanks to @Murch for pointing it out on my answer's comments. Deleted to avoid further confusion.  
> **username_2**: *"What's out there as currently supported solutions?"*  -- [Software recommendations are off-topic](https://bitcoin.stackexchange.com/help/on-topic) here. Please edit the question to focus on a single problem.  

---

## 1 answers

### Answer by username_3 on 2019-10-21. Score: 0

The first problem is that Bitcoin does not use the addresses for working, so Bitcoin does not have the need to give the information for addresses.

So with your test have some problem, that is:

* Bitcoin Core (bitcoind): not have the method for calculating the balance of the address because a wallet has more addresses and more private keys, for extract all addresses with the balance you can scanning the blockchain and store the information of the address.
* btcd: Have the method for calculating the balance of the address but you don't have all addresses used inside the bitcoin blockchain, so for extract all address you can scan the blockchain.

So If you want to calculate the "balance" of the address, you can scan the blockchain from the genesis block to the last block and save the address (contains inside the scriptPubKey) for calculating the balance with the simple sum.

if you use the bitcoin core you can get the information with the RPC commands, but you must manage "how to calculate the balance of the address" or you can use and parser for a scan the blk file (with the parser you can be faster in your analysis).

I want to add more information to the address of bitcoin.

The bitcoin wallet works with more addresses and more private keys, so in the more cases, the balance of the wallet is different from the balance of the address.


---

