Repository navigation
Add Plutus V4 reference script witness flags - #1452
Draft
carbolymer wants to merge 1 commit into
Draft
carbolymer wants to merge 1 commit into
carbolymer wants to merge 1 commit into
Conversation
carbolymer
force-pushed
the
mgalazyn/feature/plutus-v4-scripts
branch
from
September 25, 2026 09:28
d8466db to
8ef9c2d
Compare
This was referenced Sep 25, 2026
carbolymer
force-pushed
the
mgalazyn/feature/plutus-v4-scripts
branch
from
September 25, 2026 13:33
8ef9c2d to
d193e61
Compare
4 tasks done
carbolymer
force-pushed
the
mgalazyn/feature/plutus-v4-scripts
branch
from
October 2, 2026 11:19
d193e61 to
af5f579
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The issue asks for cardano-cli to support Plutus V4 scripts:
Reading a
PlutusScriptV4text envelope through the--*-script-fileoptions already works, because those readers have been version agnostic since cardano-api 11.7.0.0.The missing piece was a
--*-plutus-script-v4flag for each reference script witness kind, matching the existingv2andv3flags.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:
Add a field for
PlutusV4scripts totransaction_witness_setCDDL cardano-ledger#5403For that reason this PR adds no golden test with a direct V4 witness; it would pin a malformed transaction as expected output.
The companion cardano-api PR makes cardano-api fail instead of dropping an unsupported inline script, and accepts V4 in Dijkstra in the legacy era check, which
--tx-out-reference-script-fileneeds before it can carry a V4 script:Add Plutus V4 support in the Dijkstra era cardano-api#1359
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-rawwith any of the new--*-plutus-script-v4flags, for example--spending-plutus-script-v4alongside--spending-tx-in-reference, and inspect the result withcardano-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-rawanddebug transaction view.The other exercises
hash scripton 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-rawtest still carries a placeholder for the V4 script hash.Checklist
.changes/