eczkp - A Library for Zero Knowledge Proofs using Elliptic Curves
eczkp is a Rust library that implements zero-knowledge proofs (ZKP) using elliptic curve cryptography.
It enables one party (the prover) to prove knowledge of a secret without revealing it, while the other party (the verifier)
can verify the proof without learning the secret.
Currently, eczkp supports the following ZKP protocols:
- Schnorr ZKP prtocol
Features
- Prover and Verifier: Provides easy-to-use abstractions for both the prover and verifier roles in a ZKP protocol.
- Elliptic Curve Support: Leverages elliptic curve cryptography via the
elliptic_curvecrate, making the protocol secure and efficient. - Commitment, Challenge, Answer: Implements all necessary cryptographic constructs for a standard ZKP.
- Secure Memory Handling: Uses the
zeroizecrate to ensure secret data (such as private keys and nonces) is securely wiped from memory after use. - Random Nonce and Challenge Generation: Secure generation of nonces and challenges using cryptographic random number generators.
Getting Started
Installation
Add the following to your Cargo.toml file:
[]
= "0.1.1"
Example Usage
Below is a simple example showing how to use eczkp to perform a zero-knowledge proof.
use ;
use ;
use SecretKey;
use OsRng;
use NistP256;
API Documentation
For more details about the API, please refer to the RustDoc documentation.
How It Works
In a typical ZKP protocol:
- Prover generates a commitment based on a random nonce.
- Verifier sends a challenge.
- Prover computes the response to the challenge without revealing their secret.
- Verifier checks the response against the challenge to verify the prover's knowledge.
This library implements the above using elliptic curve cryptography, providing safe and efficient abstractions for both the prover and verifier.
Crate Dependencies
elliptic_curve: Provides elliptic curve cryptographic operations.zeroize: Ensures that sensitive data is securely wiped from memory after use.rand_core: Provides traits for secure random number generators.
License
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request if you find any bugs or want to propose features.
Acknowledgments
- Thanks to the developers of
elliptic_curve,zeroizeandrand_corefor providing the core libraries this project is built on.
Feel free to reach out for any help or questions!