Module polycommit

Module polycommit 

Source
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(&params, &coefficients).unwrap();

// Prove evaluation at x=5
let eval_point = Scalar::from(5u64);
let proof = prove_evaluation(&params, &coefficients, &blinding, eval_point).unwrap();

// Verify the proof
assert!(verify_evaluation(&params, &commitment, eval_point, &proof).is_ok());

Structs§

BatchEvaluationProof
Batch evaluation proof for multiple points.
EvaluationProof
Proof of polynomial evaluation at a specific point.
PolyBlinding
Blinding factor for a polynomial commitment.
PolyCommitParams
Parameters for polynomial commitments.
PolyCommitment
A commitment to a polynomial.

Enums§

PolyCommitError
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.

Type Aliases§

PolyCommitResult