Nim implementation of BLS signature scheme (Boneh-Lynn-Shacham) over Barreto-Lynn-Scott (BLS) curve BLS12-381
Go to file
Etan Kissling de2d3c7926
Replace `apt-fast` with `apt-get` (#181)
`apt-fast` was removed from GitHub with Ubuntu 24.04:

- https://github.com/actions/runner-images/issues/10003

For compatibility, switch back to `apt-get`.
2024-10-15 14:38:24 +00:00
.github/workflows Replace `apt-fast` with `apt-get` (#181) 2024-10-15 14:38:24 +00:00
benchmarks Expose Pippenger multiplication for combining multiple sigs of same msg (#178) 2024-08-12 02:19:19 +00:00
blscurve Use correct header file for `blst_aux` ABI (#179) 2024-08-16 08:43:54 +00:00
docs remove MIRACL Core backend (#170) 2024-02-22 15:54:55 +01:00
tests Expose Pippenger multiplication for combining multiple sigs of same msg (#178) 2024-08-12 02:19:19 +00:00
vendor bump blst to `v0.3.13` (#175) 2024-07-24 13:24:31 +00:00
.gitignore Add setup files (#143) 2022-07-12 23:28:00 +03:00
.gitmodules remove MIRACL Core backend (#170) 2024-02-22 15:54:55 +01:00
LICENSE-APACHEv2 ci: update 2018-09-04 22:54:46 -06:00
LICENSE-MIT ci: update 2018-09-04 22:54:46 -06:00
README.md Update `nimbus-eth2` reference (#176) 2024-07-24 13:33:41 +00:00
blscurve.nim Consolidate internal backend API and implement #90 (#100) 2020-12-07 08:33:45 +01:00
blscurve.nimble update ci.yml and be more explicit in .nimble (#174) 2024-06-26 05:33:08 +00:00
config.nims Add setup files (#143) 2022-07-12 23:28:00 +03:00
nim.cfg move `-d:nimRawSetjmp` to config.nims (#140) 2022-06-27 11:52:09 +02:00

README.md

BLS Signature Scheme over BLS12-381 pairing-friendly curve

License: MIT License: Apache Github action

This library implements:

  • The BLS signature scheme (Boneh-Lynn-Shacham)
  • over the BLS12-381 (Barreto-Lynn-Scott) pairing-friendly curve

Cipher suite ID: BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_

Installation

You can install the developement version of the library through nimble with the following command

nimble install https://github.com/status-im/nim-blscurve

Implementation stability

This repo follows Ethereum 2.0 requirements.

Besides the standardization work described below, no changes are planned upstream for the foreseeable future.

Standardization

Currently (Jun 2019) a cross-blockchain working group is working to standardize BLS signatures for the following blockchains:

  • Algorand
  • Chia Network
  • Dfinity
  • Ethereum 2.0
  • Filecoin
  • Zcash Sapling

Signature scheme

Hashing to curve

Note: the implementation was done following Hash-to-curve v7 v9 and v7 are protocol compatible but have cosmetic changes (naming variables, precomputing constants, ...)

Curve implementation

Backend

This library uses:

BLST uses SSSE3 by default, if supported on the host. To disable that, when building binaries destined for older CPUs, pass -d:BLSTuseSSSE3=0 to the Nim compiler.

Executing the test suite

We recommend working within the nimbus build environment described here: https://github.com/status-im/nimbus-eth2

To execute the test suite, just navigate to the root of this repo and execute:

nimble test

Please note that within the nimbus build environment, the repository will be located in nimbus-eth2/vendor/nim-blscurve.

Executing the fuzzing tests

Before you start, please make sure that the regular test suite executes successfully (see the instructions above). To start a particular fuzzing test, navigate to the root of this repo and execute:

nim tests/fuzzing/run_fuzzing_test.nims <test-name>

You can specify the fuzzing engine being used by passing an additional --fuzzer parameter. The currently supported engines are libFuzzer (used by default) and afl.

All fuzzing tests are located in tests/fuzzing and use the following naming convention:

fuzz_<test-name>.nim

License

Licensed and distributed under either of

at your option. These files may not be copied, modified, or distributed except according to those terms.

Dependencies

  • SupraNational BLST is distributed under the Apache License, Version 2.0