For the complete documentation index, see llms.txt. This page is also available as Markdown.

getaddressutxos - Zcash

Example code for the getaddressutxos JSON-RPC method. Сomplete guide on how to use the getaddressutxos JSON-RPC method in GetBlock.io Web3 documentation.

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

Parameter
Type
Required
Description

addresses_or_object

object

Yes

Request object (see below)

Request Object

Field
Type
Required
Description

addresses

array of string

Yes

Transparent addresses to query

chainInfo

boolean

No

If true, wrap the UTXO list in a chain-info envelope. Default false

Request

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "getaddressutxos",
    "params": [
        {
            "addresses": [
                "t1c74RiTicVSKthLmn2c4WFLJdLDs5sQ4X6"
            ],
            "chainInfo": true
        }
    ],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');

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

console.log(response.data.result);

Response

Response Parameters

Parameter
Type
Description

utxos

array of object

List of unspent outputs (present when chainInfo=true)

utxos[].address

string

Address holding this UTXO

utxos[].txid

string

Transaction ID containing the UTXO

utxos[].outputIndex

integer

Output index within the transaction

utxos[].script

string

Hex-encoded scriptPubKey

utxos[].satoshis

integer

UTXO value in zatoshi

utxos[].height

integer

Block height at which the UTXO was created

hash

string

Chain tip hash at query time (chainInfo=true only)

height

integer

Chain 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 Code
Message
Description

-8

Invalid address

One or more addresses are malformed

-32602

Invalid params

Request structure is malformed

-32603

Internal error

Address indexing may be disabled

Was this helpful?