Expand description
Polynomial commitments for efficient batch verification.
This module provides a polynomial commitment scheme based on Pedersen commitments. It allows committing to a polynomial and later proving evaluations at specific points without revealing the polynomial itself.
§Features
- Commit to polynomials of arbitrary degree
- Prove evaluations at specific points
- Batch verification of multiple evaluations
- Based on discrete log assumption (no pairings needed)
§Use Cases in CHIE Protocol
- Efficient chunk verification
- Batch proof of content possession
- Merkle tree alternatives for large datasets
§Example
use chie_crypto::polycommit::{PolyCommitParams, commit_polynomial, prove_evaluation, verify_evaluation};
use curve25519_dalek::scalar::Scalar;
// Setup parameters for polynomials up to degree 10
let params = PolyCommitParams::new(10);
// Commit to polynomial f(x) = 1 + 2x + 3x^2
let coefficients = vec![
Scalar::from(1u64),
Scalar::from(2u64),
Scalar::from(3u64),
];
let (commitment, blinding) = commit_polynomial(¶ms, &coefficients).unwrap();
// Prove evaluation at x=5
let eval_point = Scalar::from(5u64);
let proof = prove_evaluation(¶ms, &coefficients, &blinding, eval_point).unwrap();
// Verify the proof
assert!(verify_evaluation(¶ms, &commitment, eval_point, &proof).is_ok());Structs§
- Batch
Evaluation Proof - Batch evaluation proof for multiple points.
- Evaluation
Proof - Proof of polynomial evaluation at a specific point.
- Poly
Blinding - Blinding factor for a polynomial commitment.
- Poly
Commit Params - Parameters for polynomial commitments.
- Poly
Commitment - A commitment to a polynomial.
Enums§
- Poly
Commit Error - Polynomial commitment errors.
Functions§
- commit_
polynomial - Commit to a polynomial.
- prove_
batch_ evaluations - Prove multiple evaluations in a batch.
- prove_
evaluation - Prove evaluation of polynomial at a specific point.
- verify_
batch_ evaluations - Verify a batch of evaluation proofs.
- verify_
evaluation - Verify an evaluation proof.