Stwo Prover: The next-gen of STARK scaling is here
Published on: February 29, 2024

Stwo Prover: The next-gen of STARK scaling is here

TL;DR 

  • StarkWare is developing a new blazing-fast prover: Stwo.
  • Stwo will implement the groundbreaking Circle STARK, which will unlock the efficient prime field M31.
  • Stwo will be open-sourced from day one under Apache 2.0.
  • In time, systems benefitting from Stone prover, including public Starknet and Starknet appchains, will benefit from Stwo.

Unlocking the next phase of STARKs

The next generation of STARK proofs is here! To avoid a barrage of unsolicited information, we’ll go for an overview with some fancy words peppered throughout. We invite you to go link-hopping and window-shopping!

High level for non-math folks

The future of STARK-scaling is coming. On the theoretical front, joint research with the Polygon Labs team culminated in a groundbreaking mathematical innovation: the Circle STARK protocol. On the applied front, StarkWare is developing a new blazing-fast open-source prover: Stwo. Stwo will implement the new Circle STARK protocol alongside various other optimizations. It will unlock the full potential of the extremely efficient prime field M31 for the benefit of everyone in the zk-proof and blockchain spaces.

Deep dive for math folks

The classical STARK protocol requires an algebraic structure for its constituent steps. Chiefly, it requires a prime field of size p so that p-1 is divisible by a large power of two. Why? To facilitate two core parts of the STARK protocol: FFT and FRI. This is all nice and good, but such a constraint rules out many fields of smaller size that are otherwise very well-suited to efficient computation. Specifically, it rules out the very efficient Mersenne prime field M31 (with p=231-1) because p-1=2(230-1) is not even divisible by 4. Thus we are at an impasse: the classical STARK protocol does not mix with M31.

Before we proceed, a quick digression. A few years ago, we stumbled upon a similar problem, albeit with a different motivation. We wanted to adapt the STARK protocol for two cryptographic mainstream curves: secp256k1 and secp256r1. Each of these uses a different prime, neither of which satisfies the constraint of the above paragraph. To circumvent this problem, we came up with the ECFFT paper that uses elliptic curves to provide an alternative source of structure for FFT and FRI. This research detailed machinery for adapting STARKs to pretty much any field you can think of.

Back to our story. The desire to adapt the classical STARK protocol for M31 led to a fertile collaboration with the Polygon Labs team, culminating in Circle STARK: a compact, elegant protocol that avoids the heavy machinery of ECFFT paper. In a nutshell: when p+1 is divisible by a large power of two, as is the case with M31, the circle curve over the prime field furnishes the structure necessary to adapt both FFT and FRI. The remaining details – of which there are plenty – are lucidly worked out in the paper.

Next-gen open-source prover: Stwo

The shiny new math isn’t just for show though. It comes with a blazing-fast open-source prover that will leverage Circle STARKs, and various other optimizations, to bring unprecedented proving performance.

What is the name of this mythical creature, you ask? The first generation is Stone, so the second generation can only be Stwo! (pronounced “Stoo”). Now, what do you get out of it?

That depends on who you are.

Users and builders will benefit from next-level scaling. The zk-proof and blockchain spaces will benefit from having an open-source implementation of the most advanced STARK technology! Since the first implementation of STARK-based scaling technology (launched in June 2020 with StarkEx), many protocols have moved to develop STARK-based scaling solutions. Anyone interested in diving into these fascinating fields (pun intended) – whether to learn about or to use STARKs for whatever purpose – will have the best tool at their disposal.

What about systems that are or will be based on Stone, namely Starknet and appchains that may launch around it? Not a problem. Developers will not be impacted at all because high-level Cairo will be completely compatible with Stwo. When the time comes, and Stwo is ready to be rolled out, the Starknet ecosystem – namely users and developers – will benefit from Stwo’s next level of scaling without having to do anything at all!  Stwo will be compatible with high level Cairo code in which contracts are written, and also with Sierra. The Starknet prover(s), currently based on Stone, will employ it. Users/builders/dapps will reap its benefits both in terms of latency and fees. 

Summary

Stwo is the future of scaling! It will leverage the mathematical leap that blew the minds of math lovers  – Circle STARKs – to the benefit of the Starknet ecosystem. 

The blazing-fast, open-source Stwo prover will empower Starknet developers with an optimized proving experience on all fronts. And, yes, that will translate into faster and cheaper transactions for users.

Builders, don’t wait – start building on Starknet today so you can benefit from the supercharged scalability Stwo will offer once it is available.

Stwo will be open-sourced from day one under Apache 2.0. Be sure to follow its development here.

ON THIS PAGE

Contact us