feat(kernel): expose tx script root via public kernel procedure#2816
Open
partylikeits1983 wants to merge 6 commits intonextfrom
Open
feat(kernel): expose tx script root via public kernel procedure#2816partylikeits1983 wants to merge 6 commits intonextfrom
partylikeits1983 wants to merge 6 commits intonextfrom
Conversation
Adds tx_get_script_root to the transaction kernel API so that MASM auth code can read the executed tx script root (zero word if no script ran). Required by the upcoming NetworkAccount auth component (#2814). - lib/memory.masm: new get_tx_script_root word getter - lib/tx.masm: re-export as tx::get_script_root - api.masm: new tx_get_script_root public kernel procedure - kernel_proc_offsets.masm: new TX_GET_SCRIPT_ROOT_OFFSET=51 - protocol/tx.masm: new user-facing tx::get_script_root wrapper - tests: returns expected root when script is set, zero word otherwise Part of #2813, related to #2797.
This was referenced Apr 22, 2026
bobbinth
approved these changes
Apr 23, 2026
Contributor
bobbinth
left a comment
There was a problem hiding this comment.
Looks good! Thank you! I reviewed primarily non-test code and left a coupe of small comments inline.
…` in identifiers Keep `tx_script` in the names to match the well-defined concept, per review on #2816. Renames: - kernel lib `tx::get_script_root` -> `tx::get_tx_script_root` - kernel api proc `tx_get_script_root` -> `tx_get_tx_script_root` - offset const `TX_GET_SCRIPT_ROOT_OFFSET` -> `TX_GET_TX_SCRIPT_ROOT_OFFSET` - user-facing wrapper `tx::get_script_root` -> `tx::get_tx_script_root` Updates call sites and the CHANGELOG entry accordingly.
PhilippGackstatter
approved these changes
Apr 24, 2026
Comment on lines
+324
to
+331
| #! Returns the transaction script root, or the zero word if no transaction script was executed. | ||
| #! | ||
| #! Inputs: [] | ||
| #! Outputs: [TX_SCRIPT_ROOT] | ||
| #! | ||
| #! Where: | ||
| #! - TX_SCRIPT_ROOT is the root of the transaction script executed in this transaction, or the zero | ||
| #! word if no transaction script was executed. |
Contributor
There was a problem hiding this comment.
Nit: We usually call it "empty word" rather than "zero word".
| Ok(()) | ||
| } | ||
|
|
||
| /// Tests that `tx::get_tx_script_root` returns the zero word when no transaction script is |
Contributor
There was a problem hiding this comment.
Suggested change
| /// Tests that `tx::get_tx_script_root` returns the zero word when no transaction script is | |
| /// Tests that `tx::get_tx_script_root` returns the empty word when no transaction script is |
| - [BREAKING] Added cycle counts to notes returned by `NoteConsumptionInfo` and removed public fields from related types ([#2772](https://github.com/0xMiden/miden-base/issues/2772)). | ||
| - [BREAKING] Removed unused `payback_attachment` from `SwapNoteStorage` and `attachment` from `MintNoteStorage` ([#2789](https://github.com/0xMiden/protocol/pull/2789)). | ||
| - Automatically enable `concurrent` feature in `miden-tx` for `std` context ([#2791](https://github.com/0xMiden/protocol/pull/2791)). | ||
| - Added `tx::get_tx_script_root` kernel procedure returning the root of the executed transaction script (zero word if no script was executed) ([#2816](https://github.com/0xMiden/protocol/pull/2816)). |
Contributor
There was a problem hiding this comment.
Suggested change
| - Added `tx::get_tx_script_root` kernel procedure returning the root of the executed transaction script (zero word if no script was executed) ([#2816](https://github.com/0xMiden/protocol/pull/2816)). | |
| - Added `tx::get_tx_script_root` kernel procedure returning the root of the executed transaction script (empty word if no script was executed) ([#2816](https://github.com/0xMiden/protocol/pull/2816)). |
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.
Summary
tx_get_script_rootto the transaction kernel API so MASM auth code can read the executed tx script root (zero word if no script ran).NetworkAccountauth component (standards: addNetworkAccountauth component with input-note whitelist #2814), which rejects transactions that executed a tx script as part of theNoAuthon the bridge account lets anyone emit bridge-authored MINT notes #2797 fix.tx::get_script_rootwrapper.Changes
lib/memory.masm: newget_tx_script_rootword getter (mirrorsget_tx_script_args).lib/tx.masm: re-export astx::get_script_root.api.masm: newtx_get_script_rootpublic kernel procedure.kernel_proc_offsets.masm: newTX_GET_SCRIPT_ROOT_OFFSET=51.protocol/tx.masm: new user-facingtx::get_script_rootwrapper.miden-testing: script set returns expected root, no script returns zero word.Closes #2813. Part of the #2797 fix chain (this unblocks #2814, which unblocks #2815).