celo-org / celo-bls-snark-rs

Implements SNARK-friendly BLS signatures
https://celo.org
Apache License 2.0
83 stars 24 forks source link

Feature: support padding with dummy epochs #179

Closed kobigurk closed 4 years ago

kobigurk commented 4 years ago

Description

In order to have the circuit have a maximum number of epochs, but still support proving a smaller number of epochs, we add the support of padding with dummy epochs.

Regular epochs have index > 1.

These epochs have the following properties:

We change the circuit logic to perform the following:

Tested

We add tests for proofs with dummy epochs.

kobigurk commented 4 years ago

I didn't see this in the diff, but do you check somewhere that index[i] = 0 or (index[p] + 1), where p corresponds to the last epoch message that had a non-zero index? I think not including this would mean you can prove non-linear chains, even going back in time.

This is where the change relevant to this happened: https://github.com/celo-org/celo-bls-snark-rs/pull/179/files#diff-680350cbb026168b5a7a9366fb90840fR150.

kobigurk commented 4 years ago

@psivesely any more comments? :slightly_smiling_face: