Crate sigma_rs

Source
Expand description

§Σ-rs: Sigma Protocols in Rust

Σ-rs is a Rust library for constructing zero-knowledge proofs using Sigma protocols (Σ-protocols). It allows proving knowledge of secret data without revealing the data itself.


§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
  • Non-Interactive Ready: Support for Fiat–Shamir transformation

§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


Σ-rs is designed to be modular, extensible, and easy to integrate into zero-knowledge applications.

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
Protocol Composition with AND/OR Logic
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
Generic interface for 3-message Sigma protocols.