<p>Bitcoin's blockchain does not track total amounts of bitcoin owned by individual addresses, only the changes in amounts (i.e. transactions between addresses).</p>

<p>To know the total amount of bitcoin a single address owns, wallet software must search the blockchain for transactions that reference that address. Then, using those transactions, the wallet software must sum the ins and outs of bitcoin coming from and going to that address.</p>

CC BY-SA 3.0
2017-12-29T23:51:10.217Z
Wouldn't this be extremely slow? How can bitref.com determine your balance so quickly?
nareddyt
CC BY-SA 3.0
2017-12-30T07:27:51.607Z
It can be slow, but it reduces the amount of space used on the blockchain. It is likely that bitref.com have written an indexing software which maintains a map of used addresses and their balances.
Matthew Stannard
CC BY-SA 3.0
2017-12-29T16:24:55.867Z
2017-12-29T16:50:04.763Z
2017-12-29T16:50:04.763Z
Matthew Stannard
<p>I'm curious how websites like <a href="https://bitref.com/" rel="nofollow noreferrer">bitref.com</a> can determine the balance of a bitcoin wallet very quickly. </p>

<p>I understand that the blockchain stores every single transaction across the thousands of blocks, so it's possible to reconstruct the balance of any wallet with this ledger. But wouldn't it take a long time to scan all these transactions? </p>

<p>Instead, does the blockchain actually store every single address in some sort of map? Would this also contain the balance of each address? If so, I can't find a website where I could view all the addresses on the blockchain. Does anyone know where I can find that?</p>

<blockchain><wallet><address>
What underlying data structure is used to store wallet address on the blockchain?
nareddyt
# What underlying data structure is used to store wallet address on the blockchain?

(Asked by: username_0 on 2017-12-29)

I'm curious how websites like [bitref.com](https://bitref.com/) can determine the balance of a bitcoin wallet very quickly.

I understand that the blockchain stores every single transaction across the thousands of blocks, so it's possible to reconstruct the balance of any wallet with this ledger. But wouldn't it take a long time to scan all these transactions?

Instead, does the blockchain actually store every single address in some sort of map? Would this also contain the balance of each address? If so, I can't find a website where I could view all the addresses on the blockchain. Does anyone know where I can find that?

**Tags:** blockchain, wallet, address


---

## 1 answers

### Answer by username_1 on 2017-12-29. Score: 1 | Accepted answer

Bitcoin's blockchain does not track total amounts of bitcoin owned by individual addresses, only the changes in amounts (i.e. transactions between addresses).

To know the total amount of bitcoin a single address owns, wallet software must search the blockchain for transactions that reference that address. Then, using those transactions, the wallet software must sum the ins and outs of bitcoin coming from and going to that address.

> **Comments:**
> **username_0**: Wouldn't this be extremely slow? How can bitref.com determine your balance so quickly?  
> **username_1**: It can be slow, but it reduces the amount of space used on the blockchain. It is likely that bitref.com have written an indexing software which maintains a map of used addresses and their balances.  

---

