Blitzar was created by the core cryptography team at Space and Time to accelerate Proof of SQL, a novel zero-knowledge proof for SQL operations. After surveying our options for a GPU acceleration framework, we realized that Proof of SQL needed something better… so we built Blitzar. Now, Proof of SQL runs with a 3.2 second proving time against a million-row table on a single GPU, and it’s only getting faster.
We’ve open-sourced Blitzar to provide the Web3 community with a faster and more robust framework for building GPU-accelerated ZK proofs. We’re excited to open the project to community contributions to expand the scope of Blitzar and lay the foundation for the next wave of lightning fast ZK proofs.
Blitzar-rs is a High-Level rust wrapper for the blitzar-sys crate for accelerating cryptographic zero-knowledge proof algorithms on the CPU and GPU.
Note This repo contains the high-Level rust wrapper for the blitzar-sys crate. If you are using C++, use the code from the companion repo here: https://github.com/spaceandtimelabs/blitzar.
The crate provides
- Functions for doing group operations on Curve-25519, Ristretto25519, bls12-381 G1, bn254 G1 and Grumpkin elements.
- An implementation of Inner Product Argument Protocol for producing and verifying a compact proof of the inner product of two vectors.
WARNING: This project has not undergone a security audit and is NOT ready for production use.
Although the primary goal of this library is to provide GPU acceleration for cryptographic ZK proof algorithms, the library also provides CPU support for the sake of testing. The following backends are supported:
Backend | Implementation | Target Hardware |
---|---|---|
cpu |
Serial | x86 capable CPUs |
gpu |
Parallel | Nvidia CUDA capable GPUs |
Blitzar provides an implementation of Multi-Scalar Multiplication (i.e. generalized Pedersen commitments). Mathematical details behind MSM are outlined in the Blitzar Github repository.
Note: we interchangeably use the terms "multi-scalar multiplication" and "multiexponentiation" to refer to the this operation because when the group is written additively, the operation is a multi-scalar multiplication, and when the group is written multiplicatively, the operation is a multiexponentiation.
The Blitzar implementation allows for computation of multiple, potentially different length, MSMs simultaneously. Additionally, either built-in, precomputed, generators can be used, or they can be provided as needed.
Currently, Blitzar supports Curve25519 and bls12-381 G1 as groups. We're always working to expand the curves that we support, so check back for updates.
Blitzar provides a modified implementation of an inner product argument (e.g. Bulletproofs and Halo2). Mathematical details of the modified inner product argument are outlined in the Blitzar Github repository.
If there is a particular feature that you would like to see, please reach out. Blitzar is a community-first project, and we want to hear from you.
To get a local copy up and running, consider the following steps.
GPU backend prerequisites:
- Rust 1.81
x86_64
Linux instance.- NVIDIA driver version >= 560.35.03 (check the compatibility list here).
CPU backend prerequisites:
You'll need the following requirements to run the environment:
- Rust 1.81
x86_64
Linux instance.
To add this library to your project, update your Cargo.toml
file with the following line:
[dependencies]
blitzar = <version_number>
Feature | Default? | Description |
---|---|---|
cpu |
x | Enables the CPU backend. |
gpu |
✓ | Enables the GPU Backend. |
cargo test
cargo doc --no-deps --open
Check EXAMPLES file.
Benchmarks are run using criterion.rs:
cargo bench --features <cpu | gpu>
To run individual tests:
cargo bench --features <cpu | gpu> --bench <blitzar_benchmarks | packed_msm_benchmarks>
The main branch is regularly built and tested, being the only source of truth. Tags are created regularly from automated semantic release executions.
We're excited to open Blitzar-rs to the community, but are not accepting community Pull Requests yet due to logistic reasons. However, feel free to contribute with any suggestion, idea, or bugfix on our Issues panel. Also, see contribution guide.
Join our Discord server to ask questions, discuss features, and for general chat.
This project is released under the Apache 2 License.
This repo contains the high-Level rust wrapper for the blitzar-sys crate. If you are using C++, use the code from the companion repo here: https://github.com/spaceandtimelabs/blitzar.