{"id":25420200,"url":"https://github.com/dl-solarity/zktype","last_synced_at":"2025-07-04T03:06:06.439Z","repository":{"id":228322516,"uuid":"772032988","full_name":"dl-solarity/zktype","owner":"dl-solarity","description":"Typescript bindings for Circom circuits","archived":false,"fork":false,"pushed_at":"2025-05-22T15:47:41.000Z","size":818,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-23T16:23:43.180Z","etag":null,"topics":["circom","types","typescript","zkp"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@solarity/zktype","language":"Circom","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":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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,"zenodo":null}},"created_at":"2024-03-14T12:08:57.000Z","updated_at":"2025-04-17T12:57:55.000Z","dependencies_parsed_at":"2024-03-18T08:24:18.772Z","dependency_job_id":"47dcfbdd-4a36-4365-b256-d275f6d113b1","html_url":"https://github.com/dl-solarity/zktype","commit_stats":null,"previous_names":["dl-solarity/zktype"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dl-solarity/zktype","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzktype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzktype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzktype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzktype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dl-solarity","download_url":"https://codeload.github.com/dl-solarity/zktype/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fzktype/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263437338,"owners_count":23466365,"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","types","typescript","zkp"],"created_at":"2025-02-16T19:36:25.292Z","updated_at":"2025-07-04T03:06:06.423Z","avatar_url":"https://github.com/dl-solarity.png","language":"Circom","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/@solarity/zktype.svg)](https://www.npmjs.com/package/@solarity/zktype)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# ZKType - TypeScript bindings for Circom circuits\n\n**ZKType simplifies and makes user-friendly the process of working with Circom circuits.**\n\n- Generate a typed [zkit](https://github.com/dl-solarity/zkit) wrapper for given circuits.\n- Support for `groth16` and `plonk` proving systems.\n- Ensure that all inputs and proofs are correctly formatted.\n- Typization for witness signals substitution.\n\n## Installation\n\nTo install the package, run:\n\n```bash\nnpm install --save-dev @solarity/zktype\n```\n\n## Usage\n\n\u003e [!IMPORTANT]\n\u003e ZKType is not meant to be used directly as its fitness relies heavily on the environment, e.g., on Circom compilation artifacts management. Consider using [hardhat-zkit](https://github.com/dl-solarity/hardhat-zkit), which is a complete, developer-friendly package.\n\n### CircuitTypesGenerator\n\n`CircuitTypesGenerator` is an entry point for generating TypeScript bindings for a given circuit.\n\nTo create a `CircuitTypesGenerator` object, it is necessary to pass a config:\n\n```typescript\nZKTypeConfig = {\n  basePath: \"circuits\",\n  projectRoot: process.cwd(),\n  circuitsArtifacts: [\n    {\n      artifactPath: \"circuits/auth/Matrix_artifacts.json\",\n      circuitProtocolType: [\"groth16\"],\n    },\n  ],\n  outputTypesDir: \"generated-types/circuits\", \n  signalNamesTypeLimit: 50000,\n}\n```\n\nThis config contains all the information required to generate TypeScript bindings for given circuits.\n\n- `basePath` - Path to the root directory of the project where circuits are stored.\n- `projectRoot` - Absolute path to the root directory of the project.\n- `circuitsArtifacts` - Array of object containing the path to the circuit artifact and the protocol type of the circuit.\n- `outputTypesDir` - Path to the directory where the generated types will be stored.\n    - Optional. Default: `generated-types/circuits`.\n- `signalNamesTypeLimit` - Maximum number of signals allowed to generate a `SignalNames` union type for the circuit.\n    - Optional. Default: 50000.\n\n#### API reference\n\n---\n\n- **`async generateTypes()`**\n\nGenerates TypeScript bindings for the given circuits, based on the provided config.\n\n```typescript\nconst generator = new CircuitTypesGenerator(config);\n\nawait generator.generateTypes();\n```\n\nAlso, this function generates the `hardhat.d.ts` file, where you can find all the possible objects that can be retrieved by the function below.\n\n- **`async getCircuitObject(circuitName: string, protocolType?: string): Promise\u003cany\u003e`**\n\nReturns the constructible object for the given circuit.\n\n```typescript\nconst generator = new CircuitTypesGenerator(config);\n\nawait generator.generateTypes();\n\nconst circuitObject = await generator.getCircuitObject(\"MyCircuit\", \"groth16\");\n```\n\nThe package supports generation of circuits by the `groth16` and `plonk` protocols at the same time. \nIn this case, you will have to specify the protocol type when retrieving the object.\n\nAfter the `circuitObject` is retrieved, check out the [zkit](https://github.com/dl-solarity/zkit) documentation to see how to work with it.\n\nTo ensure that the object can be imported, check the `hardhat.d.ts` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-solarity%2Fzktype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdl-solarity%2Fzktype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-solarity%2Fzktype/lists"}