1

I'm working on some statistics concerning the distribution of the UTXO set. I'm especially interested in the values of the UTXO, and would perhaps like to limit extraction to certain sections of the blockchain.

Is there already a tool or script that lets me extract UTXO data?

Murch
  • 75,206
  • 34
  • 186
  • 622

1 Answers1

2

Peter Wuille describes exactly how the UTXO data is stored in the chainstate directory of your locally-running full node:

What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?

You'll want to scroll down to "Inside the chain state database".

You can grab the unspent amounts, transaction hashes and indices. The exact format specification can be found here:

https://github.com/bitcoin/bitcoin/blob/d4a42334d447cad48fb3996cad0fd5c945b75571/src/coins.h#L19

Jimmy Song
  • 7,759
  • 17
  • 35