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

Generate input/output interface for circom. #97

Open
vuvoth opened this issue Aug 16, 2022 · 0 comments
Open

Generate input/output interface for circom. #97

vuvoth opened this issue Aug 16, 2022 · 0 comments

Comments

@vuvoth
Copy link

vuvoth commented Aug 16, 2022

Motivation

We are using snarkjs as backend for circom.

     const { proof, publicSignals } = await snarkjs.groth16.fullProve(
            inputs,
            circuitWasmPath,
            zkeyPath
     )

Variable inputs have type any. Every time we changed circom file we need to update inputs structs. However any make us hard to remember and easy to create error/bugs.
I think we should create function for auto gen inputs/outputs interface of circom. It's help developer easy to test and use circom.

Proposal

Create new interface command line to generate inputs/outputs interface.

Example

circom merkle_tree.circom --types types.ts

Circom file

include "../../../node_modules/circomlib/circuits/comparators.circom";

template Example() {
    signal input first_input;
    signal input second_input[100];
    signal output first_output;
}

We will generate inputs interface like bellow:

interface ExampleInput {
    first_input: bigint;
    second_input: bigint[];
}

Samething for outputs interface.

Thank Iden3 for awesome work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant