The privacy circuit
The circuit is a RISC Zero guest that replays a private transaction and emits the object the chain publishes. Most privacy claims in this guide are about what that object contains.
Source: lee/privacy_preserving_circuit/src/{main.rs,output.rs,private_backend.rs}, with the published shapes in lee/state_machine/core/src/circuit_io.rs.
What it receives
PrivacyPreservingCircuitInput {
input, // ProvingInput: root, claims, fee, public context, witnesses, dummies, padding, recoveries, promotions
program_image_witnesses,
shadow_program_witnesses,
responses,
sender_presentations,
publication_modes,
predicted_cross_messages,
}
The root is a TransactionEntry: a sync message the sender initiated, or an async message consumed out of a mailbox, whose spend the circuit also computes, as it does for each received message in claims delivered before the root.
What it does
It runs the sequencer’s execution engine with a backend that holds no public state: the_prover_never_reads_a_public_actor_state proves a transaction with a public root while supplying no public actor state. For each handler invocation outside the native token program, the backend verifies a separately proved receipt against the image id claimed for that account, composing it as an assumption rather than re-executing it. a_receipt_for_other_inputs_does_not_bind_in_the_circuit asserts a receipt produced for different inputs does not satisfy the composition.
Four checks close holes a dishonest prover would otherwise have.
Reserved accounts cannot claim guest bytecode. The native token program and the program loader run protocol code, and the circuit asserts no image witness names either: “A reserved program account has no deployable bytecode to claim”. Tested by a_guest_image_claim_for_the_reserved_id_is_refused and a_private_call_into_the_program_loader_is_refused.
An account cannot be claimed twice. If the same account id arrives in more than one image witness, program-image or shadow, the circuit panics.
Claims are minimal and complete. only_the_programs_the_private_part_runs_are_claimed asserts nothing extra is claimed; missing_responses_are_rejected_by_the_circuit and surplus_responses_are_rejected_by_the_circuit assert the handler responses match the execution.
Undisclosed claims are checked rather than trusted. The sequencer compares a disclosed image claim against chain state at settlement; for an undisclosed one the circuit itself checks the header is immutable and derives the membership root.
The circuit recomputes native token operations from protocol code rather than verifying a separate receipt, which is why a private transfer of native balance is cheap and discloses no program.
What it publishes
compute_circuit_output builds the message; What a private transaction reveals reads it field by field.
obfuscate_output_ordering sorts the published actions so their order carries nothing. Nullifiers and commitments are sorted separately, so you cannot tell which commitment replaced which nullifier.
emit_dummy_output writes one action per consumed message (its nullifier paired with a dummy commitment) and one per dummy input the prover supplies; the wallet supplies enough dummies to reach seven private actions when there are fewer (Private actions). The dummy commitments and notes come from seeds and ciphertexts the prover supplies, so their randomness is the prover’s responsibility. The circuit only asserts that each dummy note’s ciphertext is at least the requested padding length, when one is requested, and that its encapsulation is as long as an ML-KEM-768 ciphertext. note_ciphertext_is_padded_to_the_requested_length asserts a real note is padded to the requested length.
Padding works only if length is uniform, tested per note kind by every_sealed_note_under_its_floor_has_one_length and every_recovery_note_has_one_length; a note whose size varied with its contents would leak through that size however well it was encrypted. A note larger than the pad size is not cut down, so its length shows.
Confidentiality and addressing are tested together: a_sealed_message_opens_only_to_its_recipient_and_only_as_committed, a_seal_refuses_a_body_addressed_anywhere_but_its_recipient, and a_recovery_note_opens_to_its_recipient_only_under_its_viewing_secret_and_address. Encryption alone is not enough: a body that opened for the right key but the wrong recipient would still be a break.
What the sequencer checks itself
Before verifying the proof against the published journal, settlement checks the parts it can derive independently: the authorized accounts must be exactly the accounts whose signatures and nonces the transaction carries, each disclosed image claim must name the image deployed at that account id now, and each undisclosed claim’s root must be a commitment root the chain has had. A prover that claimed a different image, or claimed an account was authorized when no signature covered it, is refused even though its proof verifies against its own journal. The nullifier and commitment freshness lookups a replay fails also run before proof verification.
How this chapter was checked
Most claims above cite a named test, run as Sources describes, which also says what dev mode leaves unproven. The circuit’s own tests are in lee/state_machine/src/privacy_preserving_transaction/circuit/tests.rs, with the note and seal properties in lee/state_machine/core/src/{sealing.rs,recovery.rs}.