<p>Your balance is the sum of UTXO (unspent transaction output) values in the blockchain since genesis block (block#0).</p>

<p>UTXO is the coins that the addresses' you control (by having their private keys) received and you haven't spend.</p>

<p>Your wallet keep reference to your UTXOs. So, no need to scan blockchain every time you spend.</p>

CC BY-SA 3.0
2017-02-14T15:30:38.343Z
2017-02-14T15:30:38.343Z
Farghaly
<p>The blockchain defines your balance, but it doesn't have a specific field in which your balance is stored.</p>

<p>Yes, it needs to be analyzed to find your balance. However, it doesn't have to be analyzed all over again, just to check for the balance of a new address. Instead, checking the UTXO set (which only has to be created once and then to be updated every time new blocks are received) is sufficient. Furthermore, not the entire UTXO set has to be traversed. There are things like <a href="https://en.wikipedia.org/wiki/Hash_table" rel="noreferrer">hash maps</a> which make this a lot easier.</p>

CC BY-SA 3.0
2017-02-14T15:18:21.717Z
2017-02-14T15:18:21.717Z
UTF-8
<p>This is possibly a duplicate but, since I am a Bitcoin dummy I cannot find it.</p>

<p>Anyhow; as I understand (and I will make some assumptions here), a block in the blockchain contains one or more transactions.</p>

<p>Transactions are typically bits of information which contains delta's, I mean e.g.: Alice transfers 2 bitcoins to Bert.</p>

<p>So, to determine or verify my bitcoin balance (in order to make a valid transaction), does the whole chain needs to be analysed? If so, is this optimized in any way?</p>

<p>Or am I completely off track here? </p>

CC BY-SA 3.0
2017-02-28T16:13:03.847Z
related: [Can someone explain how the Bitcoin Blockchain works?](http://bitcoin.stackexchange.com/q/12427/5406)
Murch
CC BY-SA 3.0
2017-03-01T18:37:15.473Z
You are on the right track, actually. Each transactions tracks changes in the ownership of bitcoin, so in order to get the total current balance for a particular address, you do need to look at every record of change for said address. Unfortunately, the only way to do that is to analyze every transaction involving that address ever.
John Henry
<balance>
Where is my bitcoin balance stored in the blockchain?
Stefan
# Where is my bitcoin balance stored in the blockchain?

(Asked by: username_0 on 2017-02-14)

This is possibly a duplicate but, since I am a Bitcoin dummy I cannot find it.

Anyhow; as I understand (and I will make some assumptions here), a block in the blockchain contains one or more transactions.

Transactions are typically bits of information which contains delta's, I mean e.g.: Alice transfers 2 bitcoins to Bert.

So, to determine or verify my bitcoin balance (in order to make a valid transaction), does the whole chain needs to be analysed? If so, is this optimized in any way?

Or am I completely off track here?

**Tags:** balance

> **Comments:**
> **username_1**: related: [Can someone explain how the Bitcoin Blockchain works?](http://bitcoin.stackexchange.com/q/12427/5406)  
> **username_2**: You are on the right track, actually. Each transactions tracks changes in the ownership of bitcoin, so in order to get the total current balance for a particular address, you do need to look at every record of change for said address. Unfortunately, the only way to do that is to analyze every transaction involving that address ever.  

---

## 2 answers

### Answer by username_4 on 2017-02-14. Score: 8 | Accepted answer

The blockchain defines your balance, but it doesn't have a specific field in which your balance is stored.

Yes, it needs to be analyzed to find your balance. However, it doesn't have to be analyzed all over again, just to check for the balance of a new address. Instead, checking the UTXO set (which only has to be created once and then to be updated every time new blocks are received) is sufficient. Furthermore, not the entire UTXO set has to be traversed. There are things like [hash maps](https://en.wikipedia.org/wiki/Hash_table) which make this a lot easier.


---

### Answer by username_3 on 2017-02-14. Score: 5

Your balance is the sum of UTXO (unspent transaction output) values in the blockchain since genesis block (block#0).

UTXO is the coins that the addresses' you control (by having their private keys) received and you haven't spend.

Your wallet keep reference to your UTXOs. So, no need to scan blockchain every time you spend.


---

