$ show spaceandtimefdn/blitzar
Blitzar is a high-performance C++ library for GPU-accelerated cryptographic zero-knowledge proofs, developed by Space and Time. It provides multi-scalar multiplication (MSM), Pedersen commitments, inner product arguments, sumcheck proofs, and sequential commitments over multiple elliptic curves (Curve25519/Ristretto255, BLS12-381, BN254, Grumpkin). The library supports both CPU and CUDA GPU backends, with a stable C API and Rust bindings (blitzar-sys). It is designed for use in Space and Time's Proof of SQL, enabling analytic queries on large datasets with sub-second proof generation. The codebase is well-structured with extensive unit tests, benchmarks, and a Bazel/Nix build system. It incorporates optimized algorithms (Pippenger, bucket methods) and low-level field/curve arithmetic adopted from libsodium and zkcrypto, demonstrating strong engineering craftsmanship in GPU cryptography.
The LLM identified 5 files worth highlighting for reuse:
Provides a lightweight, coroutine-based asynchronous execution model (xena::future) for composing GPU operations. It is self-contained, uses C++20 coroutines, and can be extracted for use in other GPU or async C++ projects. Demonstrates non-obvious skill in building a minimal future/promise system without external dependencies.
Implements a generic GPU reduction kernel templated on a Reducer and Mapper, supporting arbitrary element types. It handles kernel fitting, warp/thread reduction, and is reusable across different field/curve types. This pattern is a clean abstraction for parallel reduction on GPUs.
Implements the Strobe128 transcript protocol (Merlin-style) for public-coin protocols. It is a standalone cryptographic primitive with Keccak-f[1600] permutation, suitable for use in any zero-knowledge proof system. The implementation is clean, well-tested, and can be extracted independently.
Provides a chained memory resource that delegates to multiple underlying resources, useful for tracking allocations or combining device/host pools. It is a generic allocator wrapper that can be reused in any C++ project needing custom memory management.
A Python script for checking and fixing code formatting (clang-format, buildifier, header order, copyright). It is self-contained, multi-threaded, and can be adapted for other C++/Bazel projects. Demonstrates a reusable pattern for enforcing code style in CI.