go-circom-prover-verifier/README.md
README.mdRaw
1# go-circom-prover [](https://godoc.org/github.com/iden3/go-circom-prover) [](https://goreportcard.com/report/github.com/iden3/go-circom-prover)
2
3Experimental Go implementation of the [Groth16 protocol](https://eprint.iacr.org/2016/260.pdf) zkSNARK prover compatible with [circom](https://github.com/iden3/circom).
4
5
6Using [bn256](https://github.com/ethereum/go-ethereum/tree/master/crypto/bn256/cloudflare) (used by [go-ethereum](https://github.com/ethereum/go-ethereum)) for the Pairing curve operations.
7
8### Example
9
10```go
11// read ProvingKey & Witness files
12provingKeyJson, _ := ioutil.ReadFile("testdata/provingkey.json")
13witnessJson, _ := ioutil.ReadFile("testdata/witness.json")
14
15// parse Proving Key
16pk, _ := circomprover.ParseProvingKey(provingKeyJson)
17
18// parse Witness
19w, _ := circomprover.ParseWitness(witnessJson)
20
21// generate the proof
22proof, pubSignals, err := circomprover.GenerateProof(pk, w)
23assert.Nil(t, err)
24fmt.Println(pubSignals)
25fmt.Println(proof)
26```