Skip to content

Add Dijkstra sub-transaction witness and assemble commands - #1485

Merged
Jimbo4350 merged 5 commits into
masterfrom
feature/dijkstra-sub-transaction-witness-assemble
Oct 28, 2026
Merged

Jimbo4350 merged 5 commits into
masterfrom
feature/dijkstra-sub-transaction-witness-assemble

Conversation

@Jimbo4350

@Jimbo4350 Jimbo4350 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Add Dijkstra sub-transaction witness and sub-transaction assemble for separate key witnessing and assembly, preserving the original body bytes and script payloads.

Tests cover equivalence with direct signing, canonical/noncanonical bodies, empty/multiple/duplicate witnesses, and invalid inputs. Byron keys/bootstrap witnesses remain unsupported by these CLI commands.

Includes updated help goldens and a changelog fragment.

Jimbo4350 added a commit that referenced this pull request Oct 23, 2026
Jimbo4350 added a commit that referenced this pull request Oct 27, 2026
@Jimbo4350
Jimbo4350 force-pushed the feature/dijkstra-sub-transaction-witness-assemble branch from dbe9134 to 0a79720 Compare October 27, 2026 19:40
Jimbo4350 added a commit that referenced this pull request Oct 27, 2026
@Jimbo4350
Jimbo4350 force-pushed the feature/dijkstra-sub-transaction-witness-assemble branch from 0a79720 to 49e101c Compare October 27, 2026 19:57
Jimbo4350 added a commit that referenced this pull request Oct 27, 2026
@Jimbo4350
Jimbo4350 force-pushed the feature/dijkstra-sub-transaction-witness-assemble branch 3 times, most recently from 7be9938 to 97af027 Compare October 28, 2026 13:05
@Jimbo4350 Jimbo4350 mentioned this pull request Oct 28, 2026
1 task
@Jimbo4350
Jimbo4350 force-pushed the feature/dijkstra-sub-transaction-witness-assemble branch from 97af027 to b79da31 Compare October 28, 2026 13:56
@Jimbo4350
Jimbo4350 marked this pull request as ready for review October 28, 2026 14:07
Copilot AI balanced review requested due to automatic review settings October 28, 2026 14:07
@Jimbo4350
Jimbo4350 force-pushed the feature/dijkstra-sub-transaction-witness-assemble branch from b79da31 to da46d85 Compare October 28, 2026 14:08

Copilot AI left a comment

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.

🟢 Approval recommended

No active review issues were identified for the detached sub-transaction witnessing and assembly changes.

No open issues 🎉

What changed in this PR

Adds detached key witnessing and assembly for Dijkstra sub-transactions, allowing signing keys to be used separately while preserving original body bytes and script payloads. Byron keys and bootstrap witnesses remain unsupported.

Changes:

  • Adds sub-transaction witness and sub-transaction assemble command definitions, parsers, and execution.
  • Adds tests for direct-signing equivalence, byte preservation, witness combinations, and invalid inputs.
  • Updates CLI help goldens and adds a feature changelog entry.
File Description
cardano-cli/​test/​cardano-cli-test/​Test/​Cli/​Transaction/​SubTransaction.hs Tests detached signing, payload preservation, and input rejection.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​help/​dijkstra_sub-transaction.cli Lists the new subcommands.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​help/​dijkstra_sub-transaction_witness.cli Records witness command help.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​help/​dijkstra_sub-transaction_assemble.cli Records assemble command help.
cardano-cli/​test/​cardano-cli-golden/​files/​golden/​help.cli Updates aggregate CLI help.
cardano-cli/​src/​Cardano/​CLI/​EraBased/​Transaction/​SubTransaction/​Run.hs Implements witness creation and assembly.
cardano-cli/​src/​Cardano/​CLI/​EraBased/​Transaction/​SubTransaction/​Option.hs Parses the new commands and their arguments.
cardano-cli/​src/​Cardano/​CLI/​EraBased/​Transaction/​SubTransaction/​Command.hs Defines command types and rendering.
.changes/​20261023_sub_transaction_witness_assemble.yml Documents the feature in the changelog.

Review effort: Balanced

@Jimbo4350
Jimbo4350 requested a review from a team as a code owner October 28, 2026 14:45

@palas palas left a comment

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.

Looks solid to me 👍

Comment on lines 1362 to 1528
subTransactionArgs :: [String]
subTransactionArgs = ["dijkstra", "sub-transaction", "build-raw", "--tx-in", txIn]

subTransactionFileArgs :: String -> FilePath -> [String]
subTransactionFileArgs command input = ["dijkstra", "sub-transaction", command, "--sub-tx-file", input]

transactionArgs :: String -> [String]
transactionArgs era = [era, "transaction", "build-raw", "--tx-in", txIn, "--fee", "200000"]

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.

I think these are a bit of a weird way of abstracting this. It may have been better to have this inlined. Also the naming. subTransactionArgs should maybe be called "buildRawSubTx", or something like that? But that is from a previous PR.

@palas

palas commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@Jimbo4350, one thing Claude suggested:

sub-transaction assemble accepts a witness that was made for a different body. Every key witness file has the same type, TxWitness DijkstraEra, whether it's for this sub-transaction, another sub-transaction, or the top-level transaction. I ran all three mix-ups: each gives exit 0 and writes a bad signature. The ledger only rejects it at submit time, with SubInvalidWitnessesUTXOW.

I didn't think to check that, but it is a good idea, it would be most user friendly to do it

@Jimbo4350
Jimbo4350 enabled auto-merge October 28, 2026 18:13
@Jimbo4350
Jimbo4350 added this pull request to the merge queue Oct 28, 2026
Merged via the queue into master with commit 610b6c4 Oct 28, 2026
30 of 32 checks passed
@Jimbo4350
Jimbo4350 deleted the feature/dijkstra-sub-transaction-witness-assemble branch October 28, 2026 21:16
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.

3 participants