0
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?
0
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?
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 (a tool I'm coauthor of). Feel free to ask for support if needed.
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 – 2018-04-18T21:16:37.917
Contains all the utxos at the height the chainstate is updated to. – sr-gi – 2018-04-18T22:20:07.977
is it possible then to get the utxo at an earlier chainstate? – gdkrmr – 2018-04-19T07:18:07.857
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 – 2018-04-19T08:21:23.447