getaddressutxos - Zcash

This method returns all unspent transaction outputs (UTXOs) held by one or more transparent addresses. Optionally includes chain-info metadata (chain tip height and hash) alongside the UTXOs for consistency guarantees. Transparent UTXOs only — shielded notes are not enumerable.

Parameters

ParameterTypeRequiredDescription
addresses_or_objectobjectYesRequest object (see below)

Request Object

FieldTypeRequiredDescription
addressesarray of stringYesTransparent addresses to query
chainInfobooleanNoIf true, wrap the UTXO list in a chain-info envelope. Default false

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getaddressutxos",
    "params": [
        {
            "addresses": [
                "t1KfwsnwJeNRVjQGBDZhwKskpQbih2qx5Ua"
            ],
            "chainInfo": true
        }
    ],
    "id": "getblock.io"
}'

example.js

javascriptconst axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'getaddressutxos',
    params: [
        {
            "addresses": [
                "t1KfwsnwJeNRVjQGBDZhwKskpQbih2qx5Ua"
            ],
            "chainInfo": true
        }
    ],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'getaddressutxos',
        'params': [
        {
            "addresses": [
                "t1KfwsnwJeNRVjQGBDZhwKskpQbih2qx5Ua"
            ],
            "chainInfo": true
        }
    ],
        'id': 'getblock.io'
    }
)

print(response.json())

example.rs

rustuse reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    
    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header("Content-Type", "application/json")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "getaddressutxos",
            "params": [
        {
            "addresses": [
                "t1KfwsnwJeNRVjQGBDZhwKskpQbih2qx5Ua"
            ],
            "chainInfo": true
        }
    ],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;
    
    println!("Result: {}", response["result"]);
    Ok(())
}

Response

json{
    "jsonrpc": "2.0",
    "result": {
        "utxos": [
            {
                "address": "t1KfwsnwJeNRVjQGBDZhwKskpQbih2qx5Ua",
                "txid": "65951708c3d0087631c663179faf2b84e11d41b95fd56eae9dc4810e565415ee",
                "outputIndex": 1,
                "script": "76a91413bbd8bc8df03a5a9cda88103f583aa8bc043e2488ac",
                "satoshis": 317223382,
                "height": 3470680
            },
            {
                "address": "t1KfwsnwJeNRVjQGBDZhwKskpQbih2qx5Ua",
                "txid": "7c305b591fa0ffd3d3a4f2a27024d94d888c708a5a02f8006d378459c7ed706a",
                "outputIndex": 0,
                "script": "76a91413bbd8bc8df03a5a9cda88103f583aa8bc043e2488ac",
                "satoshis": 569684617,
                "height": 3470680
            }
        ],
        "hash": "000000000044b7b0276f3baa73a690467eaff42379eaeeb197a983c6f1408ce1",
        "height": 3487829
    },
    "id": "getblock.io"
}

Response Parameters

ParameterTypeDescription
utxosarray of objectList of unspent outputs (present when chainInfo=true)
utxos[].addressstringAddress holding this UTXO
utxos[].txidstringTransaction ID containing the UTXO
utxos[].outputIndexintegerOutput index within the transaction
utxos[].scriptstringHex-encoded scriptPubKey
utxos[].satoshisintegerUTXO value in zatoshi
utxos[].heightintegerBlock height at which the UTXO was created
hashstringChain tip hash at query time (chainInfo=true only)
heightintegerChain tip height at query time (chainInfo=true only)

Use Cases

  • Wallet Coin Selection: Enumerate UTXOs for coin-selection algorithms when constructing new transactions
  • Transparent Balance Verification: Independently sum UTXOs to verify getaddressbalance results
  • Consistent Snapshot Reads: Use chainInfo=true to get UTXOs alongside the tip they were read at
  • Custody Reconciliation: Enumerate all UTXOs across a family of custody addresses for accounting

Error Handling

Error CodeMessageDescription
-8Invalid addressOne or more addresses are malformed
-32602Invalid paramsRequest structure is malformed
-32603Internal errorAddress indexing may be disabled