A mathematical library written in C++ that supports BLS threshold signatures, Distributed Key Generation (DKG) and Threshold Encryption (TE).
This libBLS library is developed by SKALE Labs and uses SCIPR-LAB's libff (see Libraries below).
This libBLS library is still in active development and therefore should be regarded as alpha software. The development is still subject to security hardening, further testing, and breaking changes. This library has not yet been reviewed or audited for security. Please see SECURITY.md for reporting policies.
libBLS is a C++ library for BLS signatures and DKG that supports both threshold signatures and multi-signatures. Also it supports Threshold Encryption.
The signature process proceeds in 4 steps:
- Key generation
- Hashing
- Signing
- Verification
libBLS uses the alt_bn128 (Barreto-Naehrig curve) elliptic curve to be compatible with Ethereum's cryptography and provides 128 bits of security. Also, it provides opportunity to generate secret keys with DKG algorithm that supports the same curve.
libBLS for the most part corresponds to BLS signature standard. This work is still in progress and is going to be improved in the next couple of months.
Encryption process is running as follows:
- Key generation
- Encryption
- Decryption
- Verifying and combining shares
libBls uses the same alt_bn128 curve for threshold encryption as for BLS signatures.
libBLS allows to sign about 3000 messages per second on a single thread (Intel® Core™ i3-4160 CPU @ 3.60GHz). However, for our solution we have implemented constant time signing (0.01 sec for sign) to avoid timing attacks.
libBLS has been built and tested on Ubuntu and Mac.
GitHub is used to maintain this source code. Clone this repository by:
git clone https://github.com/skalenetwork/libBLS.git
cd libBLS
Ensure that required packages listed below are installed.
Build libBLS's dependencies by:
cd deps
bash ./build.sh
cd ..
brew install flex bison libtool automake cmake pkg-config yasm
# Configure the project and create a build directory.
cmake -H. -Bbuild
# Build all default targets using all cores.
cmake --build build -- -j$(sysctl -n hw.ncpu)
Ensure that the required packages are installed by executing:
sudo apt-get update
sudo apt-get install -y automake cmake build-essential libprocps-dev libtool\
pkg-config yasm texinfo autoconf flex bison clang-format-6.0
Configure the project build with the following commands.
# Configure the project and create a build directory.
cmake -H. -Bbuild
# Build all default targets using all cores.
cmake --build build -- -j$(nproc)
#include <libBLS.h>
See docs for libBLS documentation.
If you have any questions please ask the development community on Discord.
Otherwise see our CONTRIBUTING.md for more information.
Copyright (C) 2018-present SKALE Labs