Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gakonst/solidity-bls
BLS threshold signature verification in Solidity
https://github.com/gakonst/solidity-bls
Last synced: 12 days ago
JSON representation
BLS threshold signature verification in Solidity
- Host: GitHub
- URL: https://github.com/gakonst/solidity-bls
- Owner: gakonst
- License: mit
- Created: 2018-09-22T06:53:32.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-22T00:32:20.000Z (about 6 years ago)
- Last Synced: 2024-10-04T13:34:59.822Z (about 1 month ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 18
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# solidity-bls
**Note**: This repository is a WIP and will be updated frequently in the coming weeks. This is probably completely broken, please don't use this in production!
---
This is a library for verifying [BLS signatures](https://en.wikipedia.org/wiki/Boneh%E2%80%93Lynn%E2%80%93Shacham) over [bn128](https://www.cryptojedi.org/papers/pfcpo.pdf) in Solidity. Almost all of the code here is taken from [BjornvdLaan's work](https://gist.github.com/BjornvdLaan/ca6dd4e3993e1ef392f363ec27fe74c4) and the work on ZoKrates available [here](https://github.com/JacobEberhardt/ZoKrates/blob/da5b13f845145cf43d555c7741158727ef0018a2/zokrates_core/src/verification.rs).
## TODO
- [ ] Add real testing
- [ ] See if there are any obvious optimizations
- [ ] Add support for verification of signatures with different messages## Testing
We use [Truffle](https://truffleframework.com/) for testing.```
$ truffle test
Compiling ./contracts/BLS.sol...
Compiling ./contracts/BLSTest.sol...
Compiling ./contracts/Migrations.sol...
Compiling ./contracts/Pairing.sol...Contract: BLS
✓ should verify a valid signature (302ms)
✓ should not verify a invalid signature (59ms)
✓ should not verify a invalid message (291ms)
```## Gas Cost
The cost of verifying a signature is currently ~365,000 gas.