<p>The balance is calculated from the UTXO set where unspent outputs belong to the address in question. Most block explorers will enable the transaction index, parse the historical and live data, and dump it into a database that runs on top of bitcoin to track additional statistics. As you can imagine this requires a lot more disk storage, but it makes things like searching faster. </p>

CC BY-SA 3.0
2017-05-08T09:58:25.123Z
Thank you for your answer. Who maintains the UTXO database? Is it distributed like the actual blockchain database and maintained by the same infrastructure that maintains the blockchain database (miners' nodes, etc.)? Is there any reference about the UTXO datastructure? Is it indexed?
mksoi
CC BY-SA 3.0
2017-05-10T00:11:39.153Z
Yes everyone running a node, even pruned nodes will have the UTXO database. Yes, there's reference on UTXO datastructure. Pieter W answers this very well here https://bitcoin.stackexchange.com/questions/28168/what-are-the-keys-used-in-the-blockchain-leveldb-ie-what-are-the-keyvalue-pair
m1xolyd1an
CC BY-SA 3.0
2017-05-06T18:31:52.960Z
2017-05-06T18:31:52.960Z
m1xolyd1an
<p>We know that the bitcoin distributed ledgers is stored in a serialized blockchain based on the transactions' chronicle order.</p>

<p>The current size of this database is about 100 GB. How can they search easily within this database? For example, if I got a paper-wallet previously loaded with some bits from Xapo, and I try to sweep its bitcoin value into a copay wallet (different from Xapo), it takes about 75 second to search &amp; get its balance!</p>

<p>So, how can they search in this large serialized database within this short-time? I am asking about the technology behind that!</p>

<academic-research><blockchain-data-storage>
lookup in distributed ledgers
mksoi
# lookup in distributed ledgers

(Asked by: username_0 on 2017-05-06)

We know that the bitcoin distributed ledgers is stored in a serialized blockchain based on the transactions' chronicle order.

The current size of this database is about 100 GB. How can they search easily within this database? For example, if I got a paper-wallet previously loaded with some bits from Xapo, and I try to sweep its bitcoin value into a copay wallet (different from Xapo), it takes about 75 second to search & get its balance!

So, how can they search in this large serialized database within this short-time? I am asking about the technology behind that!

**Tags:** academic-research, blockchain-data-storage


---

## 1 answers

### Answer by username_1 on 2017-05-06. Score: 2 | Accepted answer

The balance is calculated from the UTXO set where unspent outputs belong to the address in question. Most block explorers will enable the transaction index, parse the historical and live data, and dump it into a database that runs on top of bitcoin to track additional statistics. As you can imagine this requires a lot more disk storage, but it makes things like searching faster.

> **Comments:**
> **username_0**: Thank you for your answer. Who maintains the UTXO database? Is it distributed like the actual blockchain database and maintained by the same infrastructure that maintains the blockchain database (miners' nodes, etc.)? Is there any reference about the UTXO datastructure? Is it indexed?  
> **username_1**: Yes everyone running a node, even pruned nodes will have the UTXO database. Yes, there's reference on UTXO datastructure. Pieter W answers this very well here https://bitcoin.stackexchange.com/questions/28168/what-are-the-keys-used-in-the-blockchain-leveldb-ie-what-are-the-keyvalue-pair  

---

