Skip to content

Commit

Permalink
fix: following review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
sifnoc committed Mar 4, 2024
1 parent 16ec4ce commit 11f4614
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions backend/src/apis/round.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions backend/src/contracts/generated/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
2 changes: 1 addition & 1 deletion backend/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
&params,
Expand Down

0 comments on commit 11f4614

Please sign in to comment.