MCPcopy Index your code
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 74 documented · 33%
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 Makefile that supports building for multiple platforms using Docker. All built libraries are placed in the output directory, organized by platform.

Clean Build

To clean the output directory before building:

make clean

Build All Platforms

make all

This builds the libraries for all supported platforms.

Running Tests

To run tests:

make test

This runs the tests in a Docker container which is especially important for Apple Silicon (M1/M2/M3) Macs, as some dependencies have compatibility issues when running natively on ARM64 architecture. The Docker container provides an x86_64 / amd64 environment where all tests run successfully.

WASM Build

make wasm

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

JVM Build

make 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 crates/threshold-bls-ffi/cross/Makefile
  • iOS: 15.2 — set via IPHONEOS_DEPLOYMENT_TARGET in the same Makefile

iOS Build

make 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

make 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:

make build-docker-image

Rust version

Rust 1.95.0 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:

make RUST_VERSION=1.95.0

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
  • threshold-bls-ffi: FFI and WASM bindings to threshold-bls for cross platform interoperability

Disclaimers

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

Extension points exported contracts — how you extend this code

Element (Interface)
Element represents an element of a group with the additive notation which is also equipped with a multiplication transfo [4 …
crates/threshold-bls/src/group.rs
Point (Interface)
Basic point functionality that can be multiplied by a scalar [2 implementers]
crates/threshold-bls/src/group.rs
BLSScheme (Interface)
BLSScheme is an internal trait that encompasses the common work between a BLS signature over G1 or G2. [2 implementers]
crates/threshold-bls/src/sig/bls.rs
Scheme (Interface)
The `Scheme` trait contains the basic information of the groups over which the signing operations takes places and a way [2 …
crates/threshold-bls/src/sig/sig.rs
PrimeOrder (Interface)
Checks inclusion in prime order subgroup. Only needed when underlying trait does not enforce this already [1 implementers]
crates/threshold-bls/src/group.rs

Core symbols most depended-on inside this repo

map
called by 40
crates/threshold-bls/src/curve/bls12377.rs
serialize
called by 31
crates/threshold-bls-ffi/src/ffi.rs
mul
called by 22
crates/threshold-bls/src/poly.rs
deserialize
called by 19
crates/threshold-bls/src/serialization.rs
deserialize
called by 14
crates/threshold-bls-ffi/src/ffi.rs
add
called by 12
crates/threshold-bls/src/poly.rs
eval
called by 12
crates/threshold-bls/src/poly.rs
verify
called by 10
crates/threshold-bls-ffi/src/ffi.rs

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