Repository navigation
Expose Plutus and native guard witnesses in experimental transactions - #1381
Merged
Merged
Conversation
This was referenced Oct 16, 2026
Jimbo4350
force-pushed
the
feature/dijkstra-guard-witnesses
branch
4 times, most recently
from
October 19, 2026 20:20
349d099 to
b4c9cf6
Compare
Jimbo4350
force-pushed
the
feature/dijkstra-guard-witnesses
branch
from
October 19, 2026 20:26
b4c9cf6 to
d485ea1
Compare
Jimbo4350
marked this pull request as ready for review
October 19, 2026 20:29
Jimbo4350
requested review from
CarlosLopezDeLara,
carbolymer,
disassembler,
erikd and
palas
as code owners
October 19, 2026 20:29
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The breaking-change fragment needs explicit downstream migration guidance for the changed guard APIs and new constructors.
1 open issue
What changed in this PR
Adds native and Plutus V4 guard witnesses to experimental Dijkstra transactions and sub-transactions.
Changes:
- Introduces validated, insertion-ordered
TxGuardsand public construction helpers. - Integrates guards with witness collection, redeemer indexing, execution budgets, and fees.
- Adds integration tests, RPC handling, and changelog fragments.
| File | Description |
|---|---|
cardano-rpc/test/cardano-rpc-test/Test/Cardano/Rpc/Eval.hs |
Tests guarding-purpose mapping. |
cardano-rpc/src/Cardano/Rpc/Server/Internal/UtxoRpc/Type/TxEval.hs |
Handles guarding indices. |
cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental/Fee.hs |
Tests validation, ordering, budgets, and balancing. |
cardano-api/test/cardano-api-test/Test/Cardano/Api/Experimental.hs |
Adapts sub-transaction tests. |
cardano-api/src/Cardano/Api/Tx/Internal/Body.hs |
Adds guarding indices and conversions. |
cardano-api/src/Cardano/Api/Experimental/Tx/Internal/SubTransaction.hs |
Uses shared guard credential extraction. |
cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Guards.hs |
Defines validated guard collections. |
cardano-api/src/Cardano/Api/Experimental/Tx/Internal/Fee.hs |
Integrates guard budgets and witness estimates. |
cardano-api/src/Cardano/Api/Experimental/Tx/Internal/BodyContent.hs |
Integrates guards into transaction bodies. |
cardano-api/src/Cardano/Api/Experimental/Tx/Internal/AnyWitness.hs |
Adds guarding witness equality. |
cardano-api/src/Cardano/Api/Experimental/Tx.hs |
Exports guard APIs. |
cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/Shim/LegacyScripts.hs |
Supports guarding witness conversion. |
cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/ScriptWitness.hs |
Adds guarding equality instances. |
cardano-api/src/Cardano/Api/Experimental/Plutus/Internal/IndexedPlutusScriptWitness.hs |
Adds insertion-ordered guarding indices. |
cardano-api/src/Cardano/Api/Experimental/AnyScriptWitness.hs |
Extends witness helpers for guards. |
cardano-api/src/Cardano/Api/Experimental.hs |
Re-exports guard APIs. |
cardano-api/cardano-api.cabal |
Registers the internal guards module. |
.changes/20261019_cardano-rpc_guarding_script_index.yml |
Records RPC guarding support. |
.changes/20261016_dijkstra_guard_witnesses.yml |
Records the breaking guard API change. |
Review effort: Balanced
carbolymer
approved these changes
Oct 20, 2026
palas
reviewed
Oct 20, 2026
palas
left a comment
Contributor
There was a problem hiding this comment.
It looks good to me. Here are some things that I thought would improve the readability and the tests
Contributor
|
The problem in the CI is patched in my PR: #1379 |
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
Allow native and Plutus V4 scripts to witness guards in experimental Dijkstra transactions and sub-transactions. Guard credentials and optional witnesses live together in an opaque, insertion-ordered
TxGuardscollection, supplied throughsetTxGuards.mkTxGuardspreserves the caller's order and rejects duplicate credentials, script witnesses for key credentials, and mismatching inline script hashes.GuardWitnessaccepts native scripts or Plutus V4 guarding witnesses, enforcing the Plutus language and purpose in its type. Entries without supplied witnesses remain explicit; reference-script hashes still require the referenced UTxO for validation.Guard witnesses participate in script collection, script integrity hashes, execution-unit evaluation and substitution, and fee estimation. Redeemer indices preserve positions occupied by key, native, and witnessless guards. Legacy extra required signers are appended without duplicating explicit guards. RPC evaluation handles
ScriptWitnessIndexGuardingusing the existing unspecified redeemer-purpose value.The PR contains two commits: first the guard type, smart constructor, and constructor tests; then transaction integration, indexing, fees, RPC handling, and integration tests. The implementation uses TxGuards directly, without an intermediate separate witness-map API. The public API changes are recorded as breaking changes in the Herald fragment.
How to trust this PR
cabal build all --offline -j4passed with GHC 9.12.4, includingcardano-rpcand the native builds of the WASM package components.cabal test cardano-api-test --offline -j4 --test-options='--pattern=Experimental +RTS -N4 -RTS'passed all 71 tests.git diff --checkpassed for the changed files.Checklist
.changes/