btcsuite / btcd

An alternative full node bitcoin implementation written in Go (golang)
https://github.com/btcsuite/btcd/blob/master/README.md
ISC License
6.28k stars 2.38k forks source link

UTXO rpc #1115

Open winteraz opened 6 years ago

winteraz commented 6 years ago

I'm need to get the UTXO of arbitrary addresses akin blockchain.info api call[0]. Is this possible with btcsuite?

[0] https://blockchain.info/api/blockchain_api Unspent outputs


    https://blockchain.info/unspent?active=$address
    Multiple Addresses Allowed separated by "|"
    Address can be base58 or xpub

{
    "unspent_outputs":[
        {
            "tx_age":"1322659106",
            "tx_hash":"e6452a2cb71aa864aaa959e647e7a4726a22e640560f199f79b56b5502114c37",
            "tx_index":"12790219",
            "tx_output_n":"0",
            "script":"76a914641ad5051edd97029a003fe9efb29359fcee409d88ac", (Hex encoded)
            "value":"5000661330"
        }
    ]
}
Roasbeef commented 6 years ago

See the gettxout RPC command. Or even the address index depending on your use case.

stevenroose commented 6 years ago

In my gRPC PR, I implemented a method GetAddressUnspentOutputs to get all unspent outputs for a given address.

In this PR a method is implemented (also for gRPC) that allows retrieving the entire UTXO set.

ghost commented 5 years ago

This would be pretty handy. I think it'd allow btcd to work in place of Insight for the most part.