Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[circuits] circuit input template #565

Open
vivianjeng opened this issue Oct 19, 2023 · 0 comments
Open

[circuits] circuit input template #565

vivianjeng opened this issue Oct 19, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@vivianjeng
Copy link
Member

vivianjeng commented Oct 19, 2023

we can output a circuit template (or/and a type) for other packages to use
For example

const epochKeyCircuitInputs = {
        state_tree_elements: Array(STATE_TREE_DEPTH).fill(0),
        state_tree_indices: Array(STATE_TREE_DEPTH).fill(0),
        identity_secret: 0,
        data: Array(FIELD_COUNT).fill(0),
        sig_data: 0,
        nonce: 0,
        epoch: 0,
        attester_id: 0,
        reveal_nonce: 0,
        chain_id: 0,
    }

It can be used in tests, genEpochKeyProof and so on

And in the attester app
If a server can provide state tree proofs, the user can just provide identity secret to generate the proof without synchronizing the whole unirep states with the template.

const { publicSignals, proof } = await prover.genProofAndPublicSignals(
  Circuit.epochKey, 
  epochKeyCircuitInputs
)
@vivianjeng vivianjeng added enhancement New feature or request good first issue Good for newcomers labels Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant