You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the inner circuit has non-empty CommitmentInfo, its vk will include CommitmentInfo(bn254/setup.go)
func Setup(r1cs *cs.R1CS, pk *ProvingKey, vk *VerifyingKey) error {
... ...
// get R1CS nb constraints, wires and public/private inputs
nbWires := r1cs.NbInternalVariables + r1cs.GetNbPublicVariables() + r1cs.GetNbSecretVariables()
commitmentInfo := r1cs.CommitmentInfo.(constraint.Groth16Commitments)
commitmentWires := commitmentInfo.CommitmentIndexes()
privateCommitted := commitmentInfo.GetPrivateCommitted()
nbPrivateCommittedWires := internal.NbElements(privateCommitted)
// a commitment is itself defined by a hint so the prover considers it private
// but the verifier will need to inject the value itself so on the groth16
// level it must be considered public
nbPublicWires := r1cs.GetNbPublicVariables() + len(commitmentInfo). //COUNT commitmentInfo in
.... ...
vkK := make([]fr.Element, nbPublicWires)
... ...
vk.G1.K = g1PointsAff[offset : offset+nbPublicWires] //commitmentInfo is included into vk.G1.K
offset += nbPublicWires
While in outer Circuit's solver (bn254/solver.go), the CommitmentInfo is not count in
Yup, it is a more general issue - right now we do not support the commitment inside in-circuit verifier. It is good to have feature, but we haven't had time to implement yet. But the good news is that I have received feedback from a team that they are looking into implementing the feature. Hopefully it would be upstreamed.
ivokub
changed the title
invalid witness size in Groth16 recursive circuit if inner circuit has non-empty CommitmentInfo.
feat: implement commitment verification in Groth16 in-circuit recursive verifier
Jan 10, 2024
Description
If the inner circuit has non-empty CommitmentInfo, its vk will include CommitmentInfo(bn254/setup.go)
While in outer Circuit's solver (bn254/solver.go), the CommitmentInfo is not count in
Steps to Reproduce
run TestRecursiveHashCircuit in std/recursion/std directory, it will fail with
Your Environment
The text was updated successfully, but these errors were encountered: