{"id":16742134,"url":"https://github.com/vplasencia/circom-snarkjs-scripts","last_synced_at":"2025-04-10T13:32:43.843Z","repository":{"id":112228698,"uuid":"539303842","full_name":"vplasencia/circom-snarkjs-scripts","owner":"vplasencia","description":"Generic scripts to create zero knowledge applications using circom and snarkjs","archived":false,"fork":false,"pushed_at":"2023-03-05T20:02:54.000Z","size":14,"stargazers_count":8,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-24T12:11:32.025Z","etag":null,"topics":["circom","circuits","scripts","snarkjs"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vplasencia.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-21T04:28:13.000Z","updated_at":"2024-06-27T14:06:31.000Z","dependencies_parsed_at":"2023-03-20T12:25:26.643Z","dependency_job_id":null,"html_url":"https://github.com/vplasencia/circom-snarkjs-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vplasencia%2Fcircom-snarkjs-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vplasencia%2Fcircom-snarkjs-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vplasencia%2Fcircom-snarkjs-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vplasencia%2Fcircom-snarkjs-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vplasencia","download_url":"https://codeload.github.com/vplasencia/circom-snarkjs-scripts/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225709,"owners_count":21068078,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["circom","circuits","scripts","snarkjs"],"created_at":"2024-10-13T01:22:46.293Z","updated_at":"2025-04-10T13:32:43.836Z","avatar_url":"https://github.com/vplasencia.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Generic scripts using circom and snarkjs\n\nTo learn more about `circom`: \u003chttps://github.com/iden3/circom\u003e\n\nTo learn more about `snarkjs`: \u003chttps://github.com/iden3/snarkjs\u003e\n\nThe `circom compiler` version used is: `2.0.3`.\n\nThe `snarkjs` version used is: `0.6.1`.\n\n**Note:** All the scripts are inside the `scripts` folder.\n\nTo organize all the scripts you can create a `scripts` folder next to the circuit and input file you want to work with, and add all the scripts like this:\n\n```text\n├── scripts\n│   ├── compile.sh\n│   ├── executeFflonk.sh\n│   ├── executeGroth16.sh\n│   ├── executePlonk.sh\n│   ├── generateWitness.sh\n│   ├── removeBuildFolder.sh\n├── circuit.circom\n├── input.json\n```\n\nWhen you wan to run a script, for each script:\n\nRun the first time:\n\n```bash\nchmod u+x ./scripts/\u003cscriptName\u003e.sh\n```\n\nAnd after that, you can always run:\n\n```bash\n./scripts/\u003cscriptName\u003e.sh\n```\n\nWhen you run one of the `circom` or `circom-snarkjs` scripts, a build folder will be created with all the generated files inside. You can delete the build folder by running the `removeBuildFolder.sh` file.\n\n```bash\n./scripts/removeBuildFolder.sh\n```\n\n**Note:** It is not necessary to run the `removeBuildFolder.sh` script every time you want to run a new script, because every time you run a script, the build folder is automatically removed if it exists.\n\n## circom scripts\n\n- `compile.sh`\n\nTo compile circom circuits, you can run the `compile.sh` file.\n\n```bash\n./scripts/compile.sh\n```\n\n- `generateWitness.sh`\n\nTo generate the witness, you can run `generateWitness.sh`\n\n```bash\n./scripts/generateWitness.sh\n```\n\nWhen you run a `circom` script you will see something like this:\n\n```text\n├── build\n│   ├── ...\n├── scripts\n│   ├── ...\n├── circuit.circom\n├── input.json\n```\n\n## circom-snarkjs scripts\n\n- `executeGroth16.sh`\n\nTo generate all the necessary files for a zero knowledge application using Groth16 run `executeGroth16.sh`.\n\n```bash\n./scripts/executeGroth16.sh\n```\n\n- `executePlonk.sh`\n\nTo generate all the necessary files for a zero knowledge application using Plonk run `executePlonk.sh`.\n\n```bash\n./scripts/executePlonk.sh\n```\n\n- `executeFflonk.sh`\n\nTo generate all the necessary files for a zero knowledge application using Fflonk run `executeFflonk.sh`.\n\n```bash\n./scripts/executeFflonk.sh\n```\n\nWhen you run a `circom-snarkjs` script, you will see something like this:\n\n```text\n├── build\n│   ├── ...\n├── ptau\n│   ├── ...\n├── scripts\n│   ├── ...\n├── circuit.circom\n├── input.json\n```\n\n**Note:** The `ptau` folder is generated with the necessary ptau file, but you can have this folder with the ptau that you will use, and it will not be generated again.\n\nYou can see different ptau files in the [snarkjs documentation](https://github.com/iden3/snarkjs#7-prepare-phase-2).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvplasencia%2Fcircom-snarkjs-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvplasencia%2Fcircom-snarkjs-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvplasencia%2Fcircom-snarkjs-scripts/lists"}