Skip to content

Commit

Permalink
R1CS consutruction - added a simple explanation of wires and gates
Browse files Browse the repository at this point in the history
  • Loading branch information
thogiti committed Aug 16, 2023
1 parent 0cbaa33 commit 3e196cb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ We get the following output.
![multiply4-r1cs-wasm-witness-output](https://raw.githubusercontent.com/thogiti/thogiti.github.io/master/content/images/20230814/multiply4-r1cs-wasm-witness-output.png)


In `multiplier4` circuit we took `x`, `y`, `u` and `v` (4 wires) and `u1`, `u2` (+2 wires) connected it with the signal `out` (+1 wire) and another (+1 wire) for the output of `out`, and checked the `3` constraints when `u1 <== x * y`, `u2 <== u * v`, and `out <== u1 * u2`. Hence, we have `8` wires and `3` constraint.
In `multiplier4` circuit we took `x`, `y`, `u` and `v` (4 wires) and `u1`, `u2` (+2 wires) connected it with the signal `out` (+1 wire) and another (+1 wire) for the output of `out`, and checked the `3` constraints when `u1 <== x * y`, `u2 <== u * v`, and `out <== u1 * u2`. Hence, we have `8` wires and `3` constraints.



Expand Down Expand Up @@ -777,7 +777,7 @@ We get the following output.
![Example5-r1cs-wasm-witness-output](https://raw.githubusercontent.com/thogiti/thogiti.github.io/master/content/images/20230814/Example5-r1cs-wasm-witness-output.png)


In `Example5` circuit we took `x`, and `y` (2 wires) and `u1`, `u2` (+2 wires) connected it with the signal `out` (+1 wire) and another (+1 wire) for the output of `out`, and checked the `3` constraints when `u1 <== 3 * x * x`, `u2 <== u1 * y`, and `out <== 5 * x * y + u2 - x - 2*y +3`. Hence, we have `6` wires and `3` constraint.
In `Example5` circuit we took `x`, and `y` (2 wires) and `u1`, `u2` (+2 wires) connected it with the signal `out` (+1 wire) and another (+1 wire) for the output of `out`, and checked the `3` constraints when `u1 <== 3 * x * x`, `u2 <== u1 * y`, and `out <== 5 * x * y + u2 - x - 2*y +3`. Hence, we have `6` wires and `3` constraints.



Expand Down

0 comments on commit 3e196cb

Please sign in to comment.