Skip to content

feat: add /scripts/{script_hash}/utxos endpoint#460

Open
slowbackspace wants to merge 1 commit into
masterfrom
feat/scripts-script-hash-utxos
Open

feat: add /scripts/{script_hash}/utxos endpoint#460
slowbackspace wants to merge 1 commit into
masterfrom
feat/scripts-script-hash-utxos

Conversation

@slowbackspace

@slowbackspace slowbackspace commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new paged endpoint GET /scripts/{script_hash}/utxos that lists the UTXOs holding a given script as a reference script (CIP-33).

Motivation

From a support ticket: to use a script as a reference input (CIP-31) you need the tx_hash#output_index of a UTXO carrying it. Today the only way via Blockfrost is to know the holding address and enumerate its UTXOs — awkward, since a script can be deployed at many addresses (or unknown ones). This endpoint resolves a script hash directly to the UTXOs that carry it.

A script can legitimately be held by multiple unspent UTXOs (observed up to 24 on mainnet), so the endpoint is paginated.

Response shape

Mirrors /addresses/{address}/utxos so clients can reuse existing UTXO parsing, but omits the deprecated tx_index field — consistent with the newer tx_content_utxo schema, which only exposes output_index.

Changes

  • src/schemas/scripts/script_utxos.yaml — new response schema
  • src/paths/api/scripts/{script_hash}/utxos.yaml — new path
  • registered in src/definitions.yaml
  • version bump 0.1.89 → 0.1.90
  • regenerated bundles, types, json-schema, snapshot

Notes

  • The matching backend implementation (blockfrost-backend-ryo) depends on this version once published.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openapi Ready Ready Preview, Comment Jun 17, 2026 7:19pm

Request Review

Adds an endpoint listing the UTXOs that hold a given script as a
reference script (CIP-33). These outputs can be used as reference
inputs (CIP-31) to execute the script without including its bytes.
A script may be held by multiple UTXOs, potentially at different
addresses, so the endpoint is paginated.

Response shape mirrors /addresses/{address}/utxos, omitting the
deprecated tx_index field (consistent with tx_content_utxo).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant