{"id":20194783,"url":"https://github.com/reilabs/lampe","last_synced_at":"2025-09-06T03:33:24.957Z","repository":{"id":254287077,"uuid":"834631801","full_name":"reilabs/lampe","owner":"reilabs","description":"Extracting the semantics of Noir to Lean for formal verification","archived":false,"fork":false,"pushed_at":"2025-09-04T15:33:39.000Z","size":3526,"stargazers_count":34,"open_issues_count":18,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-04T16:28:47.413Z","etag":null,"topics":["lean4","noir-lang","program-extraction","theorem-proving","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":"docs/CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-27T21:42:24.000Z","updated_at":"2025-09-03T21:27:19.000Z","dependencies_parsed_at":"2024-08-22T15:16:33.376Z","dependency_job_id":"466defb6-df11-4fe1-812b-6ec7d913133d","html_url":"https://github.com/reilabs/lampe","commit_stats":null,"previous_names":["reilabs/lampe"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reilabs/lampe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Flampe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Flampe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Flampe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Flampe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reilabs","download_url":"https://codeload.github.com/reilabs/lampe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reilabs%2Flampe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273853419,"owners_count":25179849,"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-09-06T02:00:13.247Z","response_time":2576,"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":["lean4","noir-lang","program-extraction","theorem-proving","zero-knowledge"],"created_at":"2024-11-14T04:14:05.004Z","updated_at":"2025-09-06T03:33:24.949Z","avatar_url":"https://github.com/reilabs.png","language":"Lean","funding_links":[],"categories":["Developer Tools"],"sub_categories":["Security"],"readme":"# Lampe\n\n\u003e Lampe (/lɑ̃p/), a light to illuminate the darkness\n\nThis project contains a model of [Noir's](https://noir-lang.org) semantics in the\n[Lean](https://lean-lang.org) programming language and theorem prover. The aim is to support the\nformal verification of both the Noir language semantics and the properties of programs written in\nNoir.\n\n## Installation\n\nAt the current time, Lampe can be installed by cloning this repository and building its code. In\norder to do so you will need:\n\n- **Rust:** Best installed via [rustup](https://www.rust-lang.org/tools/install) using the official\n  instructions.\n- **Lean:** Best installed via [elan](https://github.com/leanprover/elan) by following the\n  instructions in the repository.\n\nTo install and test the `lampe` tool, please ensure that you have both Rust's `cargo` and Lean's\n`lake` available on your path, and then perform the following steps.\n\n1. **Clone the Repository:** You can clone the repository onto your local machine as follows. Use an\n   HTTPS URL by default, but if you intend to contribute we recommend using an SSH remote instead.\n\n   ```bash\n   git clone https://github.com/reilabs/lampe lampe\n   ```\n\n2. **Set Up the Rust Version:** Enter the directory using `cd lampe` and run `rustup install` to set\n   up the correct rust toolchain.\n\n3. **Build the Lampe CLI:** Run `cargo install` to build the CLI and make it available on your path.\n\n4. **Build the Lean Project:** While not strictly necessary at this stage, this will ensure that you\n   have all the necessary dependencies and the correct lean toolchain. Please be aware that this\n   build can take _a long time_ as the library and its dependencies are very complex.\n\n   ```bash\n   cd Lampe\n   lake build\n   ```\n\n5. **Setup the Xonsh shell:** It is required to run scripts in the repo, so if you are uninterested\n   in doing so you can skip this step. Check the [Xonsh website](https://xon.sh/contents.html) for\n   installation instructions.\n\n## Usage\n\nAt this stage you should be able to execute the `lampe` CLI, with the `lampe` command available on\nyour path.\n\n1. **Find Your Project:** Start by entering the directory containing your Noir project. It should\n   contain a `Nargo.toml` file and the standard project structure.\n2. **Extract the Project:** You can run the `lampe` CLI with no arguments to extract a project in\n   the current directory. For more detailed usage information of the CLI, run `lampe --help`.\n\nRunning this command will create a `lampe` directory in the same directory as your project,\ncontaining the Lean code generated from extracting your Noir project. The generated code will follow\na structure similar to the below.\n\n```\n+- \u003cpackage-name\u003e-\u003cpackage-version\u003e-\n|   |\n|   +-- Extracted\n|   |   |\n|   |   +-- Dependencies\n|   |   |   |\n|   |   |   +-- Each dependency in own module\n|   |   |\n|   |   +-- Noir extracted code matching file paths as created by user in Noir project\n|   |\n|   +-- Here you should add your own Lean files\n|\n+-- \u003cpackage-name\u003e-\u003cpackage-version\u003e.lean\n|\n+-- lakefile.toml\n|\n+-- lean-toolchain\n```\n\nAt the current time the `lampe` tool does not support re-running project extraction. If you want to\ndo so, please remove the `./lampe/Extracted` directory and re-run the `lampe` command.\n\n### Creating a Simple Proof\n\nCreating a proof of Noir code using Lampe involves using the theorem proving capabilities of the\n[Lean](https://lean-lang.org) language. From a very high level, it involves stating _theorems_ about\nthe behavior of the Lean code, and then using _tactics_ to prove that these theorems actually do\nhold. Teaching Lean is beyond the scope of this guide, but we recommend looking at\n[Functional Programming in Lean](https://lean-lang.org/functional_programming_in_lean/) and\n[Theorem Proving in Lean](https://lean-lang.org/theorem_proving_in_lean4/) as introductions to doing\nsuch tasks.\n\nA very simple example can be found in the `examples/SimpleProject` directory of this repository. It\ndefines a very small Noir project with a single function called `return_one` which does exactly what\nits name suggests. In this project we have committed a pre-extracted Lampe project, which can be\nfound in the `lampe` subdirectory as described above.\n\nBy way of demonstration, we have included a small proof of a theorem that states that `return_one`\ndoes indeed return the value `1`. You can view this proof in\n[`SimpleProject-0.0.0.lean`](./examples/SimpleProject/lampe/SimpleProject-0.0.0.lean), which is\ncommented to describe what it does.\n\n## Contributing\n\nIf you would like to contribute code or documentation (non-code contributions are _always_ welcome)\nto this repository, please take a look at our [contributing](./docs/CONTRIBUTING.md) documentation.\nIt provides an overview of how to get up and running, as well as what the contribution process looks\nlike for this repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freilabs%2Flampe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freilabs%2Flampe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freilabs%2Flampe/lists"}