Skip to content
Akinbola0xKENZMAN
Work/Privacy & cryptography
AI & Data

Pedersen commitments

Hiding, binding commitments over Ristretto255, with homomorphic addition.

Role
Sole author
When
Mar 2026 – now
Team
Solo
Stack
Rust, curve25519-dalek, SHA-512

Overview

Commit to a value m by publishing C = m·G + r·H with a random blinding factor r. H is derived by hash-to-curve from a domain-separation string, so nobody knows its discrete log relative to G. Commitments add: the sum commits to the sum of values.

The code

impl PedersenParams {
    pub fn new() -> Self {
        let g = curve25519_dalek::constants::RISTRETTO_BASEPOINT_POINT;
        let hash: [u8; 64] = Sha512::digest(b"pedersen-commitment-h-generator-v1").into();
        let h = RistrettoPoint::from_uniform_bytes(&hash);
        PedersenParams { g, h }
    }

    pub fn commit_with_randomness(&self, value: Scalar, randomness: Scalar) -> Commitment {
        // C = m·G + r·H
        let point = value * self.g + randomness * self.h;
        Commitment { point }
    }

    pub fn verify(&self, commitment: &Commitment, opening: &Opening) -> bool {
        let expected = self.commit_with_randomness(opening.value, opening.randomness);
        expected.point == commitment.point
    }
}

impl Commitment {
    /// (m1·G + r1·H) + (m2·G + r2·H) = (m1+m2)·G + (r1+r2)·H
    pub fn add(&self, other: &Commitment) -> Commitment {
        Commitment { point: self.point + other.point }
    }
}

How it works

  1. Generators G (Ristretto basepoint) and H (hash-to-curve)
  2. Commit with fresh 512-bit randomness reduced mod the group order
  3. Open and verify, plus homomorphic add

Stack

Rustcurve25519-dalekSHA-512