A zero-knowledge virtual machine that generates proofs of correct execution for programs written in Rust or other LLVM-compiled languages.
starkware-libs/stwo
A Rust implementation of Circle STARK proving and verification over the M31 field, with a no_std verifier and SIMD prover backend.
- Stars
- 507
- Forks
- 183
- Open issues
- 48
- Last commit
- 2 days ago
What is it?
Stwo is a Circle STARK prover and verifier written in Rust. It runs the proof system over the Mersenne prime field M31 (2^31 − 1), which allows 32-bit modular arithmetic that maps onto SIMD lanes such as AVX2, AVX-512, NEON and WebAssembly SIMD. The library includes the M31, CM31 and QM31 field tower, circle FFT, a FRI variant for the circle domain, lifted Merkle commitments, and several Fiat-Shamir channels including Blake2s, Blake3, Poseidon252 and Keccak256.
The repository is split into crates. The core crate separates a no_std verifier from the prover, which is enabled by the `prover` feature. Constraint-framework, air-utils and reference examples (Fibonacci, Poseidon2, Blake, PLONK-style and a state machine) sit alongside it. GKR and LogUp lookup arguments are included for memory and table checks.
Stwo is the foundation of StarkWare's SHARP prover and the stwo-cairo prover for the Cairo VM. Application-specific provers are developed in separate repositories. Development is moving to starkware-libs/proving from the end of July 2026.
Key features
- 01Circle STARK prover and verifier over the M31 field.
- 02A no_std verifier that can be built without the prover code.
- 03SIMD backend for AVX2, AVX-512, NEON and WebAssembly, plus a CPU reference backend.
- 04Multiple Fiat-Shamir channels: Blake2s, Blake3, Poseidon252 and Keccak256.
- 05GKR and LogUp lookup arguments for memory and table checks.
- 06Optional Rayon-based parallel proving behind the `parallel` feature.
Use cases
- Building a zkVM or verifiable computation system on a STARK backend.
- Embedding a small STARK verifier in on-chain environments such as Solidity or Cairo contracts.
- Experimenting with Circle STARK constructions and FRI over circle domains.
- Studying reference circuits such as Poseidon2 and Blake for STARK-based proving.
Quick start
- 1
Add stwo as a Rust dependency (verifier only or with prover feature)
- 2
Build the full prover in release mode
cargo build --release --features prover - 3
Run the standard test suite
cargo test --features prover
Things to know
- Requires Rust nightly, pinned in rust-toolchain.toml.
- Full prover performance needs AVX2, AVX-512, or NEON CPU support.
- Development is moving to a new repository starting July 2026.
Topics
FAQ
- What is stwo?
- A Rust implementation of Circle STARK proving and verification over the M31 field, with a no_std verifier and SIMD prover backend. Stwo is a Circle STARK prover and verifier written in Rust. It runs the proof system over the Mersenne prime field M31 (2^31 − 1), which allows 32-bit modular arithmetic that maps onto SIMD lanes such as AVX2, AVX-512, NEON and WebAssembly SIMD. The library includes the M31, CM31 and QM31 field tower, circle FFT, a FRI variant for the circle domain, lifted Merkle commitments, and several Fiat-Shamir channels including Blake2s, Blake3, Poseidon252 and Keccak256.
- Is stwo free to use? What license does it have?
- stwo is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is stwo still maintained?
- Actively maintained. The last commit to stwo was on Nov 5, 2026.
- What can I use stwo for?
- Building a zkVM or verifiable computation system on a STARK backend. Embedding a small STARK verifier in on-chain environments such as Solidity or Cairo contracts. Experimenting with Circle STARK constructions and FRI over circle domains. Studying reference circuits such as Poseidon2 and Blake for STARK-based proving.
- How do I install stwo?
- Add stwo as a Rust dependency (verifier only or with prover feature) Build the full prover in release mode: cargo build --release --features prover Run the standard test suite: cargo test --features prover
- Where can I get stwo?
- The source code and installation instructions are on GitHub: https://github.com/starkware-libs/stwo
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
A decentralized operating system and node software that runs the Aleo network for zero-knowledge applications.
JavaScript and WebAssembly library for generating and verifying zkSNARK proofs with Groth16, PLONK and FFLONK, used with circom circuits.
Formally verified Ethereum primitives written in Lean, meant as a shared library of specifications and proofs for Lean projects.
TypeScript framework for writing zero-knowledge circuits and zkApps, with proving and verifying in browsers, Node, or for the Mina Protocol.
A self-hosted, one-time encrypted web app for sharing passwords and secrets without a database setup.