{"id":13803847,"url":"https://github.com/starkware-libs/stone-prover","last_synced_at":"2025-04-09T06:11:29.127Z","repository":{"id":191884857,"uuid":"682077767","full_name":"starkware-libs/stone-prover","owner":"starkware-libs","description":null,"archived":false,"fork":false,"pushed_at":"2024-09-16T13:22:55.000Z","size":1694,"stargazers_count":267,"open_issues_count":12,"forks_count":80,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-04-02T02:11:42.548Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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":"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}},"created_at":"2023-08-23T11:45:48.000Z","updated_at":"2025-03-30T20:14:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc1e9d5e-9d61-44f5-ab43-bb449663703b","html_url":"https://github.com/starkware-libs/stone-prover","commit_stats":null,"previous_names":["starkware-libs/stone-prover"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkware-libs%2Fstone-prover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkware-libs%2Fstone-prover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkware-libs%2Fstone-prover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/starkware-libs%2Fstone-prover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/starkware-libs","download_url":"https://codeload.github.com/starkware-libs/stone-prover/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987285,"owners_count":21028895,"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-08-04T01:00:38.397Z","updated_at":"2025-04-09T06:11:29.104Z","avatar_url":"https://github.com/starkware-libs.png","language":"C++","funding_links":[],"categories":["Additional developer resources","Layer 2"],"sub_categories":["Starknet"],"readme":"# Overview\n\n[STARK](https://starkware.co/stark/) is a proof system. It uses cutting-edge cryptography to\nprovide poly-logarithmic verification resources and proof size, with minimal and\npost-quantum-secure assumptions.\n\nThis repository contains a prover and a verifier for STARKs, and in particular for the CPU AIR\nunderlying the CairoZero programming language.\n\n# Installation instructions\n\nFor now, only Linux platforms are supported.\n\n## Building using the dockerfile\n\nThe root directory contains a dedicated Dockerfile which automatically builds the package and\nruns the unit tests on a simulated machine.\nYou should have docker installed (see https://docs.docker.com/get-docker/).\n\nClone the repository:\n\n```bash\ngit clone https://github.com/starkware-libs/stone-prover.git\n```\n\nBuild the docker image:\n\n```bash\ncd stone-prover\ndocker build --tag prover .\n```\n\nThis will run an end-to-end test with an example cairo program.\nOnce the docker image is built, you can fetch the prover and verifier executables using:\n\n```bash\ncontainer_id=$(docker create prover)\ndocker cp -L ${container_id}:/bin/cpu_air_prover .\ndocker cp -L ${container_id}:/bin/cpu_air_verifier .\n```\n\n## Creating and verifying a proof of a Cairo program\n\n\nNavigate to the example test directory (`e2e_test/Cairo`):\n\n```bash\ncd e2e_test/Cairo\n```\n\nInstall `cairo-vm/cairo1-run` (see further instructions in the\n[cairo-vm repository](https://github.com/lambdaclass/cairo-vm)):\n\n```bash\ngit clone https://github.com/lambdaclass/cairo-vm.git\ncd cairo-vm/cairo1-run\nmake deps\n```\n\nCompile and run the program to generate the prover input files:\n\n```bash\ncargo run ../../fibonacci.cairo \\\n    --layout=small \\\n    --air_public_input=fibonacci_public_input.json \\\n    --air_private_input=fibonacci_private_input.json \\\n    --trace_file=fibonacci_trace.bin \\\n    --memory_file=fibonacci_memory.bin \\\n    --proof_mode\n```\n\nRun the prover:\n```bash\ncpu_air_prover \\\n    --out_file=fibonacci_proof.json \\\n    --private_input_file=fibonacci_private_input.json \\\n    --public_input_file=fibonacci_public_input.json \\\n    --prover_config_file=../../cpu_air_prover_config.json \\\n    --parameter_file=../../cpu_air_params.json\n```\n\nThe proof is now available in the file `fibonacci_proof.json`.\n\nFinally, run the verifier to verify the proof:\n```bash\ncpu_air_verifier --in_file=fibonacci_proof.json \u0026\u0026 echo \"Successfully verified example proof.\"\n```\n\n**Note**: The verifier only checks that the proof is consistent with\nthe public input section that appears in the proof file.\nThe public input section itself is not checked.\nFor example, the verifier does not check what Cairo program is being proved,\nor that the builtins memory segments are of valid size.\nThese things need to be checked externally.\n\n## Creating and verifying a proof of a CairoZero program\n\nTo run and prove the example program `fibonacci.cairo`,\ninstall `cairo-lang` version 0.13.2 (see further instructions in the\n[cairo-lang repository](https://github.com/starkware-libs/cairo-lang/tree/v0.13.2)):\n\n```bash\npip install cairo-lang==0.13.2\n```\n\nNavigate to the example test directory (`e2e_test/CairoZero`):\n\n```bash\ncd e2e_test/CairoZero\n```\n\nCompile `fibonacci.cairo`:\n\n```bash\ncairo-compile fibonacci.cairo --output fibonacci_compiled.json --proof_mode\n```\n\nRun the compiled program to generate the prover input files:\n\n```bash\ncairo-run \\\n    --program=fibonacci_compiled.json \\\n    --layout=small \\\n    --program_input=fibonacci_input.json \\\n    --air_public_input=fibonacci_public_input.json \\\n    --air_private_input=fibonacci_private_input.json \\\n    --trace_file=fibonacci_trace.bin \\\n    --memory_file=fibonacci_memory.bin \\\n    --print_output \\\n    --proof_mode\n```\n\nRun the prover:\n```bash\ncpu_air_prover \\\n    --out_file=fibonacci_proof.json \\\n    --private_input_file=fibonacci_private_input.json \\\n    --public_input_file=fibonacci_public_input.json \\\n    --prover_config_file=cpu_air_prover_config.json \\\n    --parameter_file=cpu_air_params.json\n```\n\nThe proof is now available in the file `fibonacci_proof.json`.\n\nFinally, run the verifier to verify the proof:\n```bash\ncpu_air_verifier --in_file=fibonacci_proof.json \u0026\u0026 echo \"Successfully verified example proof.\"\n```\n\n**Note**: The verifier only checks that the proof is consistent with\nthe public input section that appears in the proof file.\nThe public input section itself is not checked.\nFor example, the verifier does not check what CairoZero program is being proved,\nor that the builtins memory segments are of valid size.\nThese things need to be checked externally.\n\n## Configuration for other input sizes\n\nThe number of steps affects the size of the trace.\nSuch changes may require modification of `cpu_air_params.json`.\nSpecifically, the following equation must be satisfied.\n```\nlog₂(last_layer_degree_bound) + ∑fri_step_list = log₂(#steps) + 4\n```\nFor instance, assuming a fixed `last_layer_degree_bound`,\na larger number of steps requires changes to the `fri_step_list`\nto maintain the equality.\n\nFRI steps should typically be in the range 2-4;\nthe degree bound should be in the range 4-7.\n\nThe constant 4 that appears in the equation is hardcoded `log₂(trace_rows_per_step) = log₂(16) = 4`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarkware-libs%2Fstone-prover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstarkware-libs%2Fstone-prover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstarkware-libs%2Fstone-prover/lists"}