Expand description
BBS+ Signatures for selective disclosure and privacy-preserving credentials.
BBS+ is a pairing-based signature scheme that allows signing multiple messages at once and later creating zero-knowledge proofs that selectively disclose some of the signed messages while keeping others hidden.
§Features
- Multi-message signing (sign N attributes simultaneously)
- Selective disclosure (reveal only M < N attributes)
- Zero-knowledge proof of signature validity
- Unlinkable presentations (different proofs are unlinkable)
- Perfect for privacy-preserving credentials
§Use Cases in CHIE Protocol
- Creator credentials with selective attribute disclosure
- Privacy-preserving bandwidth credits (reveal amount but not identity)
- Anonymous content access with verifiable permissions
- Selective disclosure of reputation scores
§Example
use chie_crypto::bbs_plus::{BbsPlusKeypair, sign_messages, create_proof, verify_proof};
// Setup
let keypair = BbsPlusKeypair::generate(5); // Support for 5 messages
let messages = vec![
b"user_id: alice".to_vec(),
b"role: premium".to_vec(),
b"credit: 1000".to_vec(),
b"expiry: 2026-12".to_vec(),
b"tier: gold".to_vec(),
];
// Sign all messages
let signature = sign_messages(&keypair.secret_key(), &messages).unwrap();
// Create a proof that reveals only messages at indices 1 and 2 (role and credit)
let revealed_indices = vec![1, 2];
let proof = create_proof(
&keypair.public_key(),
&signature,
&messages,
&revealed_indices,
b"presentation-context",
).unwrap();
// Verifier checks the proof (only sees revealed messages)
let revealed_messages: Vec<Vec<u8>> = revealed_indices.iter()
.map(|&i| messages[i].clone())
.collect();
assert!(verify_proof(
&keypair.public_key(),
&proof,
&revealed_indices,
&revealed_messages,
b"presentation-context",
).unwrap());Structs§
- BbsPlus
Keypair - BBS+ keypair containing both secret and public keys.
- BbsPlus
Proof - Proof of knowledge for selective disclosure.
- BbsPlus
Public Key - BBS+ public key for verification.
- BbsPlus
Secret Key - BBS+ secret key for signing.
- BbsPlus
Signature - BBS+ signature on multiple messages.
Enums§
- BbsPlus
Error - Errors that can occur in BBS+ operations.
Functions§
- create_
proof - Create a selective disclosure proof revealing only specified message indices.
- sign_
messages - Sign multiple messages using BBS+ signature scheme.
- verify_
proof - Verify a selective disclosure proof.
- verify_
signature - Verify a BBS+ signature on multiple messages.