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§
- Agent
Consensus - Simplified agent consensus for response voting
- Peer
Connection - Connection to a peer party
- Poly
- Ring polynomial represented as coefficients mod Q
- Query
State - Query state for agent consensus voting
- Ringtail
Consensus - Ringtail-compatible consensus for ZAP agents
- Ringtail
Signature - Ringtail threshold signature
- Round1
Output - Round 1 output from a party
- Round2
Output - 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§
- Poly
Matrix - Matrix of ring polynomials
- Poly
Vector - Vector of ring polynomials