Module bls

Module bls 

Source
Expand description

BLS (Boneh-Lynn-Shacham) Signatures for efficient signature aggregation.

BLS signatures provide superior aggregation properties compared to Ed25519:

  • N signatures from N different signers aggregate into a single signature
  • Aggregated signature is the same size as individual signatures
  • Efficient batch verification of aggregated signatures
  • Ideal for multi-peer coordination in CHIE protocol

§Example

use chie_crypto::bls::{BlsKeypair, aggregate_signatures, verify_aggregated};

// Generate keypairs for multiple signers
let keypair1 = BlsKeypair::generate();
let keypair2 = BlsKeypair::generate();
let keypair3 = BlsKeypair::generate();

let message = b"Hello, CHIE Protocol!";

// Each signer signs the same message
let sig1 = keypair1.sign(message);
let sig2 = keypair2.sign(message);
let sig3 = keypair3.sign(message);

// Aggregate signatures into a single signature
let aggregated = aggregate_signatures(&[sig1, sig2, sig3]).unwrap();

// Verify the aggregated signature against all public keys
let public_keys = vec![
    keypair1.public_key(),
    keypair2.public_key(),
    keypair3.public_key(),
];

assert!(verify_aggregated(&public_keys, message, &aggregated).is_ok());

Structs§

BlsKeypair
BLS keypair (secret key + public key)
BlsPublicKey
BLS public key (point in the Ristretto group)
BlsSecretKey
BLS secret key (scalar in the Ristretto group)
BlsSignature
BLS signature (point in the Ristretto group)

Enums§

BlsError
BLS signature error types

Functions§

aggregate_signatures
Aggregate multiple BLS signatures into a single signature
verify
Verify a BLS signature against a public key and message
verify_aggregated
Verify an aggregated BLS signature against multiple public keys and a single message
verify_aggregated_different_messages
Verify an aggregated BLS signature where each signer signed a different message

Type Aliases§

BlsResult