Crate sigma_rs

Source
Expand description

§Σ-rs

A Rust library for building zero-knowledge proofs using Sigma protocols (Σ-protocols). Create proofs that demonstrate knowledge of secret information without revealing it.

§What are Sigma Protocols?

Sigma protocols are interactive cryptographic protocols that allow a prover to convince a verifier they know a secret (like a private key) without revealing the secret itself. They follow a simple three-step pattern: commitment, challenge, response.

§Key Features

  • Composable: Combine multiple proofs into compound statements
  • Generic: Works with any cryptographic group supporting the required operations
  • Flexible Hashing: Multiple hash function backends for different use cases

§Basic Usage

The library provides building blocks for creating zero-knowledge proofs:

  1. Define your mathematical relation using LinearRelation
  2. Create a Sigma protocol with schnorr_protocol::SchnorrProof
  3. Convert to non-interactive using fiat_shamir::NISigmaProtocol
  4. Generate and verify proofs using the protocol interface

§Core Components

Re-exports§

pub use fiat_shamir::NISigmaProtocol;
pub use linear_relation::LinearRelation;

Modules§

codec
Encoding and decoding utilities for Fiat-Shamir and group operations.
composition
Implementation of a structure Protocol aimed at generalizing the SchnorrProof using the compositions of the latter via AND and OR links
duplex_sponge
Duplex Sponge Interface
errors
Error: Error Types for Zero-Knowledge Proofs.
fiat_shamir
Fiat-Shamir transformation for SigmaProtocols.
linear_relation
Linear Maps and Relations Handling.
schnorr_protocol
Implementation of the generic Schnorr Sigma Protocol over a Group.
serialization
Serialization and deserialization utilities for group elements and scalars.
traits
SigmaProtocol Trait.