The arguments given to -a
are the arguments that will be passed to your main
function. These can be public or private depending on the main functions type signature. If you look at the final proof.json
that is generated, you'll see the public arguments are included while the private ones are not.
Note that they need to be flattened and passed as a space-separated list. For example, if your main function takes two field
s, i.e. main(field a, field b)
, you should pass two arguments, e.g. -a 1 2
. If your main function is main(field[5] a, field b)
, you should pass an argument list like -a 1 2 3 4 5 6
, so a = [1, 2, 3, 4, 5]
and b = 6
. You can find some more examples in the documentation of ZoKrates.
Note that you can also pass the arguments as JSON, by using the --abi
flag. This will be more convenient if your arguments are arrays or structs. This is explained in more detail in the official documentation. When using ABI format, take care to encode types correctly. For example, a field is passed a JSON string (e.g. "42"
) while an integer type like u32 is passed as a JSON string containing its hexadecimal representation (e.g. "0x2a"
for 42).