Module rangeproof

Module rangeproof 

Source
Expand description

Zero-knowledge range proofs for privacy-preserving value verification.

This module provides simplified range proofs that allow proving a value is within a certain range without revealing the exact value. This is useful for:

  • Privacy-preserving bandwidth proof amounts
  • Proving rewards are within valid ranges
  • Stake verification without revealing exact amounts

§Example

use chie_crypto::rangeproof::RangeProof;
use chie_crypto::KeyPair;

// Prove that bandwidth used is between 0 and 1000 MB
let keypair = KeyPair::generate();
let bandwidth_mb = 750u64; // Actual value (private)
let max_value = 1000u64;   // Range: 0..=max_value

// Generate proof
let proof = RangeProof::prove(&keypair.secret_key(), bandwidth_mb, max_value).unwrap();

// Verify without revealing exact bandwidth
assert!(proof.verify(&keypair.public_key(), max_value));

Structs§

BatchRangeProof
Batch range proof for multiple values.
RangeProof
A simplified zero-knowledge range proof.

Enums§

RangeProofError
Range proof error types.

Type Aliases§

RangeProofResult