<p>Try <code>getbalance "*" 0 true</code>.</p>

<p>help of getbalance says: <code>getbalance ( "account" minconf includeWatchonly )</code></p>

CC BY-SA 3.0
2015-06-20T09:27:52.573Z
i was hoping for balances denominated by address instead of a single number for all addresses. still, cheers for the answer :)
mulllhausen
CC BY-SA 3.0
2015-06-20T10:14:42.910Z
If you like to aggregate by address, you can use `bitcoin-cli getreceivedbyaddress "<adr>" 0`
Jonas Schnelli
CC BY-SA 3.0
2015-06-20T12:52:00.760Z
good to know thanks. but this isn't quite the same as a balance - its the total received but does not subtract spent coins
mulllhausen
CC BY-SA 3.0
2015-06-20T14:04:08.713Z
That is intentional. Addresses are intended to be one-use destinations for payments, and getreceivedbyaddress can tell you whether the expected amount has been paid to it. Apart from that, all coins in the wallet are treated as belonging to the wallet and not to individual addresses, which is simpler to reason about that about individual addresses, especially when change outputs move coins are for privacy reasons.
Pieter Wuille
CC BY-SA 3.0
2015-06-20T09:20:30.607Z
2015-06-20T09:20:30.607Z
Jonas Schnelli
<p>i'm trying to see all tx hashes and the balance for an address i don't own:</p>

<pre><code>$ bitcoin-cli importaddress 1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA
$ # wait 5 minutes while bitcoind presumably scans all txs
$ # for this address
$ bitcoin-cli getbalance 1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA
0.00000000
</code></pre>

<p>bitcoind claims this address has no balance while <a href="https://blockchain.info/address/1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA" rel="nofollow">blockchain.info currently shows</a> a final balance of 0.00993754 BTC</p>

<p>why is this not working?</p>

<p>however the <code>listunspent</code> command appears to list the unspent transactions correctly:</p>

<pre><code>$ bitcoin-cli listunspent 1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA
[
    {
        "txid" : "0fdcdeff329b91fb9888720c958d550c39716f92abec4e5b6ff7c53a22bb31c2",
        "vout" : 0,
        "address" : "1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA",
        "account" : "",
        "scriptPubKey" : "76a914dbf61ed2ce1def33a34d89ab7b05ccc25d9cf02288ac",
        "amount" : 0.00010000,
        "confirmations" : 3608,
        "spendable" : false
    },
    {
        "txid" : "db1beb183808e8b41064405d43bd6c684874b5f328bfb565c4e16cc2baaa0d18",
        "vout" : 1,
        "address" : "1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA",
        "account" : "",
        "scriptPubKey" : "76a914dbf61ed2ce1def33a34d89ab7b05ccc25d9cf02288ac",
        "amount" : 0.00983754,
        "confirmations" : 4459,
        "spendable" : false
    }
]
</code></pre>

<p>adding up the funds here: <code>0.00983754 + 0.00010000 = 0.00993754</code> matches the blockchain.info figure. maybe <code>getbalance</code> only shows spendable funds?</p>

<bitcoind><watch-only>
watch-only wallet with bitcoin-cli
mulllhausen
# watch-only wallet with bitcoin-cli

(Asked by: username_0 on 2015-06-20)

i'm trying to see all tx hashes and the balance for an address i don't own:

```
$ bitcoin-cli importaddress 1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA
$ # wait 5 minutes while bitcoind presumably scans all txs
$ # for this address
$ bitcoin-cli getbalance 1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA
0.00000000

```

bitcoind claims this address has no balance while [blockchain.info currently shows](https://blockchain.info/address/1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA) a final balance of 0.00993754 BTC

why is this not working?

however the `listunspent` command appears to list the unspent transactions correctly:

```
$ bitcoin-cli listunspent 1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA
[
    {
        "txid" : "0fdcdeff329b91fb9888720c958d550c39716f92abec4e5b6ff7c53a22bb31c2",
        "vout" : 0,
        "address" : "1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA",
        "account" : "",
        "scriptPubKey" : "76a914dbf61ed2ce1def33a34d89ab7b05ccc25d9cf02288ac",
        "amount" : 0.00010000,
        "confirmations" : 3608,
        "spendable" : false
    },
    {
        "txid" : "db1beb183808e8b41064405d43bd6c684874b5f328bfb565c4e16cc2baaa0d18",
        "vout" : 1,
        "address" : "1M43pksKTGpBd8J8XzjStjgnX5vie1kpYA",
        "account" : "",
        "scriptPubKey" : "76a914dbf61ed2ce1def33a34d89ab7b05ccc25d9cf02288ac",
        "amount" : 0.00983754,
        "confirmations" : 4459,
        "spendable" : false
    }
]

```

adding up the funds here: `0.00983754 + 0.00010000 = 0.00993754` matches the blockchain.info figure. maybe `getbalance` only shows spendable funds?

**Tags:** bitcoind, watch-only


---

## 1 answers

### Answer by username_1 on 2015-06-20. Score: 1 | Accepted answer

Try `getbalance "*" 0 true`.

help of getbalance says: `getbalance ( "account" minconf includeWatchonly )`

> **Comments:**
> **username_0**: i was hoping for balances denominated by address instead of a single number for all addresses. still, cheers for the answer :)  
> **username_1**: If you like to aggregate by address, you can use `bitcoin-cli getreceivedbyaddress "<adr>" 0`  
> **username_0**: good to know thanks. but this isn't quite the same as a balance - its the total received but does not subtract spent coins  
> **username_2**: That is intentional. Addresses are intended to be one-use destinations for payments, and getreceivedbyaddress can tell you whether the expected amount has been paid to it. Apart from that, all coins in the wallet are treated as belonging to the wallet and not to individual addresses, which is simpler to reason about that about individual addresses, especially when change outputs move coins are for privacy reasons.  

---

