{"id":14989706,"url":"https://github.com/dl-solarity/chai-zkit","last_synced_at":"2026-03-07T03:31:40.739Z","repository":{"id":250033359,"uuid":"824088635","full_name":"dl-solarity/chai-zkit","owner":"dl-solarity","description":"Chai matchers for Circom","archived":false,"fork":false,"pushed_at":"2025-05-24T21:58:20.000Z","size":384,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-08T22:34:16.772Z","etag":null,"topics":["assertions","chai","chai-plugin","circom","solarity","zk","zkit"],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@solarity/chai-zkit","language":"TypeScript","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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-07-04T10:40:15.000Z","updated_at":"2025-05-24T21:58:22.000Z","dependencies_parsed_at":"2024-08-15T14:19:42.918Z","dependency_job_id":"e7b385e3-28fe-4548-bd42-3605aa5eacb8","html_url":"https://github.com/dl-solarity/chai-zkit","commit_stats":null,"previous_names":["dl-solarity/zkit-chai-matchers"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dl-solarity/chai-zkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fchai-zkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fchai-zkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fchai-zkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fchai-zkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dl-solarity","download_url":"https://codeload.github.com/dl-solarity/chai-zkit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dl-solarity%2Fchai-zkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30206567,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T03:24:23.086Z","status":"ssl_error","status_checked_at":"2026-03-07T03:23:11.444Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["assertions","chai","chai-plugin","circom","solarity","zk","zkit"],"created_at":"2024-09-24T14:18:47.871Z","updated_at":"2026-03-07T03:31:40.403Z","avatar_url":"https://github.com/dl-solarity.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm](https://img.shields.io/npm/v/@solarity/chai-zkit.svg)](https://www.npmjs.com/package/@solarity/chai-zkit)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n# Chai-zkit - Chai matchers for Circom\n\n**A user-friendly Circom Chai matchers for testing witnesses and ZK proofs**\n\n- Write convenient circuits tests via [Chai](https://www.chaijs.com/) assertions extension.\n- Enjoy full TypeScript typization of input and output signals.\n- Integrate smoothly with [hardhat-zkit](https://github.com/dl-solarity/hardhat-zkit).\n\n## Installation\n\nTo install the package, run:\n\n```bash\nnpm install --save-dev @solarity/chai-zkit\n```\n\nAnd add the following line to your `hardhat.config`:\n\n```ts\nimport \"@solarity/chai-zkit\";\n```\n\nOr if you are using JavaScript:\n\n```js\nrequire(\"@solarity/chai-zkit\");\n```\n\n## Usage\n\n\u003e [!IMPORTANT]\n\u003e The package is meant to be used together with [hardhat-zkit](https://github.com/dl-solarity/hardhat-zkit) plugin that provides circuits objects to be tested with chai assertions.\n\nAfter installing the package, you may use the following assertions:\n\n### Witness testing\n\n```ts\nconst matrix = await zkit.getCircuit(\"Matrix\");\n\n// partial output assertion\nawait expect(matrix).with.witnessInputs({ a, b, c }).to.have.witnessOutputs({ d });\n\n// strict assertion, all the outputs must be present\nawait expect(matrix).with.witnessInputs({ a, b, c }).to.have.strict.witnessOutputs({ d, e, f });\n\n// provided output `e` doesn't match the obtained one\nawait expect(expect(matrix).with.witnessInputs({ a, b, c }).to.have.witnessOutputs({ e })).to.be.rejectedWith(\n  `Expected output \"e\" to be \"[[2,5,0],[17,26,0],[0,0,0]]\", but got \"[[1,4,0],[16,25,0],[0,0,0]]\"`,\n);\n\n// witness overrides intentionally break constraints to test failure case\nawait expect(expect(matrix).with.witnessInputs({ a, b, c }, { \"main.a\": 10n }).to.passConstraints()).to.be.rejectedWith(\n  \"Expected witness to pass constraints, but it doesn't\",\n);\n```\n\n### Proof testing\n\n```ts\nconst matrix = await zkit.getCircuit(\"Matrix\");\n\n// proof generation assertion\nawait expect(matrix).to.generateProof({ a, b, c });\nawait expect(matrix).to.not.generateProof({ b, c, d });\n\nconst proof = await matrix.generateProof({ a, b, c });\nconst invalidProof = await matrix.generateProof({ a, b, c }, { \"main.a\": 10n });\n\n// proof verification assertion\nawait expect(matrix).to.verifyProof(proof);\nawait expect(matrix).to.not.verifyProof(invalidProof);\n\n// use generated solidity verifier to verify the proof\nawait expect(matrix).to.useSolidityVerifier(matrixVerifier).and.verifyProof(proof);\n```\n\n### Constraints testing\n\n```ts\nconst matrix = await zkit.getCircuit(\"Matrix\");\n\n// constraints \u003e 6\nawait expect(matrix).to.have.constraints.gt(6);\nawait expect(matrix).to.have.constraints.greaterThan(6);\n\n// constraints \u003c 10\nawait expect(matrix).to.have.constraints.lt(10);\nawait expect(matrix).to.have.constraints.lessThan(10);\n```\n\n## Known limitations\n\n- Do not use `not` chai negation prior `witnessInputs` call, this will break the typization.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-solarity%2Fchai-zkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdl-solarity%2Fchai-zkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdl-solarity%2Fchai-zkit/lists"}