| Crates.io | bls48581 |
| lib.rs | bls48581 |
| version | 2.1.0 |
| created_at | 2025-12-17 11:23:04.10544+00 |
| updated_at | 2025-12-17 11:23:04.10544+00 |
| description | BLS signature implementation using the BLS48-581 curve with KZG commitments |
| homepage | |
| repository | https://github.com/quilibriumnetwork/monorepo |
| max_upload_size | |
| id | 1989985 |
| size | 1,142,051 |
BLS signature implementation using the BLS48-581 pairing-friendly elliptic curve.
This crate provides cryptographic primitives for BLS (Boneh-Lynn-Shacham) signatures on the BLS48-581 curve, including:
Add this to your Cargo.toml:
[dependencies]
bls48581 = "2.1.0"
use bls48581::{bls_keygen, bls_sign, bls_verify};
// Initialize the library
bls48581::init();
// Generate a key pair
let keypair = bls_keygen();
// Sign a message
let message = b"Hello, World!";
let signature = bls_sign(&keypair.secret_key, message).unwrap();
// Verify the signature
let is_valid = bls_verify(&keypair.public_key, message, &signature).unwrap();
assert!(is_valid);
use bls48581::{commit, prove, verify_raw};
bls48581::init();
// Create a polynomial (as bytes)
let data = vec![1u8; 4096]; // 64 coefficients * 64 bytes each
let poly_size = 64;
// Generate commitment
let commitment = commit(&data, poly_size).unwrap();
// Generate proof for index 5
let index = 5;
let proof = prove(&data, index, poly_size).unwrap();
// Verify proof
let is_valid = verify_raw(&data, &commitment, index as u64, &proof, poly_size).unwrap();
assert!(is_valid);
This library implements cryptographic primitives and should be used with care. It is based on the MIRACL Core library and implements the BLS48-581 curve which provides approximately 256-bit security.
Licensed under the Apache License, Version 2.0. See LICENSE for details.
This crate is derived from MIRACL Core, which is also licensed under Apache 2.0.
Portions of this software are based on: