Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Privacy testing

Privacy is tested at the scenario-framework level: the guarantee under test is that the scenario layer never exposes confidential values on its own public surfaces — observations, logs, serialized results, reports, or failure diagnostics. Nothing here tests the cryptography of the underlying Confidential Token implementation; it tests the surfaces this repository controls.

Threat model

The leaks this suite defends against are accidental, not cryptographic:

  • a working pipeline that serializes its inputs into a report;
  • an error path that echoes the rejected payload back in its diagnostic;
  • a proof step that copies witness material into public inputs;
  • a log line that prints an operation or observation with {:?}.

Failure paths are treated as more dangerous than success paths, because error handling is where payloads get echoed.

Layered enforcement

No single mechanism carries the guarantee; each layer independently catches a different failure:

  1. Type-level classification (scenario-core::observation) — every observation carries a Visibility. Non-public values serialize as [REDACTED], and Debug never renders them. A leak would require deliberately authoring a public observation with a private value.
  2. Definition-time guard (scenario-core::scenario) — a GenerateProof step whose public inputs name a confidential field (amount, witness, secret, nonce, opening, randomness, confidential) fails to build. Confidential values never belong in public inputs.
  3. Runner expectationsExpectationKind::NotDisclosed pins specific keys (e.g. op.op-transfer.amount) that must never become observations.
  4. Privacy invariant (invariants, key privacy) — scans every public observation key for confidential markers; a public observation whose key names a confidential concept would leak structure even with a redacted value.
  5. Report hygiene (pack tests) — whole ScenarioOutcomes are serialized to JSON and the confidential literals are asserted absent on both success and failure paths.

Scenarios

The privacy pack (CT-PRIV-001..004) exercises both paths:

IdPathWhat it pins
CT-PRIV-001successa confidential transfer completes while the 30-unit amount and witness material never become public observations
CT-PRIV-002failurea rejected transfer discloses only its classification code, never the attempted 9000-unit amount
CT-PRIV-003proofthe proof statement binds only public protocol values; generation and verification observations never name amount/witness
CT-PRIV-004failurea tampered proof fails verification without leaking witness material

Run them with:

cargo run -p cli --bin crucible-scenarios -- run --category privacy
cargo run -p cli --bin crucible-scenarios -- report

What is and is not guaranteed

  • Guaranteed: no confidential amount or witness value enters an observation, a serialized outcome, or a failure diagnostic of this framework; no proof-generation step can declare confidential public inputs; fixtures contain no secret-carrying fields.
  • Not guaranteed: cryptographic privacy of the underlying protocol — that belongs to the Confidential Token implementation and the real prover. Re-validate against the real crucible-simulator/crucible-prover before making external privacy claims.