Introducing Circom 0.5 : a big step towards writing production ready zk-snark circuits

Posted by Sacha Saint-Leger on March 27, 2020

We’re excited to announce the release of a new circom library – circom v0.5 . This release marks a big step towards writing production ready circuits.

The main improvements are:

Faster compilation times

Wasm and C++ witness code generation

Witness computation speed improvements

The ability to work with any curve

The ability to compile bigger circuits

Additional benefits include parallelizable C++ witness generation code, and a modular design that makes it easy to use other languages (such as Rust or Go) to generate the witness (not just Wasm and C++).

As part of this release. we’ve also open sourced a set of very fast finite field libraries: ffjavascript , ffwasm , and ffiasm .

Checkout our updated tutorial to jump straight in.

Finite field libraries

To help optimize our witness computation code, we’ve written a set of libraries – ffjavascript , ffwasm , and ffiasm – that make it easy to work with finite fields.

Some details: each library has a special module to work with small numbers, handles positive and negatives, and has the ability to mix the normal format with Montgomery format to speed up multiplication.

In order to optimize as much as possible, ffiasm has been written in intel assembly. And while we haven’t carried out any benchmark tests yet, we can assure you – it’s fast :)

With a preliminary benchmark test we carried out with a single core of Jordi’s laptop – 3.1GHZ with four cores – we managed 43 million Montgomery operations per second (in a 256 bit field).

Upcoming Circom 1.0 spec

In parallel with circom v0.5 , we’ve been hard at work with Universidad Complutense de Madrid on the formal specification of circom v1.0 . This has been possible thanks to a grant from the Ethereum Foundation.

We plan on releasing it later on this month and opening it up to the community for feedback.

ZkSummit

Jordi will be giving a hands-on introduction to Circom v0.5 at the zkSummit conference on tuesday. If you’re attending (virtually), be sure to catch him!

Summary

In sum, this is a big step forward for circom. We are moving from a proof-of-concept to a production ready library.

Onwards and upwards 🚀.