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
I was confused as to what the difference between input and output variables in custom gadgets was and so I talked a bit with Eduardo. His response:
Actually there is no notion of output. We don't have a high level description of a gadget. It is in some sense just a slice of a vector of constraints. Currently you need to use the gadget "manually". For example, I can start an empty vector of constraints. Then I can initialize it with gadget A. Afterwards, I can concatenate a gadget B, but I am responsible for adding some linear constraints that make sure the variables that are supposed to be the output (I know the position of such variables for each gadget) are indeed used as input of next gadget. More concretely. If I start using an identity gadget 2 times, for variables a and b, then the input and output are the same, I must provide a witness that will be stored in position zero, and another witness that is stored on position 1. In the future, when I need to make reference to a or b then I need to remember their positions.
Namely, if I want to add a gadget for some ECC operation using variable b and the current size of the vector of constraints is for example 100, then must add a constraint that glues together the variables on positions 1 and 100+offset.
Therefore, I guess we will have to define some way to parameterize these positions, in order to allow more intelligent way to compose gadgets. But I imagine the compiler knows the position of each variable, while our implementation doesn't know the concept of a variable.
So there's not really any distinction between input and output variables. A gadget does not have any assignments and does not introduce any new variables. And is basically a list of constraints in a fully compiled form.
I do not fully grasp all the details here, but gadgets seem specific enough for us not to bother connecting them with procedures/functions at all. So it seems we don't even need to bother with procedures/functions for an MVP.
Making gadgets work will require some effort, though, due to them being so painfully low-level. Functions would be easier. But supporting gadgets seems inevitable.
The text was updated successfully, but these errors were encountered:
I was confused as to what the difference between input and output variables in custom gadgets was and so I talked a bit with Eduardo. His response:
So there's not really any distinction between input and output variables. A gadget does not have any assignments and does not introduce any new variables. And is basically a list of constraints in a fully compiled form.
I do not fully grasp all the details here, but gadgets seem specific enough for us not to bother connecting them with procedures/functions at all. So it seems we don't even need to bother with procedures/functions for an MVP.
Making gadgets work will require some effort, though, due to them being so painfully low-level. Functions would be easier. But supporting gadgets seems inevitable.
The text was updated successfully, but these errors were encountered: