{"id":13632875,"url":"https://github.com/getZeFi/circomjs","last_synced_at":"2025-04-18T05:33:39.018Z","repository":{"id":117705326,"uuid":"602480715","full_name":"getZeFi/circomjs","owner":"getZeFi","description":"CircomJS is a javascript framework that allows you to automate your Circom workflow in pure javascript.","archived":false,"fork":false,"pushed_at":"2023-06-16T14:19:49.000Z","size":21951,"stargazers_count":37,"open_issues_count":6,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-09-19T16:28:26.851Z","etag":null,"topics":["circom","circom-framework","circomjs","snarkjs","zk-snarks"],"latest_commit_sha":null,"homepage":"https://zefi.gitbook.io/circomjs/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getZeFi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-02-16T09:54:17.000Z","updated_at":"2024-01-14T07:17:59.600Z","dependencies_parsed_at":"2023-06-28T15:00:41.423Z","dependency_job_id":null,"html_url":"https://github.com/getZeFi/circomjs","commit_stats":null,"previous_names":[],"tags_count":2,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getZeFi%2Fcircomjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getZeFi%2Fcircomjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getZeFi%2Fcircomjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getZeFi%2Fcircomjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getZeFi","download_url":"https://codeload.github.com/getZeFi/circomjs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223775290,"owners_count":17200487,"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","circom-framework","circomjs","snarkjs","zk-snarks"],"created_at":"2024-08-01T22:03:21.268Z","updated_at":"2025-04-18T05:33:39.011Z","avatar_url":"https://github.com/getZeFi.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# CIRCOMJS\n\n![circomjs-logo](assets/circomjs-logo.png)\n\nCircomJS is a javascript framework for automating and easing workflow around developing in the [Circom](https://docs.circom.io) DSL.\n\n**We would suggest getting started with this [gitbook](https://zefi.gitbook.io/circomjs), and you should also checkout our [blog post](https://medium.com/zefihq/presenting-circomjs-54f476c075c4) on why we made CircomJS.**\n\nThe framework operates on a simple [circuit.config.js](https://zefi.gitbook.io/circomjs/circuit-config-file/circuit-config-file) file, which is a configuration file for circomJS.\n\nbelow is an example of what a circuit.config.json file looks like.\n\n```json\n{\n  \"projectName\": \"arithmetic\",\n  \"outputDir\": \"./out\",\n  \"build\": {\n    \"inputDir\": \"./circuits\",\n    \"circuits\": [\n      {\n        \"cID\": \"mul\",\n        \"fileName\": \"multiply.circom\",\n        \"compilationMode\": \"wasm\"\n      },\n      {\n        \"cID\": \"add\",\n        \"fileName\": \"addition.circom\",\n        \"proofType\": \"plonk\",\n        \"compilationMode\": \"wasm\"\n      }\n    ]\n  }\n}\n```\n(example circuit.config.json)\n\nYou can also take a look at [CircomJS starter](https://github.com/getZeFi/circomjs-starter) repository for reference.\n\nCircomJS gives you the following capabilities in Javascript!\n\n### Compile your circuits\n\n```javascript\nconst {CircomJS} = require(\"@zefi/circomjs\")\n\nconst main = async() =\u003e {\n    const circomjs = new CircomJS()\n    const circuit =  circomjs.getCircuit(\"mul\")\n\n    // it will build the circuit with cID mul\n    await circuit.compile()\n}\n\nmain()\n```\n\n### Generate Proofs\n\n```javascript\nconst {CircomJS} = require(\"@zefi/circomjs\")\n\nconst main = async() =\u003e {\n    const circomjs = new CircomJS()\n    const circuit =  circomjs.getCircuit(\"mul\")\n\n    // important to await compilation, before running circuit.genProof()\n    await circuit.compile()\n\n    const input = {\n        x: 3,\n        y: 5\n    }\n\n    const proof = await circuit.genProof(input);\n    console.log(\"proof verification result -----\u003e\",await circuit.verifyProof(proof))\n}\n\nmain()\n```\n\n### Verify proofs\n\n```javascript\nconst {CircomJS} = require(\"@zefi/circomjs\")\n\nconst main = async() =\u003e {\n    const circomjs = new CircomJS()\n    const circuit =  circomjs.getCircuit(\"mul\")\n\n    // important to await compilation, before running circuit.genProof()\n    await circuit.compile()\n\n    const input = {\n        x: 3,\n        y: 5\n    }\n\n    const proof = await circuit.genProof(input);\n    console.log(\"proof verification result -----\u003e\",await circuit.verifyProof(proof))\n}\n\nmain()\n```\n\n### and much more!\nYou can do a lot more than this:\n- calculate witness\n- calculate total constraints\n- check constraints on a generated witness\n- automatic download of ideal power of tau file\n\n### Upcoming features\n\nWe are working towards adding new features to the framework, some of which include:\n- support for C compilation of circuits { witness generation programs }\n- parallel build of ZK Circuits\n- integration with Ethersjs to deploy smart contract verifiers\n- smart builds: only building circuits when either source code or a dependency of the circuit has changed.\n- export solidity smart contract verifier\n- export solidity call-data\n\nWe at zefi are open to ideas around the project and would love to interact with the community and see contributions comings its way, feel free to join our [telegram group](https://t.me/+7JPXv-RoXJk0MTVl) and say hi, also feel free to write to us at [contact@zefi.io](mailto:contact@zefi.io).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FgetZeFi%2Fcircomjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FgetZeFi%2Fcircomjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FgetZeFi%2Fcircomjs/lists"}