From bfdade4aa85fad185b31c331c6385dd31e3d7dae Mon Sep 17 00:00:00 2001 From: vezenovm Date: Fri, 15 Mar 2024 17:20:51 +0000 Subject: [PATCH 1/4] add clarfiication on the different between double_verify_proof and double_verify_recursive_proof --- .../double_verify_nested_proof/src/main.nr | 14 +++++++++++--- .../double_verify_proof/src/main.nr | 1 + .../double_verify_proof_recursive/src/main.nr | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/test_programs/execution_success/double_verify_nested_proof/src/main.nr b/test_programs/execution_success/double_verify_nested_proof/src/main.nr index 0466f2a226d..3c12e8754ae 100644 --- a/test_programs/execution_success/double_verify_nested_proof/src/main.nr +++ b/test_programs/execution_success/double_verify_nested_proof/src/main.nr @@ -1,10 +1,18 @@ use dep::std; +// This circuit aggregates two recursive proofs from `double_verify_proof_recursive`. +// Recursive aggregation is a backend-specific process and it is expected for backends +// to attach any extra data they may need (e.g. aggregation objects). +// Whether the proof we are verifying itself contains a recursive proof is expected to be +// a circuit constant by the barretenberg. Barretenberg hides this circuit constant in the +// proof serialization. Thus, we must have separate circuits for verifying a normal proof and a recursive proof +// with two different proof sizes. fn main( verification_key: [Field; 114], - // This is the proof without public inputs attached. - // - // This means: the size of this does not change with the number of public inputs. + // This is the proof without user-specified public inputs attached. + // + // This means: the size of this does not change with the number of public inputs unless + // they have been attached by the backend. proof: [Field; 109], public_inputs: pub [Field; 1], // This is currently not public. It is fine given that the vk is a part of the circuit definition. diff --git a/test_programs/execution_success/double_verify_proof/src/main.nr b/test_programs/execution_success/double_verify_proof/src/main.nr index 4edf5c5af9f..139de0a232f 100644 --- a/test_programs/execution_success/double_verify_proof/src/main.nr +++ b/test_programs/execution_success/double_verify_proof/src/main.nr @@ -1,5 +1,6 @@ use dep::std; +// This circuit aggregates two recursive proofs from `assert_statement_recursive`. fn main( verification_key: [Field; 114], // This is the proof without public inputs attached. diff --git a/test_programs/execution_success/double_verify_proof_recursive/src/main.nr b/test_programs/execution_success/double_verify_proof_recursive/src/main.nr index e4c6926efbc..ea7180a60f3 100644 --- a/test_programs/execution_success/double_verify_proof_recursive/src/main.nr +++ b/test_programs/execution_success/double_verify_proof_recursive/src/main.nr @@ -1,5 +1,6 @@ use dep::std; +// This circuit aggregates two recursive proofs from `assert_statement_recursive`. #[recursive] fn main( verification_key: [Field; 114], From 8519847b4ccf290483fa52eab71a00bafd2530da Mon Sep 17 00:00:00 2001 From: vezenovm Date: Fri, 15 Mar 2024 17:22:52 +0000 Subject: [PATCH 2/4] further clarification --- .../execution_success/double_verify_nested_proof/src/main.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_programs/execution_success/double_verify_nested_proof/src/main.nr b/test_programs/execution_success/double_verify_nested_proof/src/main.nr index 3c12e8754ae..6b6236263fb 100644 --- a/test_programs/execution_success/double_verify_nested_proof/src/main.nr +++ b/test_programs/execution_success/double_verify_nested_proof/src/main.nr @@ -2,7 +2,7 @@ use dep::std; // This circuit aggregates two recursive proofs from `double_verify_proof_recursive`. // Recursive aggregation is a backend-specific process and it is expected for backends -// to attach any extra data they may need (e.g. aggregation objects). +// to attach any extra data they may need (e.g. aggregation objects) to their proofs. // Whether the proof we are verifying itself contains a recursive proof is expected to be // a circuit constant by the barretenberg. Barretenberg hides this circuit constant in the // proof serialization. Thus, we must have separate circuits for verifying a normal proof and a recursive proof From 6f19cb0a925ff9c373fb1c3ae5dbe00e6691e91d Mon Sep 17 00:00:00 2001 From: vezenovm Date: Fri, 15 Mar 2024 17:23:17 +0000 Subject: [PATCH 3/4] improve comment --- test_programs/execution_success/double_verify_proof/src/main.nr | 2 +- .../execution_success/double_verify_proof_recursive/src/main.nr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test_programs/execution_success/double_verify_proof/src/main.nr b/test_programs/execution_success/double_verify_proof/src/main.nr index 139de0a232f..d832ce0f049 100644 --- a/test_programs/execution_success/double_verify_proof/src/main.nr +++ b/test_programs/execution_success/double_verify_proof/src/main.nr @@ -1,6 +1,6 @@ use dep::std; -// This circuit aggregates two recursive proofs from `assert_statement_recursive`. +// This circuit aggregates two proofs from `assert_statement_recursive`. fn main( verification_key: [Field; 114], // This is the proof without public inputs attached. diff --git a/test_programs/execution_success/double_verify_proof_recursive/src/main.nr b/test_programs/execution_success/double_verify_proof_recursive/src/main.nr index ea7180a60f3..86b4971c3a6 100644 --- a/test_programs/execution_success/double_verify_proof_recursive/src/main.nr +++ b/test_programs/execution_success/double_verify_proof_recursive/src/main.nr @@ -1,6 +1,6 @@ use dep::std; -// This circuit aggregates two recursive proofs from `assert_statement_recursive`. +// This circuit aggregates two proofs from `assert_statement_recursive`. #[recursive] fn main( verification_key: [Field; 114], From a5d941b40cb08bb308c570cffe2696a65b585770 Mon Sep 17 00:00:00 2001 From: vezenovm Date: Fri, 15 Mar 2024 19:00:49 +0000 Subject: [PATCH 4/4] nargo fmt --- .../execution_success/double_verify_nested_proof/src/main.nr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_programs/execution_success/double_verify_nested_proof/src/main.nr b/test_programs/execution_success/double_verify_nested_proof/src/main.nr index 6b6236263fb..95d4b6f6995 100644 --- a/test_programs/execution_success/double_verify_nested_proof/src/main.nr +++ b/test_programs/execution_success/double_verify_nested_proof/src/main.nr @@ -12,7 +12,7 @@ fn main( // This is the proof without user-specified public inputs attached. // // This means: the size of this does not change with the number of public inputs unless - // they have been attached by the backend. + // they have been attached by the backend. proof: [Field; 109], public_inputs: pub [Field; 1], // This is currently not public. It is fine given that the vk is a part of the circuit definition.