{"id":25420201,"url":"https://github.com/dl-solarity/zkit","last_synced_at":"2025-10-06T23:04:50.478Z","repository":{"id":236176762,"uuid":"787873927","full_name":"dl-solarity/zkit","owner":"dl-solarity","description":"Circom zero knowledge kit","archived":false,"fork":false,"pushed_at":"2025-06-19T08:45:41.000Z","size":342,"stargazers_count":9,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-06T23:03:51.370Z","etag":null,"topics":["circom","kit","snarkjs","typescript","zk"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@solarity/zkit","language":"EJS","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/dl-solarity.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-17T10:50:12.000Z","updated_at":"2025-08-18T11:58:48.000Z","dependencies_parsed_at":"2024-05-23T08:28:46.808Z","dependency_job_id":"bc168a57-15c6-4ecb-99de-e2395b3649ff","html_url":"https://github.com/dl-solarity/zkit","commit_stats":null,"previous_names":["dl-solarity/zkit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dl-solarity/zkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dl-solarity","download_url":"https://codeload.github.com/dl-solarity/zkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278692948,"owners_count":26029408,"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","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"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":["circom","kit","snarkjs","typescript","zk"],"created_at":"2025-02-16T19:36:25.546Z","updated_at":"2025-10-06T23:04:50.449Z","avatar_url":"https://github.com/dl-solarity.png","language":"EJS","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/@solarity/zkit.svg)](https://www.npmjs.com/package/@solarity/zkit)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Tests](https://github.com/dl-solarity/zkit/actions/workflows/tests.yml/badge.svg)](https://github.com/dl-solarity/zkit/actions/workflows/tests.yml)\n\n# ZKit - Circom Zero Knowledge Kit\n\n**A zero knowledge kit that helps you interact with Circom circuits.**\n\n- Generate and verify ZK proofs with a single line of code.\n- Leverage `groth16` and `plonk` proving systems.\n- Render optimized Solidity | Vyper verifiers.\n- Build and work with ZK witnesses.\n- Substitute witness signals for advanced circuits testing.\n\n## Installation\n\nTo install the package, run:\n\n```bash\nnpm install --save-dev @solarity/zkit\n```\n\n## Usage\n\n\u003e [!IMPORTANT]\n\u003e The kit is not meant to be used directly as its fitness relies heavily on the environment, Circom compilation artifacts management, processing of remappings, etc. Consider using [hardhat-zkit](https://github.com/dl-solarity/hardhat-zkit) which is a complete, developer-friendly package.\n\n### CircuitZKit\n\n`CircuitZKit` is a user-friendly interface for interacting with circom circuits.\n\nTo create a `CircuitZKit` object it is necessary to pass a circuit config and a `ProtocolImplementer` instance:\n\n```typescript\nconst config = {\n  circuitName: string;\n  circuitArtifactsPath: string;\n  verifierDirPath: string;\n};\n\nconst implementer = new Groth16Implementer() | new PlonkImplementer();\n\nconst circuit = new CircuitZKit\u003c\"groth16\" | \"plonk\"\u003e(config, implementer);\n```\n\nThe `config` contains all the information required to work with the circuit, namely:\n\n- `circuitName` - Name of the circuit file without extension.\n- `circuitArtifactsPath` - Full path to compilation artifacts for the desired circuit.\n- `verifierDirPath` - Full path to the directory where Solidity | Vyper verifier file will be generated.\n\nThe `implementer` is the instance of a certain proving system. Currently `groth16` and `plonk` systems are supported.\n\n#### API reference\n\n---\n\n- **`async createVerifier(\"sol\" | \"vy\", verifierNameSuffix?: string)`**\n\nCreates a Solidity | Vyper verifier contract with the optional `verifierNameSuffix` on `verifierDirPath` path, which was specified in the config.\n\n```typescript\nawait circuit.createVerifier(\"sol\");\nawait circuit.createVerifier(\"sol\", \"_suffix_\");\n```\n\n- **`async calculateWitness(inputs, witnessOverrides?) -\u003e bigint[]`**\n\nCalculates a witness in the `tmp` directory and returns its json representation.\nAn optional `witnessOverrides` parameter can be provided to replace specific signal values in the generated witness file.\n\n```typescript\n/// witness = [1n, 200n, 20n, 10n]\nconst witness = await circuit.calculateWitness({ a: 10, b: 20 });\n\n/// witness = [1n, 200n, 35n, 10n]\nconst witness = await circuit.calculateWitness({ a: 10, b: 20 }, { \"main.a\": 35 });\n```\n\n- **`async generateProof(inputs, witnessOverrides?) -\u003e proof`**\n\nGenerates a proof for the given `inputs` and `witnessOverrides`.\n\n```typescript\n/// { proof: { pi_a, pi_b, pi_c, protocol, curve }, publicSignals: [6] }\nconst proof = await circuit.generateProof({ a: 2, b: 3 });\n```\n\n- **`async verifyProof(proof) -\u003e bool`**\n\nVerifies the proof.\n\n```typescript\n/// true\nconst isValidProof = await circuit.verifyProof(proof);\n```\n\n- **`async generateCalldata(proof) -\u003e calldata`**\n\nGenerates `Calldata` struct by proof for the Solidity | Vyper verifier's `verifyProof()` method.\n\n```typescript\n/// You can use this `calldata` sturct in the circuit verifier contract.\n/// calldata: { proofPoints: { a, b, c }, publicSignals: [6] }\nconst calldata = await circuit.generateCalldata(proof);\n```\n\n- **`getCircuitName() -\u003e string`**\n\nReturns the name of the circuit from the config.\n\n- **`getVerifierName(verifierNameSuffix?: string) -\u003e string`**\n\nReturns the name of the verifier in the following form:\n\n```typescript\n\u003cCircuit name\u003e\u003cSuffix\u003e\u003cProving system\u003eVerifier\n```\n\n- **`getProvingSystemType() -\u003e \"groth16\" | \"plonk\"`**\n\nReturns the current proving system in use.\n\n- **`getVerifierTemplate() -\u003e string`**\n\nReturns the full `ejs` verifier template as a `string`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-solarity%2Fzkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdl-solarity%2Fzkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-solarity%2Fzkit/lists"}