Skip to main content

Module consensus

Module consensus 

Source
Expand description

Ringtail Consensus Integration for ZAP

Implements threshold lattice-based signing compatible with the Ringtail protocol. Uses ML-DSA (FIPS 204) lattice cryptography for post-quantum security.

§Protocol Overview

Ringtail is a threshold signature scheme based on lattice cryptography:

  • Round 1: Parties generate commitment matrices D and MACs
  • Round 2: Verify MACs, compute response shares z_i
  • Finalize: Combiner aggregates shares into final signature (c, z, Delta)

§Example

use zap::consensus::{RingtailConsensus, AgentConsensus};

// Create threshold signing party
let mut party = RingtailConsensus::new(0, 3, 2); // party 0 of 3, threshold 2
party.connect_peers(vec!["peer1:9999".into(), "peer2:9999".into()]).await?;

// Sign a message
let round1 = party.sign_round1(b"message").await?;
// ... exchange with other parties ...
let round2 = party.sign_round2(vec![round1, peer1_r1, peer2_r1]).await?;
// ... combiner finalizes ...
let sig = party.finalize(vec![round2, peer1_r2, peer2_r2]).await?;

Structs§

AgentConsensus
Simplified agent consensus for response voting
PeerConnection
Connection to a peer party
Poly
Ring polynomial represented as coefficients mod Q
QueryState
Query state for agent consensus voting
RingtailConsensus
Ringtail-compatible consensus for ZAP agents
RingtailSignature
Ringtail threshold signature
Round1Output
Round 1 output from a party
Round2Output
Round 2 output from a party

Constants§

COMBINER_ID
Combiner party ID
DBAR
Commitment dimension Dbar
DEFAULT_PARTIES
Default number of parties
DEFAULT_THRESHOLD
Default threshold for 3-of-3 signing
KAPPA
Challenge weight (Hamming weight of challenge polynomial)
KEY_SIZE
Key size in bytes (256 bits)
LOG_N
Log of ring dimension
M
Matrix dimension M (rows)
N
Matrix dimension N (columns)
NU
Rounding parameter Nu
PHI
Ring dimension (2^LOG_N)
Q
Prime modulus Q (48-bit NTT-friendly)
XI
Rounding parameter Xi

Type Aliases§

PolyMatrix
Matrix of ring polynomials
PolyVector
Vector of ring polynomials