Documentation

CatCryptCore.Examples.SigmaProtocol

Σ-Protocols: Completeness, SHVZK, Special Soundness, and Commitment #

A Σ-protocol is a three-move public-coin proof of knowledge: the prover sends a commitment a, the verifier replies with a uniform challenge e, the prover answers with a response z, and the verifier checks (a, e, z). The three canonical properties are

This file ports the Schnorr/Σ example so its scope matches SSProve-Rocq's Schnorr.v (perfect SHVZK + the derived commitment). We give a SigmaProtocol structure, the given-challenge transcript distributions, and the three property predicates, then instantiate the XOR-based Bool protocol simpleSigma and discharge all three. Following Damgård and SSProve's SigmaProtocol.v § Commitments, we derive a commitment scheme: hiding reduces to SHVZK (the one-time-pad masking argument that also underlies Examples/Commitment.maskComm_perfect_hiding) and binding reduces to special soundness.

The SHVZK proof is a one-line bijection coupling: XOR-by-(w ⊕ e) is a bijection of the sampled bit, so the real commitment a and the simulated response z are coupled and both transcripts coincide. This is the same liftR_uniform_bij coupling toolkit used by the core one-time-pad and masking-commitment examples.

Main results #

References #

Σ-Protocol Structure #

A Σ-protocol: types and algorithms for the three-move prover/verifier interaction, together with an SHVZK simulator.

Instances For

    A transcript of a Σ-protocol run.

    Instances For

      Given-Challenge Transcript Distributions #

      Following SSProve's SigmaProtocol.v, the challenge e is provided as input (the TRANSCRIPT procedure takes (h, w, e)); this is the standard SHVZK scope and admits a one-dimensional bijection coupling.

      Real transcript for a fixed challenge: honest prover commits and responds.

      Equations
      Instances For

        Simulated transcript for a fixed challenge: the simulator produces (a, z) without the witness.

        Equations
        Instances For

          Property Predicates #

          Completeness: honest transcripts verify.

          Equations
          Instances For

            Perfect SHVZK: for any valid statement/witness and any fixed challenge, the real and simulated transcript distributions are equal — coupled by eqPre to eqPost, hence indistinguishable to every transcript distinguisher.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              Two accepting transcripts sharing the first message but with distinct challenges — the input to a special-soundness extractor.

              Instances For

                Special soundness: an extractor turns any TwoTranscripts into a witness.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For

                  XOR-Based Σ-Protocol over Bool #

                  The demonstration protocol: everything is a bit, the relation is x = w, the response masks the commitment by w ⊕ e, and the simulator masks a fresh response instead.

                  The XOR bijection carrying SHVZK: for fixed w, e, the map a ↦ a ⊕ w ⊕ e couples the real commitment with the simulated response.

                  Equations
                  Instances For

                    The XOR-based Σ-protocol over Bool.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Completeness #

                      theorem CatCrypt.Examples.SigmaProtocol.simpleSigma_complete (x w : Bool) (hrel : simpleSigma.relation x w) (a e : Bool) :
                      have z := a ^^ w ^^ e; simpleSigma.verify x a e z = true

                      Completeness: an honest transcript (a, e, a ⊕ w ⊕ e) verifies.

                      SHVZK #

                      Perfect SHVZK for simpleSigma. The bijection xorTransformBij x e couples the real sampled commitment a with the simulated sampled response z = a ⊕ x ⊕ e; the simulated message z ⊕ x ⊕ e collapses back to a, so both runs yield the identical transcript. The whole argument is one liftR_bind (liftR_uniform_bij …) coupling.

                      Perfect SHVZK, advantage form: no distinguisher separates the real from the simulated transcript.

                      Special Soundness #

                      Extractor for simpleSigma: from (a, e₁, z₁) accepting, a ⊕ z₁ = x ⊕ e₁, so x = a ⊕ z₁ ⊕ e₁.

                      Equations
                      Instances For

                        Derived Commitment Scheme #

                        The Σ-protocol's first message is a commitment to the challenge, with the response as opening (Damgård §5, SSProve SigmaProtocol.v § Commitments).

                        Hiding: the real and simulated commitment transcripts are equidistributed — a direct instance of SHVZK. The masking here is exactly the one-time pad that makes Examples/Commitment.maskComm perfectly hiding.

                        Two openings of a single commitment under different challenges.

                        Instances For

                          A double opening is exactly the input to the special-soundness extractor.

                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For

                            Binding from special soundness. An adversary who double-opens a commitment yields a witness, so breaking binding solves the hard instance.