|
|
@@ -1,7 +1,15 @@
|
|
|
+# Intro:
|
|
|
+#
|
|
|
+# This is the source of ZK circuit.
|
|
|
+# It has 3 sections: constant, witness and circuit.
|
|
|
+# constant and witness describe the data the ZK statements are constraining.
|
|
|
+
|
|
|
# 2 ** k is the maximum nubmer of rows in the circuit.
|
|
|
-k = 13;
|
|
|
+k = 11;
|
|
|
|
|
|
# Section to declare constants used in the circuit.
|
|
|
+# "Set_V1" is the namepsace of circuit.
|
|
|
+# It is the namespace for storing verifying key onchain.
|
|
|
constant "Set_V1" {}
|
|
|
|
|
|
# Witness is the inputs to the circuit, both public and private.
|
|
|
@@ -49,13 +57,18 @@ circuit "Set_V1" {
|
|
|
# # Prove
|
|
|
#
|
|
|
# The prove API is essentially: prove(proving_key, witness) -> proof
|
|
|
-# The proving key, essentially, is the same across different witnesses and proofs
|
|
|
-# but unique per circuit.
|
|
|
+#
|
|
|
+# The prover provides the circuit, and generates the proving key. The proving key essentially
|
|
|
+# encodes the circuit but does not include information for the witness, so it is
|
|
|
+# the same across different witnesses (and therefore proofs) but unique per circuit.
|
|
|
#
|
|
|
# # Verify
|
|
|
#
|
|
|
# The verifying API is essentially: verify(verifying_key, proof, public_inputs) -> {T, F}
|
|
|
-# The verifying key is the same across different proofs but unique per circuit.
|
|
|
-#
|
|
|
-# For more info, you can try this zk intro to get a mental model:
|
|
|
+#
|
|
|
+# The verifier provides the circuit, and generates the verifying key. The verifying key similarly
|
|
|
+# encodes only the circuit, and not the public inputs or the proof. The verifying key is the same
|
|
|
+# across different proofs but unique per circuit.
|
|
|
+#
|
|
|
+# For more info, you can try this zk intro:
|
|
|
# https:#learn.0xparc.org/materials/circom/learning-group-1/circom-1
|