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
When mapping the Abi to witness values, nargo does this by encoding the ABI and assigning each value in order to a witness. This ordering coincidentally matched with the witnesses that the evaluator assigns to Abi parameters.
Solution
The evaluator should specify the mapping of Abi parameters to witness indices, and nargo should just use that mapping.
This removes the witness offset parameter in nargo because it is no longer manually mapping parameters to witness indices.
Alternatives considered
Additional context
The text was updated successfully, but these errors were encountered:
As a follow-on to this issue (can break out this into a separate issue later), we're likely going to want to remove the concept of a circuit's "public ABI" (or at least specialise it).
We should have the invariantabi.decode(abi.encode(inputs)) == inputs however we're currently hiding the fact that we've actually got two kinds of ABI encoding happening. Firstly for proving where we want to get a BTreeMap<Witness, FieldElement> which doesn't include outputs and verification where we want a Vec<FieldElement> which do include outputs.
We've then got the invariant abi.decode(abi.encode(inputs, skip_output), skip_output) but this issue adds an extra complication of the intermediate type being different. At this point we should just lean into these two encodings being different and separate them.
We could then always use the full ABI but have encode_public and decode_public methods or have a separate PublicAbi struct (I'm leaning towards former).
Am I right in think that once this work is complete, it will be possible to construct an initial witness from user input using the noir ABI only? I.e. it will not be necessary to read any information from the corresponding ACIR?
Problem
When mapping the Abi to witness values, nargo does this by encoding the ABI and assigning each value in order to a witness. This ordering coincidentally matched with the witnesses that the evaluator assigns to Abi parameters.
Solution
The evaluator should specify the mapping of Abi parameters to witness indices, and nargo should just use that mapping.
This removes the witness offset parameter in nargo because it is no longer manually mapping parameters to witness indices.
Alternatives considered
Additional context
The text was updated successfully, but these errors were encountered: