get_output_histogram -Monero

Example code for the get_output_histogram JSON-RPC method. Complete guide on how to use get_output_histogram JSON-RPC in GetBlock Web3 documentation.

This method returns a histogram of RingCT outputs by amount. Wallets use this data to construct ring signatures with appropriate decoys.

Parameters

Parameter
Type
Required
Description

amounts

array of unsigned int

No

Specific amounts to bucket. Defaults to all

min_count

unsigned int

No

Minimum count per bucket

max_count

unsigned int

No

Maximum count per bucket

unlocked

boolean

No

If true, only count unlocked outputs

recent_cutoff

unsigned int

No

If non-zero, also report buckets with outputs since this Unix timestamp

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "get_output_histogram",
    "params": {
        "amounts": [
            20000000000
        ],
        "min_count": 0,
        "max_count": 0,
        "unlocked": true,
        "recent_cutoff": 0
    },
    "id": "getblock.io"
}'

Response Example

Response Parameters

Field
Type
Description

result.histogram

array

Array of histogram buckets

result.histogram[].amount

unsigned int

Output amount in atomic units

result.histogram[].total_instances

unsigned int

Total outputs of this amount on chain

result.histogram[].unlocked_instances

unsigned int

Of the above, how many are unlocked and spendable

result.histogram[].recent_instances

unsigned int

Recent outputs (if recent_cutoff was supplied)

Use Cases

  • Wallet decoy selection for ring signatures

  • Anonymity-set research and analytics

  • Auditing chain composition over time

Error Handling

Status Code
Error Message
Cause

404

Not Found

Missing or invalid <ACCESS-TOKEN>

-32602

Invalid params

Request parameters are missing or malformed

429

Too Many Requests

Rate limit exceeded for your plan

SDK Integration

Last updated

Was this helpful?