{"id":27968741,"url":"https://github.com/nethermindeth/risczero-fv","last_synced_at":"2025-07-29T03:08:59.209Z","repository":{"id":278407396,"uuid":"629944419","full_name":"NethermindEth/risczero-fv","owner":"NethermindEth","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-02T01:21:46.000Z","size":2464,"stargazers_count":6,"open_issues_count":5,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-07T21:07:01.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/NethermindEth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-04-19T10:48:02.000Z","updated_at":"2025-05-06T18:39:07.000Z","dependencies_parsed_at":"2025-05-07T21:07:03.040Z","dependency_job_id":"5888f39f-c80e-4102-963c-be55e725d908","html_url":"https://github.com/NethermindEth/risczero-fv","commit_stats":null,"previous_names":["nethermindeth/risczero-fv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NethermindEth/risczero-fv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Frisczero-fv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Frisczero-fv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Frisczero-fv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Frisczero-fv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NethermindEth","download_url":"https://codeload.github.com/NethermindEth/risczero-fv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NethermindEth%2Frisczero-fv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267621605,"owners_count":24116901,"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-07-29T02:00:12.549Z","response_time":2574,"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":"2025-05-07T21:06:59.312Z","updated_at":"2025-07-29T03:08:59.161Z","avatar_url":"https://github.com/NethermindEth.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RISC Zero RISC-V zk circuit formalisation in Lean\n\nThis Lean repository contains a model of RISC Zero's Zirgen eDSL and its target MLIR,\ntogether with the verification of several proof of concept zk circuits.\n\nThis repository is closely tied to the [verification condition generator](https://github.com/NethermindEth/risczero-fv-extractor/),\nwhich extracts circuits from Zirgen, generates weakest preconditions and gives us template Lean files\nwhere we specify and prove behaviour of said circuits.\n\nWe invite you to read a more thorough overview in the blog post '[Towards formal verification of the first RISC-V zkVM](https://www.nethermind.io/blog/towards-formal-verification-of-the-first-risc-v-zkvm)'.\n\n## Running the formalisation\n\n### Installing Lean and building the project\nThe simplest way to install the particular version of Lean we use is to [download and install the most recent version](https://lean-lang.org/lean4/doc/quickstart.html) of Lean and Elan.\nOnce it is in place, simply run `lake build` in the root directory. This will download all the necessary components and build the project.\n\n### Looking at the examples\nIn `Risc0/Gadgets`, there are several examples with specifications and proofs.\n\nThe examples that are fully complete are: \n- RISC-V instruction decoder, in `Risc0/Gadgets/ComputeDecode`.\n- IsZero circuit / gadget, in `Risc0/Gadgets/IsZero`.\n- OneHot2 circuit / gadget, in `Risc0/Gadgets/OneHot2`.\n\nThe `.../Proofs.lean` file in each of the folders contains both the specifications and their proofs.\nWe customarily state `constraints_of_witness` and `spec_of_constraints`.\nThe former says that the generated witness conforms to the constraints and the latter states that\nthe constraints imply that our desired behaviour of the circuit holds, whatever that behaviour may be.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnethermindeth%2Frisczero-fv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnethermindeth%2Frisczero-fv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnethermindeth%2Frisczero-fv/lists"}