<blockquote>
  <p>How do I calculate the balance of addresses. </p>
</blockquote>

<p>You don't.</p>

<p>There is nothing interesting about the balance of an address.</p>

<p>You may care about how much money you have in your wallet overall; for that, there is the <code>getbalance</code> RPC call.</p>

<p>You may also care about whether a particular payment was received (identified by the address you gave out for that particular invoice). You can use the <code>getreceivedbyaddress</code> RPC.</p>

<blockquote>
  <p>Add up the amounts from all transactions of the receive category for a given address and filtering out transactions that have less than the minimum required confirmations. Is there anything I'm missing or any gotcha's here.</p>
</blockquote>

<p>That will work, but essentially do the same as <code>getreceivedbyaddress</code>. It won't give you a balance, just how much was received.</p>

CC BY-SA 3.0
2018-03-16T01:44:07.930Z
2018-03-16T01:50:19.823Z
2018-03-16T01:50:19.823Z
Pieter Wuille
<p>I have a JSON array of the transactions from the <code>listtransactions</code> call. 
How do I calculate the balance of addresses? </p>

<p>My plan. Add up the amounts from all transactions of the <code>receive</code> category for a given address and filtering out transactions that have less than the minimum required confirmations. Is there anything I'm missing or any gotcha's here.</p>

<bitcoind><json-rpc><listtransactions>
Using the output of listtransactions how can I calculate the balance of certain addresses?
Daniel Kobe
# Using the output of listtransactions how can I calculate the balance of certain addresses?

(Asked by: username_0 on 2018-03-16)

I have a JSON array of the transactions from the `listtransactions` call.
How do I calculate the balance of addresses?

My plan. Add up the amounts from all transactions of the `receive` category for a given address and filtering out transactions that have less than the minimum required confirmations. Is there anything I'm missing or any gotcha's here.

**Tags:** bitcoind, json-rpc, listtransactions


---

## 1 answers

### Answer by username_1 on 2018-03-16. Score: 1

> How do I calculate the balance of addresses.

You don't.

There is nothing interesting about the balance of an address.

You may care about how much money you have in your wallet overall; for that, there is the `getbalance` RPC call.

You may also care about whether a particular payment was received (identified by the address you gave out for that particular invoice). You can use the `getreceivedbyaddress` RPC.

> Add up the amounts from all transactions of the receive category for a given address and filtering out transactions that have less than the minimum required confirmations. Is there anything I'm missing or any gotcha's here.

That will work, but essentially do the same as `getreceivedbyaddress`. It won't give you a balance, just how much was received.


---

