# bls-eth-wasm

> BLS signature for Node.js by WebAssembly for Ethereum 2.0

Latest version **1.6.0** (published 2026-09-12) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install bls-eth-wasm
pnpm add bls-eth-wasm
yarn add bls-eth-wasm
bun add bls-eth-wasm
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.6.0 |
| Published | 2026-09-12 |
| First published | 2019-12-02 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 31 |
| Author | herumi |
| Maintainers | herumi |
| Keywords | BLS signature, WebAssembly, pairing |

## Links

- npm: https://www.npmjs.com/package/bls-eth-wasm
- Repository: https://github.com/herumi/bls-eth-wasm
- Homepage: https://github.com/herumi/bls-eth-wasm#readme
- Issues: https://github.com/herumi/bls-eth-wasm/issues
- npm.io page: https://npm.io/package/bls-eth-wasm

## Recent versions

- 1.6.0 (latest) — 2026-09-12
- 1.5.0 — 2026-05-29
- 1.4.0 — 2024-09-18
- 1.3.0 — 2024-09-09
- 1.2.1 — 2024-03-07
- 1.2.0 — 2024-03-07
- 1.1.1 — 2023-11-29
- 1.1.0 — 2023-08-17
- 1.0.6 — 2023-01-13
- 1.0.5 — 2022-07-20
- 1.0.4 — 2022-03-14
- 1.0.3 — 2021-09-28
- 1.0.2 — 2021-05-11
- 1.0.0 — 2021-03-02
- 0.4.8 — 2021-02-08
- … 19 more at https://npm.io/package/bls-eth-wasm/versions

## README

[![Build Status](https://github.com/herumi/bls-eth-wasm/actions/workflows/main.yml/badge.svg)](https://github.com/herumi/bls-eth-wasm/actions/workflows/main.yml)

# BLS signature for Node.js by WebAssembly

# Abstract
This module is built with `BLS_ETH=1` for Ethereum 2.0 spec.

# News
- 2024/Sep/30 : About 4% performance improvement
- 2024/Sep/18 : About 10% performance improvement
- 2022/Jul/20 : 1.1 times improved
- 2021/Aug/28 : improve performance of `{G1,G2}::isValidOrder()`
- 2020/Nov/04 : break backward compatibility (bls.js is renamed to index.js)
  - use blsSetupFactory to make bls instance on browser (see the top of bls-demo.js)
- 2020/Oct/01 : add `bls.multiVerify` to verify all {sigs, pubs, msgs}.
- 2020/Jul/06 ; `setETHmode(bls.ETH_MODE_DRAFT_07)` is default mode

## How to use
The version `v0.4.2` breaks backward compatibility of the entry point.

- Node.js : `const bls = require('bls-eth-wasm')`
- React : `const bls = require('bls-eth-wasm/browser')`
- HTML : `<script src="https://herumi.github.io/bls-eth-wasm/browser/bls.js"></script>`

Init as the followings:

```
bls.init(bls.BLS12_381)
```

(old) The new [eth2.0 functions](https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#bls-signatures) are supported. This mode will be removed in the future.

Init as the followings:

```
bls.init(bls.BLS12_381)
```

then, you can use the following functions.

bls-eth-wasm | eth2.0 spec name|
------|-----------------|
SecretKey::sign|Sign|
PublicKey::verify|Verify|
Sign::aggregate|Aggregate|
Sign::fastAggregateVerify|FastAggregateVerify|
Sign::aggregateVerifyNoCheck|AggregateVerify|

The size of message must be 32 byte.

Check functions:
- verifySignatureOrder ; make `deserialize` check the correctness of the order
- Sign::isValidOrder ; check the correctness of the order
- verifyPublicKeyOrder ; make `deserialize` check the correctness of the order
- PublicKey::isValidOrder ; check the correctness of the order
- areAllMsgDifferent ; check that all messages are different each other

see [bls](https://github.com/herumi/bls)

## How to build src/bls_c.js
Install [Emscripten](https://emscripten.org/).
```
cd src
git submodule update --init
make
```

## Installation

This project uses pnpm for package management.

```
pnpm install
```

## For Node.js
```
pnpm test
```

## Browser demo

see [bls-demo](https://herumi.github.io/bls-eth-wasm/browser/demo.html).

See `browser/readme.md` to make `browser/bls.js`.

## for React

```
const bls = require('bls-eth-wasm/browser')
```

# License

modified new BSD License
http://opensource.org/licenses/BSD-3-Clause

# Author

MITSUNARI Shigeo(herumi@nifty.com)

# Sponsors welcome
[GitHub Sponsor](https://github.com/sponsors/herumi)

---
_Source: https://npm.io/package/bls-eth-wasm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
