Where can I query the UTXO database?

5

5

Currently there are 35 million unspent transaction outputs. Is there a site somewhere where I can query this data to see, for instance, how many UTXO's exist with a value less than 20,000 satoshis? Or the total unique scriptPubKey values found in a UTXOs?

priestc

Posted 2016-04-14T18:55:42.153

Reputation: 251

To my knowledge, there is no such site. You could get this with some coding. For example accessing a node's levelDB; see chainstate db keys in the accepted answer of this question.

karask 2016-04-25T08:17:37.790

Answers

2

The standard bitcoind core daemon has no methods to query the UTXO set for reasons I don't know: it should be trivial to give access to it even on a pruned node since it needs to have the full UTXO set at any time to validate a new block.

Anyway a pull request seems in progress to add this capability: https://github.com/bitcoin/bitcoin/pull/8952

There are anyway third party apis to query a single address, for example https://www.blockcypher.com/dev/ or https://chain.so/api

Alessandro Polverini

Posted 2016-04-14T18:55:42.153

Reputation: 191

The pull request you refer to improves the listunspent RPC, which queries the wallet. It does not give you access to the network-side UTXO set. The does exist a gettxout RPC, however.Pieter Wuille 2017-04-17T07:43:58.167

Thanks, I misinterpreted. Anyway I'm still at a loss in understanding why there is no way to query the UTXO. A simple command to check if tx/index is in the UTXO would be a great start, for example.Alessandro Polverini 2017-04-17T16:33:20.510

1That exists, it is called gettxout.Pieter Wuille 2017-04-17T17:42:47.277

@AlessandroPolverini did you find the answer to your question?D L 2017-06-26T13:14:04.927

No, I haven't find any method to list all the UTXO: you already have to know it to query one out of a tx.Alessandro Polverini 2017-06-27T09:28:54.420