Skip to content
Discussion options

You must be logged in to vote

Hi @YurunChen!

When you call frontend.NewWitness() without any options, it expects a fully-assigned prover-side circuit. In that case you can extract the public component from the full witness.
Alternatively you can use the option frontend.PublicOnly() as in frontend.NewWitness(circuit, frontend.PublicOnly()). So for example if you modify your code slightly to get:

package main

import (
	"fmt"
	"github.com/consensys/gnark-crypto/ecc"
	bn254 "github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc"
	"github.com/consensys/gnark/backend/groth16"
	"github.com/consensys/gnark/frontend"
	r1cs2 "github.com/consensys/gnark/frontend/cs/r1cs"
	"github.com/consensys/gnark/std/hash/mimc"
	"math/big"
	"os"

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Tabaie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants