{"id":20194812,"url":"https://github.com/reilabs/proven-zk","last_synced_at":"2025-03-03T07:45:55.794Z","repository":{"id":185307956,"uuid":"652694500","full_name":"reilabs/proven-zk","owner":"reilabs","description":"A support library for working with zero knowledge cryptography in Lean 4.","archived":false,"fork":false,"pushed_at":"2025-01-22T17:52:49.000Z","size":177,"stargazers_count":34,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T18:37:22.223Z","etag":null,"topics":["formal-verification","lean","lean4","zero-knowledge"],"latest_commit_sha":null,"homepage":"https://reilabs.io","language":"Lean","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reilabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2023-06-12T15:45:48.000Z","updated_at":"2025-01-22T17:52:50.000Z","dependencies_parsed_at":"2023-10-17T01:36:50.835Z","dependency_job_id":"c7d12e3a-6b6d-4726-8a4a-0a09beba5630","html_url":"https://github.com/reilabs/proven-zk","commit_stats":null,"previous_names":["reilabs/proven-zk"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Fproven-zk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Fproven-zk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Fproven-zk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Fproven-zk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reilabs","download_url":"https://codeload.github.com/reilabs/proven-zk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241629741,"owners_count":19993708,"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":["formal-verification","lean","lean4","zero-knowledge"],"created_at":"2024-11-14T04:14:21.499Z","updated_at":"2025-03-03T07:45:55.776Z","avatar_url":"https://github.com/reilabs.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://reilabs.io\"\u003e\n\u003cpicture\u003e\n  \u003csource width=\"150\" media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/reilabs/gnark-lean-extractor/assets/35899/c04bdb7f-4c31-4264-acb6-a96f32c6cc29\"\u003e\n  \u003csource width=\"150\" media=\"(prefers-color-scheme: light)\" srcset=\"https://github.com/reilabs/gnark-lean-extractor/assets/35899/fc11280b-e3e5-4a6f-83da-788884083c36\"\u003e\n  \u003cimg width=\"150\" src=\"https://github.com/reilabs/gnark-lean-extractor/assets/35899/fc11280b-e3e5-4a6f-83da-788884083c36\"\u003e\n\u003c/picture\u003e\n\u003c/a\u003e\n\n# ProvenZK\n\nThis repository contains `proven-zk`, a library designed to assist in the\n[Lean](https://leanprover.github.io)-based analysis and verification of\n[zero-knowledge](https://en.wikipedia.org/wiki/Zero-knowledge_proof) (ZK)\ncircuits. It is currently developed to work with\n[gnark](https://github.com/ConsenSys/gnark) circuits extracted from Go using\nReilabs' [Gnark Extractor](https://github.com/reilabs/gnark-lean-extractor), but\nmay be expanded to work with other ZK systems in the future.\n\nFor an overview of how [how you can use](#how-to-use-the-library) the library,\nand the [components](#components) it provides. If you would like to contribute,\nor are looking for some resources on getting started with Lean, please see our\n[contributing guide](./CONTRIBUTING.md).\n\n## How to Use the Library\n\nWe assume that you are building your lean projects using the `lake` tool, and\nhence have a `lakefile.lean`. You can add the library as a dependency to that\nfile as follows.\n\n```lean\nrequire ProvenZK from git\n  \"https://github.com/reilabs/proven-zk.git\"\n```\n\n## Components\n\nThe library provides a number of components that are useful for the formal\nverification of zero knowledge circuits.\n\nThe basic definitions of the gates can be found in\n[`Gates.lean`](./ProvenZk/Gates.lean), and\n[`Vector.lean`](./ProvenZk/Ext/Vector.lean) and are the core components used to\nrepresent gates and vectors in the formal representation of these circuits.\n\nYou can import these as follows:\n\n```lean\nimport ProvenZk.Gates\nimport ProvenZk.Ext.Vector\n```\n\nThe gates in ProvenZK are implemented using modular arithmetic using the\n[`ZMod`](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Data/ZMod/Defs.html#ZMod)\ntype from [Mathlib 4](https://leanprover-community.github.io/mathlib4_docs/). \nFor available operations please see the definitions in\n[`Gates.lean`](./ProvenZk/Gates.lean).\n\nThe other main components of the library contain of multiple theorems to assist\nwith the formal verification of circuits. These are as follows:\n\n- `import ProvenZK.Binary`: The definition of the `Bits` type, as well as\n  various theorems to assist in working with the `to_binary` and `from_binary`\n  functions.\n- `import ProvenZK.Hash`: The definition of the\n  [perfect hash](https://en.wikipedia.org/wiki/Perfect_hash_function) to be used\n  for the purposes of formal verification.\n- `import ProvenZK.Merkle`: The definition of the\n  [merkle tree](https://en.wikipedia.org/wiki/Merkle_tree) and associated\n  theorems that assist in the formal verification of circuits working with this\n  data type.\n\nIn addition to these main interfaces to the library, there are additional helper\nfunctions and theorems that can be found in the following files.\n\n```lean\nimport ProvenZk.Ext.Range\nimport ProvenZk.Ext.Matrix\nimport ProvenZk.Ext.List\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freilabs%2Fproven-zk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freilabs%2Fproven-zk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freilabs%2Fproven-zk/lists"}