-
In all gnark examples I have seen, the circuit returns error or nil. Is there a way to make the circuit returns a computed value? In my usecase, I would like the circuit to compute the commitment of a value and returns the result. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi @jeljelih - gnark circuits right now check the correctness of the computation given an input. But the inputs must be provided by the prover. Even though theoretically it would be possible to return the corresponding witness value from the circuit, it would require substantial architectural redesign. We do not have it on the roadmap and I'm not sure we are going to implement it in the future. So right now, I would just recommend computing the commitment value natively and then use the value as witness to the prover and verifier. |
Beta Was this translation helpful? Give feedback.
Hi @jeljelih - gnark circuits right now check the correctness of the computation given an input. But the inputs must be provided by the prover. Even though theoretically it would be possible to return the corresponding witness value from the circuit, it would require substantial architectural redesign. We do not have it on the roadmap and I'm not sure we are going to implement it in the future.
So right now, I would just recommend computing the commitment value natively and then use the value as witness to the prover and verifier.