<p>The utxo set is indexed by <code>transaction_id + out_index</code> from Bitcoin Core 0.15 onwards (just by <code>transaction_id</code> from 0.8 - 0.14). So in order to get all UTXOs for a certain height you need to parse the whole set and filter it by height.</p>

<p>There's no way of doing so with <code>bitcoin-cli</code> AFAIK. You can do it by using <a href="https://github.com/sr-gi/bitcoin_tools/tree/master/bitcoin_tools/analysis/status" rel="nofollow noreferrer">STATUS</a> (a tool I'm coauthor of). Feel free to ask for support if needed.</p>

CC BY-SA 3.0
2018-04-18T21:16:37.917Z
I took a look at it, you parse the ".bitcoin/chainstate" directory, does this contain all outputs or just the utxo at current chain height?
gdkrmr
CC BY-SA 3.0
2018-04-18T22:20:07.977Z
Contains all the utxos at the height the chainstate is updated to.
sr_gi
CC BY-SA 3.0
2018-04-19T07:18:07.857Z
is it possible then to get the utxo at an earlier chainstate?
gdkrmr
CC BY-SA 3.0
2018-04-19T08:21:23.447Z
You can work it around by re-downloading the blockchain and stop the sync process at the block height you'd like to analyze. We have a script designed for this as part of the dev brach at https://github.com/sr-gi/bitcoin_tools/blob/dev/bitcoin_tools/analysis/status/kill_at_heigh.py
sr_gi
CC BY-SA 3.0
2018-04-18T10:43:59.107Z
2018-04-18T10:43:59.107Z
sr_gi
<p>I have the reference client running with a complete transaction index. 
Is it possible to get all UTXO for a certain height of the chain either via <code>bitcoin-cli</code> or some other tool?</p>

<utxo><bitcoin-cli><height><utxo-set>
get utxo at a certain chain height
gdkrmr
# get utxo at a certain chain height

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

I have the reference client running with a complete transaction index.
Is it possible to get all UTXO for a certain height of the chain either via `bitcoin-cli` or some other tool?

**Tags:** utxo, bitcoin-cli, height, utxo-set


---

## 1 answers

### Answer by username_1 on 2018-04-18. Score: 1

The utxo set is indexed by `transaction_id + out_index` from Bitcoin Core 0.15 onwards (just by `transaction_id` from 0.8 - 0.14). So in order to get all UTXOs for a certain height you need to parse the whole set and filter it by height.

There's no way of doing so with `bitcoin-cli` AFAIK. You can do it by using [STATUS](https://github.com/username_1/bitcoin_tools/tree/master/bitcoin_tools/analysis/status) (a tool I'm coauthor of). Feel free to ask for support if needed.

> **Comments:**
> **username_0**: I took a look at it, you parse the ".bitcoin/chainstate" directory, does this contain all outputs or just the utxo at current chain height?  
> **username_1**: Contains all the utxos at the height the chainstate is updated to.  
> **username_0**: is it possible then to get the utxo at an earlier chainstate?  
> **username_1**: You can work it around by re-downloading the blockchain and stop the sync process at the block height you'd like to analyze. We have a script designed for this as part of the dev brach at https://github.com/username_1/bitcoin_tools/blob/dev/bitcoin_tools/analysis/status/kill_at_heigh.py  

---

