Skip to content

Add required top-level guards to sub-transaction build-raw - #1460

Merged
Jimbo4350 merged 2 commits into
jordan/basic-sub-tx-integrationfrom
jordan/sub-tx-top-level-guards
Oct 14, 2026
Merged

Jimbo4350 merged 2 commits into
jordan/basic-sub-tx-integrationfrom
jordan/sub-tx-top-level-guards

Conversation

@Jimbo4350

@Jimbo4350 Jimbo4350 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Sub-transactions can specify key or script credentials required as guards in the enclosing top-level transaction through dijkstra sub-transaction build-raw.

Key requirements accept repeatable --top-level-guard-key-hash, --top-level-guard-verification-key, or --top-level-guard-verification-key-file options. Key hashes support any Shelley signing-key role; inline verification keys and key files use payment keys. Key requirements carry no datum.

Script requirements use --top-level-guard-script-hash or --top-level-guard-script-file, with optional data supplied through --top-level-guard-datum-value, --top-level-guard-datum-file, or --top-level-guard-datum-cbor-file. Script files are hashed and checked locally: Plutus scripts must be V4 and require a datum, while native scripts must not have one. Script hashes leave language validation to the ledger.

Entries are stored in requiredTopLevelGuards; these options add no local guard witnesses. Repeated credentials are rejected across all input forms. A key hash and script hash with identical bytes remain distinct credentials.

Validation covers key forms, mixed key/script requirements, datum rejection, duplicate aliases, local witness preservation, and canonical output through signing and embedding. All 38 sub-transaction tests and 620 help/pipeline golden tests pass.

@Jimbo4350
Jimbo4350 force-pushed the jordan/sub-tx-top-level-guards branch 2 times, most recently from 46be884 to c38f523 Compare October 13, 2026 14:14
@Jimbo4350
Jimbo4350 marked this pull request as ready for review October 13, 2026 14:58
@Jimbo4350
Jimbo4350 force-pushed the jordan/sub-tx-top-level-guards branch from c38f523 to 24d81f2 Compare October 13, 2026 15:02
@Jimbo4350
Jimbo4350 force-pushed the jordan/sub-tx-top-level-guards branch 3 times, most recently from 14dfa5c to cbfe7fc Compare October 13, 2026 18:18
@Jimbo4350
Jimbo4350 force-pushed the jordan/basic-sub-tx-integration branch 2 times, most recently from 5bc976d to e0ac3c4 Compare October 13, 2026 20:43
when (isJust mDatum) $ throwCliError $ TxCmdTopLevelGuardUnexpectedDatum path
PlutusScript version _ -> do
let language = toAlonzoLanguage (AnyPlutusScriptVersion version)
unless (language == L.PlutusV4) $

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be language >= L.PlutusV4?
There is no Plutus V5 yet, so nothing changes today, but the intent is "V4 or later", and == would reject a guard script written for any later version.
The error message would then need to say "V4 or later" as well.

@Jimbo4350
Jimbo4350 force-pushed the jordan/sub-tx-top-level-guards branch 2 times, most recently from c0905dc to 522c4ee Compare October 14, 2026 13:58
@Jimbo4350
Jimbo4350 force-pushed the jordan/sub-tx-top-level-guards branch 2 times, most recently from 7ec485d to 5ab9e75 Compare October 14, 2026 14:43
@Jimbo4350
Jimbo4350 force-pushed the jordan/sub-tx-top-level-guards branch from 5ab9e75 to 4682a97 Compare October 14, 2026 14:47
@Jimbo4350
Jimbo4350 merged commit 55cff1e into jordan/basic-sub-tx-integration Oct 14, 2026
20 of 22 checks passed
@Jimbo4350
Jimbo4350 deleted the jordan/sub-tx-top-level-guards branch October 14, 2026 14:55
Jimbo4350 added a commit that referenced this pull request Oct 14, 2026
…ards

Add required top-level guards to sub-transaction build-raw
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