ZK/SEC Research notes from zkSecurity
All posts
tools · zk

Stone CLI: Making Cairo programming more accessible

Introduction

We are pleased to announce that after working for months with the StarkWare team, we are finally launching the Stone CLI, a tool for easily proving and verifying Cairo programs! Huge thanks to the StarkWare team for their work and guidance as well as the Lambdaclass and Herodotus teams for building the infrastructure that makes this possible.

Motivation

Currently, the Cairo ecosystem is fragmented in that there are multiple tools for compiling, running, proving, and verifying Cairo programs. Beginners are often confused about which tool to use for a given task and end up spending too much time figuring out the optimal toolchain for their needs. The Stone CLI aims to bring a large part of the process into one simple tool. Below is an overview of the components that the CLI brings together:

Stone CLI Components

Features

Proving

Cairo programs need to be compiled to Cairo Assembly (CASM) before they can be run by the VM and proven. Cairo 0 programs are different from Cairo 1 programs in that they are compiled directly to CASM, while Cairo 1 programs need to be compiled first to an intermediate representation called Sierra and then compiled to CASM. Most of the time, Cairo 1 programs will be used. (Please see the Cairo book for more details on programming in Cairo 1.)

After the program is compiled to CASM, it needs to be run by the Cairo VM to generate the memory and trace outputs. These outputs are then parsed to make the public and private inputs for creating a proof.

The generated public and private inputs will be used as input for the Stone prover, which will create a Cairo proof.

A Cairo proof is essentially a proof that a certain program was run with certain inputs and produced certain outputs. For example, a Fibonacci sequence program that computes the nth Fibonacci number may take 10 as input and produce 55 as output. As long as the verification process is correct, one can be assured that the 10th Fibonacci number is 55 without having to run the program themselves.

Verifying

The CLI supports verifying on 3 different verifiers: Stone verifier in C++, Starknet verifier in Cairo, and Ethereum verifier in Solidity.

Using the Stone verifier is straightforward using the CLI and it is mainly used locally for testing purposes. The more interesting verifiers are the ones deployed on Starknet and Ethereum since both on-chain verifiers allow the output of the program to be registered as "facts" that smart contracts can rely on as verified data.

Serializing proofs

In order to use those verifiers, however, one needs to interact with the contracts deployed on-chain, and the CLI does not support such infrastructure. Instead, it serializes the proof into a format that is compatible with the on-chain verifier. Note that in this process the proof is often split into multiple files since the entire proof usually does not fit inside the calldata limits of a single transaction.

Proving with the bootloader

For the Ethereum verifier, there is an additional specific requirement: the proof needs to be generated using a specific Cairo program named the "bootloader". The bootloader program allows one to efficiently run multiple Cairo programs by creating a proof size smaller than (see more details in the STARK book). Since only the bootloader program is supported by the Ethereum verifier, the CLI provides an easy way to generate bootloader proofs via the prove-bootloader command.

What's next?

Since the Starknet ecosystem is constantly evolving, we will continue to update the CLI to support new features and infrastructure. If you want to contribute to the repo or request additional features, please let us know on GitHub!

Keep reading
More to explore

Optimizing Barrett Reduction: Tighter Bounds Eliminate Redundant Subtractions

In this blog post, we explore an optimization for Barrett reduction, a popular method for modular arithmetic. We discovered that the error bound can be tighter than traditionally thought, meaning you often only need a single subtraction instead of two. This tweak can speed up cryptographic operations like those in the RustCrypto library by 14% when applied to NIST curves, which is a game changer for both encryption and performance. Dive into the details to see how this simple change can lead to significant improvements in real-world applications!

Suneal Gong · May 01, 2025

Nine Years to Halve a Hash Function: RFC 9861 Is Out

After nearly a decade in the making, RFC 9861: KangarooTwelve and TurboSHAKE was officially published in October 2025, with zkSecurity among its editors. This post explains why these hash functions deserve to be far more widely used than they are today. Built on the same Keccak permutation as SHA-3 and SHAKE but with the round count halved, they do the same job at the same security level roughly twice as fast. We cover why halving the rounds is safe, what the RFC actually defines, the caveats around FIPS compliance and workload-dependent speedups, and why a standard like this took nine years to land.

David Wong · July 21, 2026

Public report of Aleo's synthesizer

We were tasked with auditing Aleo's synthesizer for their blockchain, diving deep into its code and uncovering some important findings along the way. The synthesizer is crucial for deploying and executing user programs, utilizing zero-knowledge proofs to maintain privacy and efficiency. Readers will get a glimpse into how Aleo uses their Leo programming language, the intricate process of synthesizing proof circuits, and how function execution and program deployment flows occur on their platform. This post offers insights into Aleo’s unique approach to tackling challenges similar to those faced by Ethereum but with an innovative twist that includes privacy features and reduced costs.

ZK/SEC · January 02, 2024