A Cryptography and Zero Knowledge Proof Research Repo Implementing Research papers, Cryptographic primitives, trying out imaginary exploits and so on.
research-implementation/
│
├── primitives/
│ ├── polynomial/
│ ├── arithmetic circuit/
│ └── SHA256 hash function/
|
├── protocol implementation (piop)/
│ ├── GKR
│ ├── Groth16
│ ├── Plonk
│ ├── Succinct GRK (using KZG as the PCS)
│ ├── Sum Check Protocol
│ ├── Schnorr Digital Signature
│ ├── NON-Interactive Chaum Pederson zero-knowledge proof
│ ├── Fiat Shamir
│ ├── Interactive Chaum Pederson zero-knowledge proof
│ └── ECDSA
|
├── polynomial commitment scheme (pcs)/
│ ├── KZG polynomial commitment scheme
│ ├── univariate poly/
| ├── univariate batch/
│ └── multilinear poly/
│ ├── FRI
│ └── ~
|
├── projects/
│ ├── KZG airdrop over bn254 Elliptic curve
│ ├── Light tornado cash (powered by Groth16)
│ ├── Verifiable Random Function (VRF)
│ ├── BLS Multi Sign Threshold Wallet (Powered by Shimir secret sharing protocol)
│ └── Circom Groth16
These are a collection of cryptographic primitives and toolkits that I have implemented in Rust. They are designed to be modular, efficient, and easy to use. The goal is to provide a solid foundation for building secure, succinct, and privacy-preserving applications.
This is a library for creating and manipulating circuits. The library is designed to be modular and extensible. The library is designed to be used in the context of snarks, but can be used for any type of circuit.
Features
- Arithmetic Circuit representation
- Boolean Circuit representation
- Circuit evaluation
- Circuit optimization
- Arithmetic Circuit to R1CS conversion
- GKR
Add
andMul
Multilinear Extension (MLE)
This is the implementation of a polynomial in Rust. The Polynomial struct allows you to create a polynomial, evaluate it at a specific point, and add or multiply two polynomials together.
The variations of polynomials built in here are;
- Univariate Polynomial
- Multivariate Polynomial
- Multilinear Polynomial
... the last two could give a man 2^N complexity nightmare :).
In the realm of cybersecurity, ensuring data integrity and authenticity is paramount. Cryptographic hash functions play a vital role in achieving this objective. One of the most widely employed and trusted algorithms in this domain is SHA-256 (Secure Hash Algorithm 256-bit). This introduction will delve into the concept of SHA-256, outlining its functionalities, key characteristics, and the prevalent applications that leverage its capabilities.
Features
- Technical paper explanation
- Operation implementation
- Complete hash function implementation
These are implementations of cryptographic protocols that I have implemented in Rust. These protocols are built using the primitives and toolkits mentioned above as building blocks. These implementations follows research papers and are designed to be efficient, secure, and easy to use, But with the primary purpose of research and education.
The GKR protocol is fascinating, fairly not as complicated as other protocols but heavily generic and useful. The GKR protocol involves running one protocol (Sum check) inside this protocol (GKR). The GKR protocol, named after Shafi Goldwasser, Yael Tauman Kalai, and Guy N. Rothblum, is a zero-knowledge proof protocol that focuses on efficient delegation of computation. Specifically, it is designed to verify computations represented as layered arithmetic circuits with logarithmic depth in the number of inputs. The GKR protocol is known for its efficiency and ability to handle large-scale computations.
Features
- In Progress
The Groth16 protocol is a highly efficient zero-knowledge succinct non-interactive argument of knowledge (zk-SNARK) for general arithmetic circuit satisfiability. It was introduced by Jens Groth in 2016 and is notable for its concise proofs and efficient verification.
Features
- Circuit Pre-processing
- Trusted Setup
- Prover
- Verifer
PLONK (Permutation Argument for Generalized Proofs of Knowledge) is a zero-knowledge proof (ZKP) protocol that allows one to prove the correctness of a computation without revealing its internal data. Developed as a universal and efficient ZKP system, PLONK offers several key features that make it popular in cryptographic applications like blockchain.
Features
- Circuit Pre-processing
- GRK circuit to PLONKISH transpiler
- Trusted Setup (KZG)
- Prover
- Verifer
- Solidty Verifer Example
This library provides an implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA) in Rust. It allows you to:
Features
- Generate ECDSA keypairs (private and public keys)
- Sign messages using a private key
- Verify signatures using a public key
This is a RUST implementation of the Kate Commitments (KZG) polynomial commitment scheme. KZG allows you to commit to a polynomial while keeping the contents hidden.
Features
- Univariate Polynomial Commitment
- Creates KZG parameters for a given degree.
- Commits to a polynomial of a specified degree.
- Opens a commitment at a specific point, revealing the evaluated value and proof.
- Verifies the opening proof for a commitment.
- [] Open and Verifer bacth on single polynomial multiple points.
- Multilinear Polynomial Commitment
- Creates KZG parameters for a given number of variables.
- Commits to a polynomial of a specified number of variables.
- Opens a commitment at a specific point, revealing the evaluated value and proof.
- Verifies the opening proof for a commitment.
The Chaum-Pedersen Zero-Knowledge Proof (ZKP) protocol allows a prover to convince a verifier that they possess a secret value (knowledge) without revealing the actual value itself. It operates in an interactive setting, meaning the prover and verifier exchange messages back and forth.
Features
- Interactive proof generation and verification.
The standard Chaum-Pedersen protocol is interactive, but it can be converted into a non-interactive version using the Fiat-Shamir heuristic. This transformation removes the need for real-time interaction:
Features
- Non-interactive proof generation
- Non-interactive proof verification
A Schnorr signature is a digital signature produced by the Schnorr signature algorithm, which Claus Schnorr described. It’s known for its simplicity and efficiency.
Features
- Generate Schnorr keypairs (private and public keys)
- Sign messages using a private key
- Verify signatures using a public key
Suppose we are given a v-variate polynomial g
defined over a finite field F
.
The purpose of the sum-check protocol is for the prover to provide the verifier with the sum of evaluations over the boolean hypercube.
Features
- Technical documentation
- library implementation
- library test implementation
The Fiat-Shamir transcript is a cryptographic technique used to transform an interactive proof system into a non-interactive one. This transformation enhances the efficiency and practicality of certain cryptographic protocols, including zero-knowledge proofs, by eliminating the need for interaction between the prover and the verifier.
Features
- Externally adadptable interface
- Transcript implementation
These are zk, cryptographic and blockchain projects that I have implemented in Rust and other tools. These projects builds on the primitives, toolkits, protocols mentioned above and other amazing projects built by great minds in the field of cryptography and zero-knowledge proofs.
This is a RUST implementation of the KZG commitment scheme over the bn254 elliptic curve. Using this implementation to perform a token airdrop distribution using instead of using the regular Merkle tree
commitment scheme.
Features
- Toolkit for data preparation and formatting.
- Trusted setup importation and implementation.
- Massive proof generation script (Still needs optimization)
- Rust proof verification
- Solidity proof verification
In the realm of blockchain technology, privacy remains a crucial aspect. This research project delves into a lightweight implementation inspired by the core concepts of cryptocurrency mixers. Our goal is to explore anonymity-enhancing techniques for crypto transactions while adhering to legal and ethical frameworks.
Features
- Circom Circuit (Main Circuit and Hash functions)
- Solidity Interface and Verification smart contract
- Basic UI
A Verifiable Random Function (VRF) is a cryptographic primitive that provides a way to generate a random output that can be publicly verified as having been produced by a specific input and a specific secret key. It combines the properties of a hash function with those of a digital signature.
Features
- Rust implementaion of VRS
- Solidity binding interface
This is a mini project, using the Shamir Secret Sharing Scheme lib. This project would share the private key to an account among many other entities and a chosen number of these entities can come together to recompute this initial private key.
Features
- Binding Lib
- Script for secret sharing
This is a experimental project aiming to prove and verify a circom circuit using the Groth16 implemenation done in this reasearch project.
Features
- Circom circuit
- Circom intermediate representation binding
- Groth16 implementation (Prove and Vefier)
This is a experimental project aiming to using the GKR protocol with Multilinear poloynomial commitment scheme to create a SNARK.
Features
- Circuit Representation
- Prover function
- Verifier function
This sections contains reasearch papers and study note that I have written on various topics in cryptography and zero-knowledge proofs.
NOTE: THIS IS NOT TO BE USED IN PRODUCTION. THIS IS A RESEARCH PROJECT.