zorch.stage¶
Separately deployable roles for conditional proof reductions.
A stage is one mathematical claim-reduction contract. Its prover and verifier are separate runtime objects so role-specific capabilities, especially proving and verification keys, never need to share an object.
The roles are structural, like ProverRound/VerifierRound and Transcript:
an adapter or a wrapper conforms by shape, without inheriting. Their members
are @abstractmethod, so a class that does subclass one fails loudly at
construction if it leaves a role method unimplemented — structural conformance
for foreign types, nominal enforcement for its own implementers.
TrivialClaim
dataclass
¶
The claim that holds by construction, so nothing remains to prove.
A stage reducing to this is a complete argument rather than one link in a chain: an argument of knowledge is exactly a reduction to the trivial claim.
Source code in zorch/stage.py
38 39 40 41 42 43 44 45 | |
ProveResult
dataclass
¶
Bases: Generic[ReducedClaim, ReductionProof, TranscriptT]
A reduced claim, its conditional reduction proof, and the transcript.
Source code in zorch/stage.py
48 49 50 51 52 53 54 | |
VerifyResult
dataclass
¶
Bases: Generic[ReducedClaim, TranscriptT]
The verifier-derived reduced claim, advanced transcript, and verdict.
Source code in zorch/stage.py
57 58 59 60 61 62 63 | |
ProverStage ¶
Bases: Protocol[Claim_contra, Witness_contra, ReducedClaim, ReductionProof, TranscriptT]
The prover role of one conditional claim reduction.
The transcript parameter carries the caller's concrete type through the
reduction; omit it and it is the base Transcript.
Source code in zorch/stage.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
VerifierStage ¶
Bases: Protocol[Claim_contra, ReducedClaim, ReductionProof_contra, TranscriptT]
The verifier role of the same conditional claim reduction.
Source code in zorch/stage.py
84 85 86 87 88 89 90 91 92 93 94 95 | |