{"id":18359592,"url":"https://github.com/starkware-libs/formal-proofs","last_synced_at":"2025-04-10T03:25:03.585Z","repository":{"id":104033957,"uuid":"410476629","full_name":"starkware-libs/formal-proofs","owner":"starkware-libs","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-31T16:40:34.000Z","size":818,"stargazers_count":56,"open_issues_count":0,"forks_count":13,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-15T18:51:18.006Z","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/starkware-libs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-09-26T07:03:10.000Z","updated_at":"2025-02-06T14:42:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"89f9660f-281f-48b6-bb25-7ea50c6fc895","html_url":"https://github.com/starkware-libs/formal-proofs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkware-libs%2Fformal-proofs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkware-libs%2Fformal-proofs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkware-libs%2Fformal-proofs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkware-libs%2Fformal-proofs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starkware-libs","download_url":"https://codeload.github.com/starkware-libs/formal-proofs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248149757,"owners_count":21055815,"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":[],"created_at":"2024-11-05T22:23:36.679Z","updated_at":"2025-04-10T03:25:03.561Z","avatar_url":"https://github.com/starkware-libs.png","language":"Lean","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cairo Verification\n\nThis repository contains formal verification of various aspects of the Cairo programming\nlanguage using the Lean programming language and proof assistant.\n\n## Contents\n\nThe folder [Verification/Semantics](Verification/Semantics) contains a specification of the Cairo\nvirtual machine semantics and a proof of the correctness of the Cairo STARK encoding.\n\n- The file [Cpu.lean](Verification/Semantics/Cpu.lean) contains a specification of the execution\nsemantics of the Cairo CPU, used to prove soundness of Cairo programs and the correctness of the\nSTARK encoding.\n\n- The file [Vm.lean](Verification/Semantics/Vm.lean) contains a slightly abstracted semantics of the\nCairo virtual machine, used to prove completeness of Cairo programs.\n\n- The [AirEncoding](Verification/Semantics/AirEncoding) folder contains a proof of the correctness\nof the algebraic encoding of execution traces of Cairo programs that are used to generate STARK\ncertificates.\n\n- The [Soundness](Verification/Semantics/Soundness) folder contains infrastructure used to prove the\nsoundness of Cairo programs and library functions.\n\n- The [Completeness](Verification/Semantics/Completeness) folder contains infrastructure used to\nprove the soundness of Cairo programs and library functions.\n\nThe folder [Verification/Libfuncs](Verification/Libfuncs) contains verifications of the\nsoundness and completeness of a number of Cairo library functions, also known as *libfuncs*.\n\nThe [lean3](lean3) folder contains older Lean 3 verifications of parts of the CairoZero library,\nincluding:\n\n- basic mathematical calculations\n- operations on the secp256k1 and  secp256r1 elliptic curves\n- digital signature validation\n- procedures for simulating dictionary access in a read-only enviroment.\n\nDetails can be found in the file [README.md](lean3/README.md) in that folder.\n\n\n## Publications\n\n- Our verification of the algebraic encoding of Cairo execution traces is described in the paper\n  [A verified algebraic representation of Cairo program execution](https://dl.acm.org/doi/10.1145/3497775.3503675).\n\n- Our verification tools and our verification of CairoZero code used for elliptic curve operations\n  and to validate cryptographic signatures are described in the paper\n  [A proof-producing compiler for blockchain applications](https://doi.org/10.4230/LIPIcs.ITP.2023.7).\n\n\n## Build\n\nThe main folder is a Lean 4 project. You should have Lean 4 and the VS Code\nextension [installed](https://docs.lean-lang.org/lean4/doc/quickstart.html).\n\nOnce you have Lean 4 installed, you can fetch this repository by choosing `Open Project`\non the Lean VS Code menu or in the usual way with `git clone`. In the latter case, you\nshould run\n\n```\nlake exe cache get\n```\nin this folder to get the precompiled Mathlib files.\n\nUse\n```\nlake build\n```\nto compile all the files listed above `Verification.lean`. One completeness proof in the\n`Libfuncs` folder is commented out because it is slow to build and requires a lot of memory;\nthe remaining files take only a few minutes to compile.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarkware-libs%2Fformal-proofs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarkware-libs%2Fformal-proofs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarkware-libs%2Fformal-proofs/lists"}