Skip to content

Fix script integrity#203

Open
PeterBenc wants to merge 3 commits intodevelopfrom
fix-script-integrity-#177
Open

Fix script integrity#203
PeterBenc wants to merge 3 commits intodevelopfrom
fix-script-integrity-#177

Conversation

@PeterBenc
Copy link
Collaborator

@PeterBenc PeterBenc commented Mar 3, 2026

Fixes #177

Relies on changes in hw interop-lib

Summary

  • Add --protocol-params-file and --used-cost-model-languages flags to the transaction transform command, enabling script data hash recomputation for Plutus transactions (required by the updated cardano-hw-interop-lib)

Details

Transactions containing Plutus scripts have a scriptDataHash that depends on the CBOR encoding of the witness set. When transaction transform canonicalizes the CBOR, the hash must be recomputed or it becomes invalid. The interop lib now handles this, but needs cost models from protocol parameters to do so.

For reference-script-only transactions (no inline scripts in the witness set), the Plutus language versions cannot be inferred automatically. The --used-cost-model-languages args allow specifying them explicitly
(e.g. --used-cost-model-languages PlutusV1 --used-cost-model-languages PlutusV2).

Test plan

  • Existing unit tests updated and passing (49 tests)
  • New command parser test: parse transform with --protocol-params-file and --used-cost-model-languages
  • End-to-end verified on preview testnet with real transactions (V1+V2 inline scripts, reference-script-only), links in hw-interop-lib

@PeterBenc PeterBenc self-assigned this Mar 3, 2026
@PeterBenc PeterBenc changed the title Fix script integrity #177 Fix script integrity Mar 3, 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.

BUG: CBOR Transformation Breaks Script Integrity

1 participant