From 11f46141e6e477edf0da2537aac32d3c9dc4d7f0 Mon Sep 17 00:00:00 2001 From: sifnoc Date: Mon, 4 Mar 2024 09:12:40 +0000 Subject: [PATCH] fix: following review comments --- backend/README.md | 4 ++-- backend/src/apis/round.rs | 4 ++-- backend/src/contracts/generated/mod.rs | 6 +++--- backend/src/tests.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/README.md b/backend/README.md index 09232a84..1bb4075c 100644 --- a/backend/README.md +++ b/backend/README.md @@ -95,9 +95,9 @@ If executed successfully, you'll see: ### 2. Submit Commitment -The CEX must submit a commitment to the Summa contract for each round. This commitment consists of a timestamp, a snark proof, a grand sum proof and total balances. +The CEX must submit a commitment to the Summa contract for each round. This commitment consists of a timestamp, a SNARK proof, a grand sum proof and total balances. -Without publishing the commitment, users cannot verify their inclusion proof on the Summa contract. This is because the inclusion verifier function internally requires the snark proof, but users only know the timestamp associated with the round and the verifier functions does not requre the snark proof directly. +Without CEX publishing the commitment, users cannot verify their inclusion proof on the Summa contract. This is because the inclusion verifier function internally requires the SNARK proof, but users only know the timestamp associated with the round and the verifier functions does not requre the SNARK proof directly. In here, we'll introduce you through the process of submitting a commitment using the `Round` to the Summa contract. The Round serves as the core of the backend in Summa, and we have briefly described it in the Components section. diff --git a/backend/src/apis/round.rs b/backend/src/apis/round.rs index 01456555..3afa4a8c 100644 --- a/backend/src/apis/round.rs +++ b/backend/src/apis/round.rs @@ -113,7 +113,7 @@ where /// /// # Fields /// -/// * `zk_snark_proof`: The zk-snark proof for the round, which is used to verify the validity of the round's commitments. +/// * `zk_snark_proof`: The zk-SNARK proof for the round, which is used to verify the validity of the round's commitments. /// * `advice_polys`: Composed of the unblinded advice polynomial, `advice_poly`, and the polynomials of blind factors, `advice_blind`. /// * `params`: The parameters for the KZG commitment scheme. /// * `verifying_key`: The verifying key for getting domains, which is used for generating inclusion proofs. @@ -191,7 +191,7 @@ where let mut opening_proofs = Vec::new(); let mut input_values = Vec::new(); - // Evaluate the commitments from the snark proof + // Evaluate the commitments from the SNARK proof let mut kzg_commitments = Vec::with_capacity(N_CURRENCIES); let mut transcript = Keccak256Transcript::new(self.zk_snark_proof.as_slice()); for _ in 0..(N_CURRENCIES + 1) { diff --git a/backend/src/contracts/generated/mod.rs b/backend/src/contracts/generated/mod.rs index f152fed3..b1fbeba7 100644 --- a/backend/src/contracts/generated/mod.rs +++ b/backend/src/contracts/generated/mod.rs @@ -1,5 +1,5 @@ -pub mod grandsum_verifier; -pub mod inclusion_verifier; -pub mod snark_verifier; pub mod summa_contract; pub mod verifying_key; +pub mod snark_verifier; +pub mod grandsum_verifier; +pub mod inclusion_verifier; \ No newline at end of file diff --git a/backend/src/tests.rs b/backend/src/tests.rs index 48314405..d349ccf1 100644 --- a/backend/src/tests.rs +++ b/backend/src/tests.rs @@ -313,7 +313,7 @@ mod test { let (params, pk, vk) = generate_setup_artifacts(K, Some(PARAMS_PATH), &univariate_grand_sum_circuit).unwrap(); - // Create a snark proof + // Create a SNARK proof let instances = vec![Fp::one(); 1]; // This instance is necessary to verify proof on solidity verifier. let (zk_snark_proof, advice_polys, _omega) = full_prover( ¶ms,