Expand description
Aggregate signatures for multi-peer coordination in CHIE protocol.
This module provides signature aggregation capabilities, allowing multiple peers to sign a message and combine their signatures into a compact representation.
§Features
- Aggregate multiple signatures from different signers
- Batch verification of aggregated signatures
- Compact representation for network efficiency
- Built on Ed25519 for compatibility with existing infrastructure
§Example
use chie_crypto::aggregate::{AggregateSignature, SignatureAggregator};
use chie_crypto::KeyPair;
// Multiple peers sign the same message
let message = b"bandwidth proof for chunk 123";
let keypair1 = KeyPair::generate();
let keypair2 = KeyPair::generate();
let keypair3 = KeyPair::generate();
let sig1 = keypair1.sign(message);
let sig2 = keypair2.sign(message);
let sig3 = keypair3.sign(message);
// Aggregate signatures
let mut aggregator = SignatureAggregator::new();
aggregator.add_signature(&keypair1.public_key(), &sig1);
aggregator.add_signature(&keypair2.public_key(), &sig2);
aggregator.add_signature(&keypair3.public_key(), &sig3);
let aggregate = aggregator.finalize(message).unwrap();
// Verify all signatures at once
assert!(aggregate.verify(message).is_ok());Structs§
- Aggregate
Signature - Aggregate signature containing multiple signatures and their public keys.
- Signature
Aggregator - Builder for creating aggregate signatures.
Enums§
- Aggregate
Error - Errors that can occur with aggregate signatures.
Functions§
- verify_
batch - Verify a batch of signatures from different signers on the same message.
Type Aliases§
- Aggregate
Result - Signature
- Type alias for signature in aggregate context.