MCPcopy Create free account
hub / github.com/celo-org/celo-threshold-bls-rs

github.com/celo-org/celo-threshold-bls-rs @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
224 symbols 543 edges 19 files ⚖ Apache-2.0 74 documented · 33% updated 1d agodkg · 2020-06-18★ 828 open issues

Browse by type

Functions 178 Types & classes 46
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Threshold BLS Signatures

Overview

This crate provides libraries and command line interfaces for producing threshold BLS signatures. The signatures can also be blind in order to preserve the privacy of the user asking for a signature from another set of parties.

Note: The DKG (Distributed Key Generation) crates have been removed from this repository as they were unstable and not necessary for the BLS crates to work. They were removed in commit a911f40f0fd31fabae197016b87640f2fdcf1c9f.

Building with Docker

The project includes a justfile that supports building for multiple platforms using Docker. All built libraries are placed in the output directory, organized by platform. Run just to list the available recipes.

Install just with your package manager (brew install just, cargo install just) or with the install script:

curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to ~/bin

Clean Build

To clean the output directory before building:

just clean

Build All Platforms

just all

This builds the libraries for all supported platforms.

Running Tests

The tests run natively, including on Apple Silicon:

cargo test --workspace --all-features

To run them in the linux/amd64 build image instead, which is what CI builds against:

just test

WASM Build

just wasm

This builds WebAssembly bindings that can be used with Node.js and places them in output/wasm.

JVM Build

just jvm

This builds JVM-compatible libraries and places them in output/jvm.

Minimum mobile OS versions

The mobile builds target:

  • Android: API level 24 (Android 7.0) — set via android_api in the justfile
  • iOS: 15.2 — set via ios_deployment_target in the same file

iOS Build

just ios

This builds a universal static library for iOS (combining aarch64 and x86_64 architectures) and places it in output/ios. Note that iOS builds must be run on a macOS host as they cannot be built in Docker.

Android Build

just android

This builds dynamic libraries for Android architectures (x86, x86_64, arm64-v8a, and armeabi-v7a) and places them in output/android.

Docker Build

The docker image used for building the libraries can be built separately if needed:

just build-docker-image

Rust version

Rust 1.97.1 is used by default and tested for all builds. If desired, you can build with a different Rust version by setting the RUST_VERSION env var:

just RUST_VERSION=1.97.1 all

Directory Structure

This repository contains Rust crates that implement threshold BLS signatures. The high-level structure of the repository is as follows:

  • threshold-bls: (blind) threshold BLS signatures for BLS12-377. The API documentation, with worked examples for plain, blind and threshold signing, is the crate-level rustdoc in src/lib.rs; cargo doc --open renders it.
  • threshold-bls-ffi: FFI and WASM bindings to threshold-bls for cross platform interoperability. Its README covers building and consuming each binding surface.

Wire format

Every value the bindings exchange crosses as bytes, and those layouts are public API: docs/wire-format.md documents each one, what pins it, and what changes it.

Disclaimers

This software has not been audited. Use at your own risk.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 112
Method 66
Class 28
Interface 12
Enum 6

Languages

Rust97%
C++3%

Modules by API surface

crates/threshold-bls-ffi/src/ffi.rs40 symbols
crates/threshold-bls/src/curve/bls12377.rs37 symbols
crates/threshold-bls/src/poly.rs30 symbols
crates/threshold-bls-ffi/src/wasm.rs30 symbols
crates/threshold-bls/src/sig/bls.rs12 symbols
crates/threshold-bls/src/sig/blind.rs11 symbols
crates/threshold-bls/src/group.rs10 symbols
crates/threshold-bls/src/sig/tbls.rs9 symbols
crates/threshold-bls/src/serialization.rs9 symbols
crates/threshold-bls/src/test_vectors.rs8 symbols
crates/threshold-bls/src/sig/tblind.rs8 symbols
crates/threshold-bls-ffi/cross/threshold.h7 symbols

For agents

$ claude mcp add celo-threshold-bls-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page