is_key_image_spent - Monero

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

This non-JSON-RPC endpoint checks whether any key images have been spent. Key images are unique identifiers used to prevent double-spends in Monero's ring-signature scheme.

Parameters

Parameter
Type
Required
Description

key_images

array of string

Yes

Key images (hex) to check

Request Example

curl --location --request POST 'https://go.getblock.io/<ACCESS-TOKEN>/is_key_image_spent' \
--header 'Content-Type: application/json' \
--data-raw '{
    "key_images": [
        "8d1bd8181bf7d857bdb281e0153d84cd55a3fcaa57c3e570f4a49f935850b5e3"
    ]
}'

Response Example

{
    "spent_status": [
        1
    ],
    "status": "OK",
    "untrusted": false
}

Response Parameters

Field
Type
Description

spent_status

array of unsigned int

Per-key-image: 0 = unspent, 1 = spent on-chain, 2 = seen in mempool

status

string

OK on success

Use Cases

  • Wallet reconciliation after restoring from seed

  • Verifying outputs are still spendable

  • Auditing key-image uniqueness in research contexts

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?