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
The witness section should be able to take BaseArray:
witness "MyProof" {
BaseArray some_array,
}
Arrays in the circuit, part 1
In the circuit section, we should be able to construct BaseArray and ScalarArray with the syntax:
foo = [bar, baz];
foo should automatically be typed based on bar and baz (resulting in either BaseArray or ScalarArray)
Arrays in the circuit, part 2
When we have a BaseArray, we should be able to use it in a way that the array explodes.
Example 1
# This should result in constraining both `bar` and `baz` as public inputs
foo = [bar, baz];
constrain_instance(foo);
Example 2
# These two poseidon_hash calls should be equivalent
one = witness_base(1);
foo = [bar, baz];
hash1 = poseidon_hash(one, foo);
hash2 = poseidon_hash(one, bar, baz);
constrain_equal_base(hash1, hash2);
The text was updated successfully, but these errors were encountered:
Another property to keep in mind: there should be error-handling if the .zk file tries to initialize an array that contains both a Scalar and a Base. (i.e. an array's elements must all have the same type).
This might already be handled somewhere in the zkas code but I'm writing it here so we can remember to verify this.
opcode "overloading"
Does example 2 entail that we support many different ways to call opcodes like poseidon_hash? For example, it looks like poseidon_hash can take any number of Bases, Scalars, BaseArrays, and ScalarArrays in any order.
Let's discuss in irc
Improvements that should be made to the language.
Witnessing arrays
The
witness
section should be able to takeBaseArray
:Arrays in the circuit, part 1
In the
circuit
section, we should be able to constructBaseArray
andScalarArray
with the syntax:foo
should automatically be typed based onbar
andbaz
(resulting in eitherBaseArray
orScalarArray
)Arrays in the circuit, part 2
When we have a
BaseArray
, we should be able to use it in a way that the array explodes.Example 1
Example 2
The text was updated successfully, but these errors were encountered: