Skip to content

feat(kos): domain-separate instances with a per-instance salt - #446

Open
AdamDawidKrol wants to merge 1 commit into
ethereum:devfrom
AdamDawidKrol:adam/kos-instance-domain-separation
Open

feat(kos): domain-separate instances with a per-instance salt#446
AdamDawidKrol wants to merge 1 commit into
ethereum:devfrom
AdamDawidKrol:adam/kos-instance-domain-separation

Conversation

@AdamDawidKrol

@AdamDawidKrol AdamDawidKrol commented Jul 24, 2026

Copy link
Copy Markdown

Adds an instance_id to kos::Sender/Receiver, mixed into each base-OT-derived setup PRG seed via a tweakable correlation-robust hash: Prg::from_seed(FIXED_KEY_AES.tccr(instance_id, seed)).

KOS's security is analysed for a single extension instance per delta. When several instances share one global delta — as in tlsnotary/tlsn#1173, where each RCOT consumer gets its own instance — they fall outside that single-instance assumption, and the implementation does no per-instance domain separation.

API

Breaking: Sender::new/Receiver::new gain an instance_id: Block. Paired sender and receiver must use the same id; distinct instances reusing one delta must use distinct ids. Single-instance callers can pass Block::ZERO.

Add an `instance_id` to `kos::Sender`/`Receiver`, mixed into each
base-OT-derived setup PRG seed via a tweakable correlation-robust hash
(`FIXED_KEY_AES.tccr(instance_id, seed)`). KOS instances that share one global
`delta` and the same base OT then derive independent extension transcripts, so
per-instance leakage can no longer be composed to sample or recover `delta`.

The mix is non-invertible in `seed`: a linear XOR mix would let a malicious
receiver, who controls the base-OT seeds, pre-compensate them to cancel the
salt and collapse two instances onto one PRG stream.

API-breaking: `Sender::new`/`Receiver::new` gain an `instance_id: Block`.
Paired sender and receiver must use the same id; distinct instances reusing
one `delta` must use distinct ids.
AdamDawidKrol added a commit to AdamDawidKrol/tlsn-rcot-fix that referenced this pull request Jul 24, 2026
Addresses the review on this PR: each RCOT consumer gets its own KOS instance
but they all share one global `delta`. Give each logical consumer a distinct
`instance_id` (matched across prover and verifier: sender id N ↔ receiver id N;
proxy uses a single fixed id) so the same-`delta` instances are
domain-separated.

Depends on the KOS `instance_id` change (ethereum/mpz#446). Until that
lands in a release, the `[patch]` block temporarily points mpz at an
alpha.6-compatible build of the same change.
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.

1 participant