Skip to content

Enforce encrypted transaction inputs on submission - #2389

Merged
huitseeker merged 8 commits into
nextfrom
corrected-pr2381-encrypted-submission
Jul 29, 2026
Merged

Enforce encrypted transaction inputs on submission#2389
huitseeker merged 8 commits into
nextfrom
corrected-pr2381-encrypted-submission

Conversation

@huitseeker

Copy link
Copy Markdown
Contributor

Summary

Clients must now encrypt private transaction inputs before submission. RPC nodes pass the ciphertext to the validator unchanged. The validator decrypts it before the current checks and rejects missing, plain, or invalid inputs.

Each submitter in this repository verifies the validator's encryption key against a trusted signing key. The NTX builder fetches a new key and retries once when the validator rejects an old key. The public RPC does not cache encryption keys.

This supersedes (but builds on) #2381. It completes encrypted submission for Phase 1, modulo key rotation (part of #2373, which should come later). Validation of the encryption key is against a fixed attestation for now.

Existing NTX builder data directories must be bootstrapped again. The database now stores the trusted validator keys from genesis.

Changelog

[[entry]]
scope = "protocol"
impact = "breaking"
description = "Transaction submissions now carry sealed private inputs instead of plaintext inputs."

[[entry]]
scope = "rpc"
impact = "breaking"
description = "Transaction submission rejects missing or unsealed private inputs."

[[entry]]
scope = "rpc"
impact = "fixed"
description = "Transaction submission no longer records private request bodies in logs or traces."

[[entry]]
scope = "rpc"
impact = "changed"
description = "GetTransactionEncryptionKey responses are forwarded without a relay cache."

[[entry]]
scope = "general"
impact = "changed"
description = "Node submitters verify encryption keys against trusted validator signing keys."

[[entry]]
scope = "validator"
impact = "changed"
description = "The validator decrypts sealed inputs before validation and rejects plaintext inputs."

[[entry]]
scope = "ntx-builder"
impact = "migration"
description = "NTX builder data must be bootstrapped again to store trusted validator keys from genesis."

[[entry]]
scope = "network-monitor"
impact = "changed"
description = "Network transaction checks require a trusted validator signing public key."

Comment thread bin/benchmark/src/main.rs Outdated
Comment thread bin/benchmark/src/main.rs Outdated
Comment thread bin/network-monitor/src/deploy/mod.rs Outdated
Comment thread bin/ntx-builder/src/clients/rpc.rs Outdated
Comment thread bin/ntx-builder/src/clients/rpc.rs Outdated
Comment thread crates/proto/src/clients/mod.rs Outdated
Comment thread crates/proto/src/clients/mod.rs Outdated
Comment thread crates/proto/src/domain/encryption.rs Outdated
Comment thread bin/ntx-builder/src/clients/rpc.rs Outdated
Comment on lines +155 to +161
let mut cached = self.sealer.write().await;
// Another task may have populated the cache while this one waited for the write lock.
if let Some(sealer) = cached.clone() {
return Ok(sealer);
}

let key = self.inner.clone().get_transaction_encryption_key(()).await?.into_inner();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We are acquirying a lock here, then going through an rpc call before releasing it. Can we assume it will never block?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch. The RPC call now runs without the lock. The cache is checked again before insertion.

Comment thread bin/network-monitor/src/deploy/mod.rs Outdated
Comment thread proto/proto/types/transaction.proto
Comment on lines +27 to +29
Network transaction checks also require `MIDEN_MONITOR_VALIDATOR_SIGNING_PUBLIC_KEY`. It must contain the hex-encoded
validator key that signs transaction encryption key attestations. The monitor will not submit a transaction unless it
can verify the advertised encryption key.

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.

Question (relevant for some other places too): is this a temporary simplification? The monitor should be able to get validator's signing keys from the blockchains (i.e., the block headers) - right?

@huitseeker huitseeker Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. MIDEN_MONITOR_VALIDATOR_SIGNING_PUBLIC_KEY is temporary. #2389 uses it to trust encryption-key attestations. The monitor should instead read validator signing keys from authenticated block headers.

#2390 and #2393 keep the fixed setting. After they land, #2373, including #2382, will be rebased on top. That integration should pass chain-derived validator keys to #2373’s schedule verifier and remove the environment variable. The same change should remove fixed validator keys from the other node submitters. Each submitter will then follow validator changes through trusted chain state instead of local config.

/cc @juan518munoz

@huitseeker
huitseeker force-pushed the corrected-pr2381-encrypted-submission branch from 74e4f32 to a015c75 Compare July 29, 2026 12:07
Comment thread bin/ntx-builder/src/clients/rpc.rs
Comment thread crates/proto/src/domain/encryption.rs
Comment thread proto/proto/types/transaction.proto

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I have some nits but I don't think they're worth it since a lot of this will change over the stacks

@huitseeker
huitseeker force-pushed the corrected-pr2381-encrypted-submission branch from a015c75 to c6de87e Compare July 29, 2026 16:58
@huitseeker
huitseeker merged commit c1a0819 into next Jul 29, 2026
26 checks passed
@huitseeker
huitseeker deleted the corrected-pr2381-encrypted-submission branch July 29, 2026 18:29
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.

5 participants