<p>Bitcoin at the protocol level, the Bitcoin Core implementation and its wallet implementation do not have a concept of "address balance". The protocol only has a notion of unspent transaction outputs ("coins") with a particular value and script to limit who can spend it. You can reasonably define the balance of an address as the sum of the values of all unspent transaction outputs with a script that can be spent using the key corresponding to that address, but the core implementation has no need for this.</p>

<p>The wallet doesn't track address balances either - it considers the pool of coins the entire wallet can spend, and keeps track of their total value. As for privacy of the system (not just yours) the recommendation is to simply use a different address for every incoming transaction, there is little use for per-address tracking either. The next release (0.10) will likely have support for watch-only wallets, which allow adding addresses to the wallet without the corresponding private key, allowing tracking of arbitrary sets of coins, but still not aggregated by address.</p>

<p>There are external tools that can do efficient querying of such aggregated data from the blockchain, like ABE and Insight.</p>

CC BY-SA 3.0
2014-08-23T12:23:00.240Z
2014-08-23T12:23:00.240Z
Pieter Wuille
<p>I was under the assumption that the bitcoind server allowed you to query the blockchain and run commands like <code>bitcoind getbalance</code> on any address. I'm finding out that you may query addresses in your wallet. Is this correct?</p>

<p>What is required to query the blockchain with commands like think locally without the need for external API's? </p>

<p>My intention is to use a Perl script to get account balances.</p>

<blockchain><bitcoind><development>
Blockchain command line tools
Sebastien
# Blockchain command line tools

(Asked by: username_0 on 2014-08-21)

I was under the assumption that the bitcoind server allowed you to query the blockchain and run commands like `bitcoind getbalance` on any address. I'm finding out that you may query addresses in your wallet. Is this correct?

What is required to query the blockchain with commands like think locally without the need for external API's?

My intention is to use a Perl script to get account balances.

**Tags:** blockchain, bitcoind, development


---

## 1 answers

### Answer by username_1 on 2014-08-23. Score: 2

Bitcoin at the protocol level, the Bitcoin Core implementation and its wallet implementation do not have a concept of "address balance". The protocol only has a notion of unspent transaction outputs ("coins") with a particular value and script to limit who can spend it. You can reasonably define the balance of an address as the sum of the values of all unspent transaction outputs with a script that can be spent using the key corresponding to that address, but the core implementation has no need for this.

The wallet doesn't track address balances either - it considers the pool of coins the entire wallet can spend, and keeps track of their total value. As for privacy of the system (not just yours) the recommendation is to simply use a different address for every incoming transaction, there is little use for per-address tracking either. The next release (0.10) will likely have support for watch-only wallets, which allow adding addresses to the wallet without the corresponding private key, allowing tracking of arbitrary sets of coins, but still not aggregated by address.

There are external tools that can do efficient querying of such aggregated data from the blockchain, like ABE and Insight.


---

