Expand description
Threshold ECDSA for distributed signature generation.
This module implements a threshold ECDSA signature scheme where a group of n signers can jointly generate an ECDSA-style signature with only t signers participating (t-of-n threshold).
§Protocol Overview
- Setup: Distributed key generation to create key shares
- Signing Round 1: Each signer generates nonce shares
- Signing Round 2: Combine nonces and create partial signatures
- Aggregation: Combine partial signatures into final signature
§Example
use chie_crypto::threshold_ecdsa::*;
// Create a 2-of-3 threshold ECDSA setup
let threshold = 2;
let total = 3;
// Generate threshold key shares (in practice, use DKG)
let (group_pubkey, key_shares) = generate_threshold_keys(threshold, total).unwrap();
// Create signers from shares
let signer1 = ThresholdEcdsaSigner::from_share(threshold, total, key_shares[0].1.clone(), key_shares[0].2);
let signer2 = ThresholdEcdsaSigner::from_share(threshold, total, key_shares[1].1.clone(), key_shares[1].2);
let signer3 = ThresholdEcdsaSigner::from_share(threshold, total, key_shares[2].1.clone(), key_shares[2].2);
let message = b"Threshold ECDSA test";
// Signing Round 1: Generate nonce shares (only 2 signers participate)
let nonce1 = signer1.generate_nonce_share();
let nonce2 = signer2.generate_nonce_share();
let nonce_shares = vec![nonce1.public(), nonce2.public()];
let signer_ids = vec![1, 2];
// Signing Round 2: Create partial signatures
let partial1 = signer1.partial_sign(message, &nonce1, &nonce_shares, &signer_ids).unwrap();
let partial2 = signer2.partial_sign(message, &nonce2, &nonce_shares, &signer_ids).unwrap();
// Aggregate signatures
let signature = aggregate_threshold_signatures(&[partial1, partial2], &nonce_shares).unwrap();
// Verify
assert!(verify_threshold_ecdsa(&group_pubkey, message, &signature));Structs§
- Nonce
Share - Nonce share (ephemeral key for signing)
- Public
Nonce Share - Public nonce share
- Public
Share - Public key share
- Secret
Share - Secret share for a threshold ECDSA signer
- Threshold
Ecdsa Signature - Final threshold ECDSA signature
- Threshold
Ecdsa Signer - Threshold ECDSA signer
- Threshold
Partial Signature - Partial signature from a signer
Enums§
Functions§
- aggregate_
threshold_ public_ key - Aggregate public key shares into group public key
- aggregate_
threshold_ signatures - Aggregate partial signatures into final signature
- generate_
threshold_ keys - Generate threshold key shares using polynomial secret sharing
- verify_
threshold_ ecdsa - Verify a threshold ECDSA signature
Type Aliases§
- Threshold
Ecdsa Result - Threshold
KeyShares - Type alias for threshold key generation result: (group_pubkey, key_shares)