Skip to content

starkware-libs/stwo

Repository files navigation

Stwo

⚠️ Work in Progress

Stwo is currently under active development and is not recommended for production use.

Table of Contents

🌟 About

Stwo is a next-generation implementation of a Circle STARK (CSTARK) prover and verifier framework, written in Rust 🦀. While it includes example implementations for demonstration purposes, the primary purpose of this repository is to serve as a foundational framework for building more complex, production-grade provers.

The framework provides a high-performance, flexible foundation for generating and verifying STARK proofs using the latest cryptographic research and innovations in STARK proof systems. It is designed to be extended and customized for specific use cases beyond the simple examples included in this repository.

🚀 Key Features

  • Circle STARKs: Implementation based on the latest cryptographic research and innovations in STARK proof systems
  • High Performance: Designed for extreme speed and efficiency with optimized SIMD operations

🛠️ Getting Started

Prerequisites

  • Rust Toolchain: This project requires Rust nightly (see rust-toolchain.toml for the specific version)

Building

Clone the repository and build the project:

git clone https://github.com/starkware-libs/stwo.git
cd stwo
cargo build --release

Running Examples

The project includes example implementations in the crates/examples directory:

# Run examples
cargo run --release --example <example_name>

📁 Project Structure

This is a Rust workspace containing multiple crates:

  • crates/stwo - Core library implementing the Circle STARK prover and verifier
  • crates/constraint-framework - Framework for expressing and evaluating constraints
  • crates/air-utils - Utilities for working with Arithmetic Intermediate Representation (AIR)
  • crates/air-utils-derive - Derive macros for AIR utilities
  • crates/examples - Example implementations demonstrating basic usage
  • crates/std-shims - Standard library shims for no_std compatibility

🌍 Real-World Applications

While the examples in this repository demonstrate basic usage patterns, Stwo is designed as a framework for building sophisticated provers that handle complex real-world scenarios. A prominent example of such an application is:

stwo-cairo is a production-oriented prover built on top of the Stwo framework that enables proving Cairo program executions.

📊 Benchmarks

Quick Benchmark

Run a single-threaded Poseidon2 hash proof benchmark:

./poseidon_benchmark.sh

Comprehensive Benchmarks

Run all benchmarks using Cargo:

cargo bench

Benchmark Reports

Visual representation of benchmark results can be found at: https://starkware-libs.github.io/stwo/dev/bench/index.html

📜 License

This project is licensed under the Apache License 2.0.

See the LICENSE file for more information.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 31