Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kevincharm/bls-bn254
contracts & js lib for verifying BLS sigs on the BN254 curve
https://github.com/kevincharm/bls-bn254
Last synced: about 5 hours ago
JSON representation
contracts & js lib for verifying BLS sigs on the BN254 curve
- Host: GitHub
- URL: https://github.com/kevincharm/bls-bn254
- Owner: kevincharm
- License: mit
- Created: 2024-02-08T23:11:00.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-03-19T17:08:06.000Z (8 months ago)
- Last Synced: 2024-04-14T13:45:58.970Z (7 months ago)
- Language: TypeScript
- Homepage:
- Size: 472 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BLS on BN254
BLS operations on BN254 in Solidity, including constant-time hash-to-curve using a the general Shallue-van de Woestijne encoding described in [RFC9380 Section 6.6.1](https://datatracker.ietf.org/doc/html/rfc9380#section-6.6.1).
A lot of the code in this repository has been taken from these repositories:
- https://github.com/thehubbleproject/hubble-contracts
- https://github.com/ChihChengLiang/bls_solidity_python
- https://github.com/kilic/evmbls
- https://github.com/kevincharm/draft-irtf-cfrg-hash-to-curve## JavaScript Library
This repo also comes with an accompanying JS lib for creating signatures.
```sh
npm install --save @kevincharm/bls-bn254 ethers@^6 [email protected]
```## Utilities
### Hash-to-point
Hash a regular string
```sh
yarn bls:hash "message to hash"
```Hash hex bytes
```sh
yarn bls:hash 0xdeadbeef
```## Readings
- [BLS Signatures in Solidity by @liangcc](https://hackmd.io/@liangcc/bls-solidity)
- [RFC9380](https://datatracker.ietf.org/doc/html/rfc9380)