Skip to content

Add origin to the Dijkstra native script guard clause - #45

Open
carbolymer wants to merge 2 commits into
masterfrom
mgalazyn/feature/dijkstra-guard-clause-origin
Open

carbolymer wants to merge 2 commits into
masterfrom
mgalazyn/feature/dijkstra-guard-clause-origin

Conversation

@carbolymer

@carbolymer carbolymer commented Nov 27, 2026 •

Copy link
Copy Markdown

Ogmios wrote the guard clause of a Dijkstra native script as a bare credential hash, so a client could not tell a key guard from a script guard. Without that, a client cannot rebuild the exact native script from its JSON. Kupo needs this to index native scripts with guards when Ogmios runs without --include-script-cbor.

The clause now has an origin field, with the same values as the transaction-level guards:

{ "clause": "guard", "from": "<hash>", "origin": "verificationKey" }

The JSON decoder reads origin too. Before, it decoded every guard as a script credential, so a key guard came back as a different script. A missing origin still decodes as a script, for older clients, and an unknown value is an error.

This also updates the schema, the generated TypeScript types and the test vectors, and fixes two name-shadowing warnings in OptionsSpec.

Related:

The local bindings numerator and denominator shadowed the Prelude
functions of the same name.
The guard clause of a native script carried only the credential hash,
so clients could not tell a key guard from a script guard and could
not rebuild the script from its JSON.

The clause now has an origin field (verificationKey or script), as the
transaction-level guards already do. The JSON decoder reads it too: it
used to decode every guard as a script credential. A missing origin
still decodes as a script, for compatibility with older clients, and an
unknown value is an error.

Update the schema, the generated TypeScript types and the test vectors.
@carbolymer carbolymer changed the title Mgalazyn/feature/dijkstra guard clause origin Add origin to the Dijkstra native script guard clause Nov 27, 2026
@carbolymer
carbolymer marked this pull request as ready for review November 27, 2026 09:01
@carbolymer carbolymer self-assigned this Nov 27, 2026
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.

2 participants