silversixpence-crypto / zk-proof-of-assets

MIT License
3 stars 0 forks source link

Allow circuits to have 0-valued input signals #18

Closed Stentonian closed 3 months ago

Stentonian commented 4 months ago

Generating zkeys can take multiple days, so it's best to have to do as little of this as possible. We can cut down on the number of zkeys generated if we just allow the circuits to accept 0-valued signals and do not count them as part of the balance sum.

In addition to less zkesy, this means that we can also support any number of sigs for the parallel script, as opposed to a multiple of the batch size. Currently we only gen 1 zkey for each layer, so we have to have that the input number of sigs is a multiple of the size that was used to gen that zkey so all batches can use the same zkey.

Stentonian commented 3 months ago

It is not possible to have 0-valued inputs because the batch ecsda verify template does not support this out of the box, so instead we are going to have to have a 'remainder batch' which is a different size to the rest of the batches. We can adjust the batch size to make this as small as possible so that zkey generation does not take too long.