Skip to content

Instantly share code, notes, and snippets.

@tycoi2005
Created April 1, 2023 06:46
Show Gist options
  • Save tycoi2005/66d6be8c202226bc1e16c0ff5931e8ad to your computer and use it in GitHub Desktop.
Save tycoi2005/66d6be8c202226bc1e16c0ff5931e8ad to your computer and use it in GitHub Desktop.
1 st zk
pragma circom 2.1.4;
include "circomlib/poseidon.circom";
// x1, x2, x3, x4
// y = x1
template Example () {
signal input x1;
signal input x2;
signal input x3;
signal input x4;
signal input y1;
signal input y2;
signal input OUT;
y1 === x1 + x2;
y2 === y1 * x3;
y2 === OUT + x4;
}
component main { public [ OUT ] } = Example();
/* INPUT = {
"x1": "2",
"x2": "4",
"x3": "8",
"x4": "5",
"y1": "6",
"y2": "48",
"OUT": "43"
} */
@tycoi2005
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment