<p>I believe what you are looking for is and address based index for txout. Have a look here <a href="https://bitcointalk.org/index.php?topic=1395749.msg14194272#msg14194272" rel="nofollow">https://bitcointalk.org/index.php?topic=1395749.msg14194272#msg14194272</a></p>

<p>Your basic idea of keeping a map of address -> txout is ok. You might want to rethink about storing in memory. Current bitcoind chainstate is around 1.2G (compressed state). </p>

CC BY-SA 3.0
2018-01-16T03:21:32.923Z
how can I know the size of the chain state today?
Giszmo
CC BY-SA 3.0
2018-01-16T11:15:49.050Z
Currently its around 3.2 GB . You need to run  a bitcoin node and see size of .bitcoin/chainstate directory
dark knight
CC BY-SA 3.0
2016-03-21T14:37:21.253Z
2016-03-21T14:37:21.253Z
dark knight
<p>I haven't been able to find information on how to efficiently index UTXOs. Can you explain or point me to some resources?</p>

<p>Update: Btw, I understand completely that the notion of address balance is awkward at best, and that it can never really be known with 100% confidence, especially as P2SH transactions gain popularity.</p>

CC BY-SA 3.0
2014-10-09T08:24:36.223Z
Index for what type of querying?
Pieter Wuille
CC BY-SA 3.0
2014-10-09T11:38:59.653Z
haven't tried anything as I'm not an expert on indices, but have browsed a ton of bitcointalk and couldn't find anything.      
@PieterWuille to query balances for addresses.
stanm87
CC BY-SA 3.0
2014-10-13T15:12:57.660Z
So after doing more digging, here's is what I'm thinking: read the chainstate db from bitcoin core, either directly or via rpc, and then flip the index. I was thinking of putting it in a redis hash, with addresses as keys and transactions as values. This way I can use HSCAN to iterate over the transactions that point to an address and get its balance. The reason I want to use Redis is because this datastructure will be updated quite often, and having everything in RAM is good for that use case. What do you think?
stanm87
CC BY-SA 3.0
2014-10-22T17:57:02.323Z
Does this answer your question? http://bitcoin.stackexchange.com/questions/5518/how-do-i-access-information-on-blockexplorer-com-or-blockchain-info-without-issu
Nick ODell
CC BY-SA 3.0
2014-10-22T21:09:37.563Z
@NickODell not at all
stanm87
<transactions><utxo>
How to index the UTXO set efficiently?
stanm87
# How to index the UTXO set efficiently?

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

I haven't been able to find information on how to efficiently index UTXOs. Can you explain or point me to some resources?

Update: Btw, I understand completely that the notion of address balance is awkward at best, and that it can never really be known with 100% confidence, especially as P2SH transactions gain popularity.

**Tags:** transactions, utxo

> **Comments:**
> **username_1**: Index for what type of querying?  
> **username_0**: haven't tried anything as I'm not an expert on indices, but have browsed a ton of bitcointalk and couldn't find anything.       @username_1 to query balances for addresses.  
> **username_0**: So after doing more digging, here's is what I'm thinking: read the chainstate db from bitcoin core, either directly or via rpc, and then flip the index. I was thinking of putting it in a redis hash, with addresses as keys and transactions as values. This way I can use HSCAN to iterate over the transactions that point to an address and get its balance. The reason I want to use Redis is because this datastructure will be updated quite often, and having everything in RAM is good for that use case. What do you think?  
> **username_2**: Does this answer your question? http://bitcoin.stackexchange.com/questions/5518/how-do-i-access-information-on-blockexplorer-com-or-blockchain-info-without-issu  
> **username_0**: @username_2 not at all  

---

## 1 answers

### Answer by username_3 on 2016-03-21. Score: 2

I believe what you are looking for is and address based index for txout. Have a look here <https://bitcointalk.org/index.php?topic=1395749.msg14194272#msg14194272>

Your basic idea of keeping a map of address -> txout is ok. You might want to rethink about storing in memory. Current bitcoind chainstate is around 1.2G (compressed state).

> **Comments:**
> **username_4**: how can I know the size of the chain state today?  
> **username_3**: Currently its around 3.2 GB . You need to run  a bitcoin node and see size of .bitcoin/chainstate directory  

---

