{"id":31943214,"url":"https://github.com/zksecurity/stark-evm-adapter","last_synced_at":"2025-10-14T09:50:13.369Z","repository":{"id":206263139,"uuid":"713167423","full_name":"zksecurity/stark-evm-adapter","owner":"zksecurity","description":"Adapt your STARK stone proofs for verifications on Ethereum","archived":false,"fork":false,"pushed_at":"2024-10-02T21:29:23.000Z","size":3528,"stargazers_count":17,"open_issues_count":2,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-14T22:36:14.771Z","etag":null,"topics":["annotations","evm","stark","stone-prover"],"latest_commit_sha":null,"homepage":"https://zksecurity.github.io/stark-evm-adapter/stark_evm_adapter/index.html","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zksecurity.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":"2023-11-02T01:18:31.000Z","updated_at":"2024-10-02T21:27:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"82fa957d-2f84-4513-a7e0-ac3e4d9638ea","html_url":"https://github.com/zksecurity/stark-evm-adapter","commit_stats":null,"previous_names":["zksecurity/stark-evm-adapter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zksecurity/stark-evm-adapter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zksecurity%2Fstark-evm-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zksecurity%2Fstark-evm-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zksecurity%2Fstark-evm-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zksecurity%2Fstark-evm-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zksecurity","download_url":"https://codeload.github.com/zksecurity/stark-evm-adapter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zksecurity%2Fstark-evm-adapter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018555,"owners_count":26086404,"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-10-14T02:00:06.444Z","response_time":60,"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":["annotations","evm","stark","stone-prover"],"created_at":"2025-10-14T09:50:03.347Z","updated_at":"2025-10-14T09:50:13.365Z","avatar_url":"https://github.com/zksecurity.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# STARK-EVM adapter\n\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-zksecurity/stark_evm_adapter-8da0cb?style=for-the-badge\u0026labelColor=555555\u0026logo=github\" height=\"20\"\u003e](https://github.com/zksecurity/stark-evm-adapter)\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/stark-evm-adapter.svg?style=for-the-badge\u0026color=fc8d62\u0026logo=rust\" height=\"20\"\u003e](https://crates.io/crates/stark-evm-adapter)\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-stark_evm_adapter-66c2a5?style=for-the-badge\u0026labelColor=555555\u0026logo=docs.rs\" height=\"20\"\u003e](https://docs.rs/stark-evm-adapter)\n[\u003cimg alt=\"build status\" src=\"https://img.shields.io/github/actions/workflow/status/zksecurity/stark-evm-adapter/rust.yml?branch=main\u0026style=for-the-badge\" height=\"20\"\u003e](https://github.com/zksecurity/stark-evm-adapter/actions?query=branch%main)\n\nstark-evm-adapter is a library that provides a set of utilities to parse and manipulate the output of the STARK [stone proof](https://github.com/starkware-libs/stone-prover).\nSpecifically, the library can be used to generate a \"split proof\", which is necessary for proofs to be verified on Ethereum.\n\n```toml\n[dependencies]\nstark-evm-adapter = \"0.1.3\"\n```\n\n## Example\n\n```rust\nuse stark_evm_adapter::annotated_proof::AnnotatedProof;\nuse stark_evm_adapter::annotation_parser::split_fri_merkle_statements;\n\n// read an annotated proof\nlet file = std::fs::File::open(\"tests/fixtures/annotated_proof.json\").unwrap();\nlet reader = std::io::BufReader::new(file);\nlet annotated_proof: AnnotatedProof = serde_json::from_reader(reader).unwrap();\n\n// split the proof\nlet split_proofs = split_fri_merkle_statements(annotated_proof).unwrap();\nprintln!(\"{}\", serde_json::to_string_pretty(\u0026split_proofs).unwrap());\n\n// For how to submit the split proofs to the L1 EVM verifier, please refer to the demo: https://github.com/zksecurity/stark-evm-adapter/blob/8af44a0aa61c89e36a08261320f234709e99ed71/examples/verify_stone_proof.rs#L18\n```\n\nNote that the annotated proof file, `annotated_proof.json`, can be generated using this CLI tool.\n\n## CLI\n\n### Installation\n\n```bash\ncargo install stark_evm_adapter\n```\n\n### Usage\n\n```bash\nstark_evm_adapter --help\n```\n\nTo generate an annotated proof based on the outputs of the stone-prover:\n\n```bash\nstark_evm_adapter gen-annotated-proof \\\n    --stone-proof-file tests/fixtures/stone_proof.json \\\n    --stone-annotation-file tests/fixtures/stone_proof_annotation.txt \\\n    --stone-extra-annotation-file tests/fixtures/stone_proof_annotation_extra.txt \\\n    --output annotated_proof.json\n```\n\nThe annotated proof originates from 3 file outputs of the [stone-prover](https://github.com/starkware-libs/stone-prover/tree/00b274b55c82077184be4c0758f7bed18950eaba#creating-and-verifying-a-proof-of-a-cairozero-program).\n\n* `stark_evm_adapter --stone-proof-file` comes from `cpu_air_prover --out_file` (JSON format)\n* `stark_evm_adapter --stone-annotation-file` comes from `cpu_air_verifier --annotation-file` (.txt format)\n* `stark_evm_adapter --stone-extra-annotation-file` comes from `cpu_air_verifier --extra-output-file` (.txt format)\n\nOnce you have this annotated proof, you can use it to generate the split proofs and submit them to the L1 EVM verifier. Please refer to the [example demo](https://github.com/zksecurity/stark-evm-adapter/blob/8af44a0aa61c89e36a08261320f234709e99ed71/examples/verify_stone_proof.rs#L18)\n\n## Demo\n\nYou can run the demo to split the proof and submit it to the Ethereum mainnet verifier. The [existing proof](./examples/bootloader/fib_annotated_proof.json) contains an internal proof that the 10th Fibonacci number is 144.\n\n### Using existing proof\n\nFirst, install Anvil using [Foundry](https://book.getfoundry.sh/getting-started/installation)\n\nThen, run the following command:\n\n```bash\nFORK_URL=\u003cETHEREUM-MAINNET-RPC\u003e \\\n    ANNOTATED_PROOF=./annotated_proof.json \\\n    FACT_TOPOLOGIES=./fact_topologies.json \\\n    cargo run --example verify_stone_proof\n```\n\n### Generate new proof\n\nYou can create a new proof using Docker\n\n#### Prerequisites\n\n- Copy `objects.py` and `utils.py` for bootloader as `hidden/bootloader-objects.py` and `hidden/bootloader-utils.py`\n- Copy `objects.py` and `utils.py` for simple bootloader as `hidden/simple-bootloader-objects.py` and `hidden/simple-bootloader-utils.py`\n- Copy `cpu_air_prover` and `cpu_air_verifier` binaries generated from [stone-prover](https://github.com/starkware-libs/stone-prover) into the `./examples/bootloader/stone-prover` directory (Can also use the binaries from this [release](https://github.com/zksecurity/stark-evm-adapter/releases/tag/v0.1.0-alpha))\n\n#### Customize program that is being proven\n\n- Replace `TASK_PROGRAM_INPUT_PATH` and `TASK_PROGRAM_COMPILED_PATH` variables in `test_bootloader_fib.py` with your own program.\n\n#### Run\n\nFirst, build the docker image. This will create an annotated proof and a fact topologies file that is needed to split the proof for verifying on Ethereum:\n\n```bash\ndocker build -t stark-evm-adapter .\n```\n\nThen, run the demo script:\n\n```bash\ndocker run -it -e FORK_URL=\u003cETHEREUM-MAINNET-RPC\u003e -e ANNOTATED_PROOF=./examples/bootloader/gen/annotated_proof.json -e FACT_TOPOLOGIES=./examples/bootloader/gen/fact_topologies.json stark-evm-adapter\n```\n\n### Note\n\n- Alternatively, you can use `URL` instead of `FORK_URL` env to submit transactions on-chain instead of running them on a fork.\n- This example verifies proofs on [`0xd51a3d50d4d2f99a345a66971e650eea064dd8df`](https://etherscan.io/address/0xd51a3d50d4d2f99a345a66971e650eea064dd8df), which is the previous version of the verifier on Ethereum. The most recent version is [`0x9fb7F48dCB26b7bFA4e580b2dEFf637B13751942`](https://etherscan.io/address/0x9fb7F48dCB26b7bFA4e580b2dEFf637B13751942), and we are working to update this example to use the most recent version.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzksecurity%2Fstark-evm-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzksecurity%2Fstark-evm-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzksecurity%2Fstark-evm-adapter/lists"}