Skip to content

Add Plutus V4 reference script witness flags - #1452

Draft
carbolymer wants to merge 1 commit into
masterfrom
mgalazyn/feature/plutus-v4-scripts
Draft

carbolymer wants to merge 1 commit into
masterfrom
mgalazyn/feature/plutus-v4-scripts

Conversation

@carbolymer

@carbolymer carbolymer commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Context

The issue asks for cardano-cli to support Plutus V4 scripts:

  • Ensure Plutus V4 scripts can be deserialised by cardano-cli #1448
    Reading a PlutusScriptV4 text envelope through the --*-script-file options already works, because those readers have been version agnostic since cardano-api 11.7.0.0.
    The missing piece was a --*-plutus-script-v4 flag for each reference script witness kind, matching the existing v2 and v3 flags.
    This PR adds that flag for the spending, minting, withdrawal, certificate, vote and proposal reference script witnesses.

Plutus V4 reference script witnesses have a wire format in Dijkstra transactions, so they work end to end.
A V4 script supplied directly as a witness cannot be exercised yet, because Dijkstra's transaction witness set has no field for V4 scripts and the ledger silently drops such scripts instead of rejecting them:

Addresses #1448.
The direct witness part of the issue waits for the ledger change.

How to trust this PR

Run cardano-cli dijkstra transaction build-raw with any of the new --*-plutus-script-v4 flags, for example --spending-plutus-script-v4 alongside --spending-tx-in-reference, and inspect the result with cardano-cli debug transaction view.
The V4 test fixture, v4-always-succeeds.plutus, is the V3 always-succeeds script relabelled as V4.
That is the same approach cardano-api's own generators use, because plutus-ledger-api 1.65 has no real V4 script to draw on.

Two golden tests cover the change.
One exercises all six new flags through dijkstra transaction build-raw and debug transaction view.
The other exercises hash script on a V4 envelope.
The help goldens are regenerated for the new flags.

Pending before review: the golden output files and the regenerated help goldens are not pushed yet, and the build-raw test still carries a placeholder for the V4 script hash.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff
  • Changelog fragment added in .changes/

@carbolymer carbolymer self-assigned this Sep 25, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/feature/plutus-v4-scripts branch from d8466db to 8ef9c2d Compare September 25, 2026 09:28
@carbolymer carbolymer changed the title Add Plutus V4 support Add Plutus V4 reference script witness flags Sep 25, 2026
@carbolymer
carbolymer force-pushed the mgalazyn/feature/plutus-v4-scripts branch from 8ef9c2d to d193e61 Compare September 25, 2026 13:33
@carbolymer
carbolymer force-pushed the mgalazyn/feature/plutus-v4-scripts branch from d193e61 to af5f579 Compare October 2, 2026 11:19

This branch has not been deployed

No deployments
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