{"id":19052983,"url":"https://github.com/m-azra3l/zk-circuit-implementation","last_synced_at":"2026-06-22T17:31:13.523Z","repository":{"id":180724670,"uuid":"656047976","full_name":"m-azra3l/zk-circuit-implementation","owner":"m-azra3l","description":"Using the circom programming language to implement a circuit and deploy a verifier on-chain to verify proofs generated from this circuit.","archived":false,"fork":false,"pushed_at":"2023-07-12T14:51:30.000Z","size":4765,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-11T17:30:48.582Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","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/m-azra3l.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}},"created_at":"2023-06-20T06:52:12.000Z","updated_at":"2023-07-21T15:46:26.000Z","dependencies_parsed_at":"2023-07-12T15:49:18.684Z","dependency_job_id":null,"html_url":"https://github.com/m-azra3l/zk-circuit-implementation","commit_stats":null,"previous_names":["m-azra3l/zk-circuit-implementation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/m-azra3l/zk-circuit-implementation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-azra3l%2Fzk-circuit-implementation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-azra3l%2Fzk-circuit-implementation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-azra3l%2Fzk-circuit-implementation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-azra3l%2Fzk-circuit-implementation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-azra3l","download_url":"https://codeload.github.com/m-azra3l/zk-circuit-implementation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-azra3l%2Fzk-circuit-implementation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34659895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-08T23:28:38.143Z","updated_at":"2026-06-22T17:31:13.501Z","avatar_url":"https://github.com/m-azra3l.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zardkat 🐱\n\nA [hardhat-circom](https://github.com/projectsophon/hardhat-circom) template to generate zero-knowledge circuits, proofs, and solidity verifiers\n\n## Quick Start\nCompile the Multiplier2() circuit and verify it against a smart contract verifier\n\n```\npragma circom 2.0.0;\n\n/*This circuit template checks that c is the multiplication of a and b.*/  \n\ntemplate Multiplier2 () {  \n\n   // Declaration of signals.  \n   signal input a;  \n   signal input b;  \n   signal output c;  \n\n   // Constraints.  \n   c \u003c== a * b;  \n}\ncomponent main = Multiplier2();\n```\n### Install\n`npm i`\n\n### Compile\n`npx hardhat compile` \nThis will generate the **out** file with circuit intermediaries and geneate the **MultiplierVerifier.sol** contract\n\n### Prove and Deploy\n`npx hardhat run scripts/deploy.ts`\nThis script does 4 things  \n1. Deploys the MultiplierVerifier.sol contract\n2. Generates a proof from circuit intermediaries with `generateProof()`\n3. Generates calldata with `generateCallData()`\n4. Calls `verifyProof()` on the verifier contract with calldata\n\nWith two commands you can compile a ZKP, generate a proof, deploy a verifier, and verify the proof 🎉\n\n## Configuration\n### Directory Structure\n**circuits**\n```\n├── multiplier\n│   ├── circuit.circom\n│   ├── input.json\n│   └── out\n│       ├── circuit.wasm\n│       ├── multiplier.r1cs\n│       ├── multiplier.vkey\n│       └── multiplier.zkey\n├── new-circuit\n└── powersOfTau28_hez_final_12.ptau\n```\nEach new circuit lives in it's own directory. At the top level of each circuit directory lives the circom circuit and input to the circuit.\nThe **out** directory will be autogenerated and store the compiled outputs, keys, and proofs. The Powers of Tau file comes from the Polygon Hermez ceremony, which saves time by not needing a new ceremony. \n\n\n**contracts**\n```\ncontracts\n└── MultiplierVerifier.sol\n```\nVerifier contracts are autogenerated and prefixed by the circuit name, in this example **Multiplier**\n\n## hardhat.config.ts\n```\n  circom: {\n    // (optional) Base path for input files, defaults to `./circuits/`\n    inputBasePath: \"./circuits\",\n    // (required) The final ptau file, relative to inputBasePath, from a Phase 1 ceremony\n    ptau: \"powersOfTau28_hez_final_12.ptau\",\n    // (required) Each object in this array refers to a separate circuit\n    circuits: JSON.parse(JSON.stringify(circuits))\n  },\n```\n### circuits.config.json\ncircuits configuation is separated from hardhat.config.ts for **autogenerated** purposes (see next section)\n```\n[\n  {\n    \"name\": \"multiplier\",\n    \"protocol\": \"groth16\",\n    \"circuit\": \"multiplier/circuit.circom\",\n    \"input\": \"multiplier/input.json\",\n    \"wasm\": \"multiplier/out/circuit.wasm\",\n    \"zkey\": \"multiplier/out/multiplier.zkey\",\n    \"vkey\": \"multiplier/out/multiplier.vkey\",\n    \"r1cs\": \"multiplier/out/multiplier.r1cs\",\n    \"beacon\": \"0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f\"\n  }\n]\n```\n\n**adding circuits**   \nTo add a new circuit, you can run the `newcircuit` hardhat task to autogenerate configuration and directories i.e  \n```\nnpx hardhat newcircuit --name newcircuit\n```\n\n**determinism**\n\u003e When you recompile the same circuit using the groth16 protocol, even with no changes, this plugin will apply a new final beacon, changing all the zkey output files. This also causes your Verifier contracts to be updated.\n\u003e For development builds of groth16 circuits, we provide the --deterministic flag in order to use a NON-RANDOM and UNSECURE hardcoded entropy (0x000000 by default) which will allow you to more easily inspect and catch changes in your circuits. You can adjust this default beacon by setting the beacon property on a circuit's config in your hardhat.config.js file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-azra3l%2Fzk-circuit-implementation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-azra3l%2Fzk-circuit-implementation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-azra3l%2Fzk-circuit-implementation/lists"}