Shielded transactions support in block proposer#6
Merged
sam0x17 merged 14 commits intopolkadot-stable2506-2-otf-patchesfrom Feb 18, 2026
Merged
Conversation
ales-otf
approved these changes
Feb 17, 2026
shamil-gadelshin
approved these changes
Feb 17, 2026
9783760
into
polkadot-stable2506-2-otf-patches
133 of 224 checks passed
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
Companion PR to opentensor/subtensor#2415
Adds MEV shield support to Substrate: shielded (encrypted) transaction handling in the block
proposer, along with the shared primitive and client crates (
sp-shield,sc-shield) that weremoved here from subtensor to avoid a circular dependency between the two repos.
Users encrypt their extrinsics using ML-KEM-768 + XChaCha20-Poly1305 against the next block
author's public key. At block building time, the proposer decrypts each shielded transaction and
pushes both the wrapper and the inner extrinsic into the block, keeping transaction contents
hidden from the mempool.
Changes
stp-shield(new subtensor primitives crate)Shared types used by both the runtime and the node side:
ShieldedTransactionstruct and wire-format parsingShieldKeystoretrait andShieldKeystoreExtruntime extensionShieldApiruntime API definition (try_decode_shielded_tx,try_unshield_tx)ShieldPublicKeytype, logging targetstc-shield(new subtensor client crate)Node-side shield logic:
MemoryShieldKeystore— in-memory ML-KEM keystore implementationShieldInherentDataProvider— provides the next public key as an inherentKeyRotationService— generates and rotates ML-KEM keypairs per slotsc-basic-authorship(block proposer)ProposerFactory/Proposeraccept aShieldKeystorePtrfor decryptionShieldApi, decrypted, and their inner extrinsicis included alongside the wrapper in the produced block
SUBSTRATE_SKIP_SHIELDED_TXS=1— skipped transactions stay in thepool for gossip to other authors
report_exhausted_resourceshelper shared between normal and unshielded tx pathssp-runtime(minor)fn call()to theApplyabletrait (needed to inspect the call after signature check)pallet-aura(minor)current_slot_from_digestspublic for shield key rotationsubstrate-test-runtimeShieldApiusing storage keys (Wasm-compatible) for proposer testsTests