arnaucube
arnaucube/circomPublic Self-hosted repository
Extend the readme.
Jordi Baylina jordi@baylina.cat
Wed, 05 Sep 2018 20:12:23 +0200
commit

5be88b2983863a68c056d9a8e0a0692ae637f23a

parent

296defda852d377f9deebef6dfa6ba3f117753ea

1 files changed, 18 insertions(+), 0 deletions(-)

jump to
M README.md → README.md

@@ -37,6 +37,24 @@ `===` This operator defines a constrain. The constrain must be simplificable to the form a*b+c=0 where a,b and c are linear convinations.

In the example above, we force the two inputs to be binary by adding the constrain `a*(a-1)===0` and `b*(b-1) === 0` +### Compile the circui + +To compile the circuit, you first install the compiler: + +``` +npm install -g circom +```` + +Then just run + +``` +circom -s mycircuit.circom -o mycircuit.json +``` + +The resulting output ( `mycircuit.json` ) can be used with the [zksnarks javascript library](https://github.com/iden3/zksnark) + +In that library you will be able to do the trusted setup, create the proofs and verify them. + ### Number to binary In many situations, we have to convert an input to it's binary representation. We would write a circuit this way: