Skip to content

Instantly share code, notes, and snippets.

@doutv
Last active July 10, 2023 03:27
Show Gist options
  • Save doutv/0ed578125b251ff555d1bdbbef62036a to your computer and use it in GitHub Desktop.
Save doutv/0ed578125b251ff555d1bdbbef62036a to your computer and use it in GitHub Desktop.
Circom Example

This program proves that I know 2 secret inputs a and b, such that a*b=c, c is a public value.

Open this in zkREPL →

This file can be included into other zkREPLs with include "gist:0ed578125b251ff555d1bdbbef62036a";

pragma circom 2.1.4;
template Example () {
signal input a;
signal input b;
signal input c;
c === a * b;
}
component main { public [ c ] } = Example();
/* INPUT = {
"a": "2",
"b": "3",
"c": "6"
} */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment