snarkify/sirius

feat(sp): instance columns public API

cyphersnake opened this issue · 1 comments

We need to implement support for instance columns for step circuit

This task tracks exactly the issue of the public API, how exactly the public signals will be provided internally. Consider the following possibilities:

As Halo2

In halo2, public input is provided directly in the prover\verifier. As I understand it, this is because it can be provided externally (e.g. in the case of client/server logic). However, the private input (circuit-struct content) is usually also modified by the same external sources, which already makes the API not so successful.

Thus such an API could look like this: we add the possibility to IVC::new & IVC::fold_step to provide pub input and process it at IVC level.

But it should be said that in this case, we would need to update not only the circuit, but also the public input between steps, and the logic of this update should lie somewhere so that it is not an artifact of the circuit startup code.

As step-circuit part

In this case we just have to add an additional method to trait StepCircuit that will generate the public input. This is more logical, given that we still have to update the step-circuit between fold-step and the public input is just part of this update

The main downside is it's possibly counter-intuitive for halo2 developers

As an external entity

There is also an option to introduce a higher-order abstraction to handle this logic separately from the step-circuit, but this is not much different from the previous option. Except that there may be less frustration in familiarizing with the concept of handling of public input by circuit. If we can find a good name, it will be easier for developers to understand than if {step-}circuit was doing it

I'm in favor of the second option