https://github.com/fireblocks/fireblocks-bls-tools
https://github.com/fireblocks/fireblocks-bls-tools
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/fireblocks/fireblocks-bls-tools
- Owner: fireblocks
- Created: 2020-11-22T18:22:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-25T16:34:29.000Z (almost 2 years ago)
- Last Synced: 2025-03-25T20:21:26.610Z (about 2 months ago)
- Language: Python
- Size: 5.78 MB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fireblocks BLS12-381 Key Sharing and Verification Tool
## Installation
* `git clone https://github.com/fireblocks/fireblocks-bls-tools.git`
* `cd fireblocks-bls-tools`### Prerequisites
Key Generation:
* RSA public keys for each entity which should can a BLS key shareKey Share Validation:
* RSA private key (possibly with passphrase)
* Verification file generted during key generation, encrypted with above RSA key## Running Locally
### Build the utility locally
* install python 3
* install pip 3
* run: `pip3 install -r requirements.txt`### Generate BLS12-381 key and encrypted shares, with verfication files
`./fb_bls_generate_key.py -t `Output:
* Generated BLS12-381 address (to use in eth2.0)
* Table of ids set for each party (corresponding to RSA public keys)
* Generted BLS key json (containing encrypted BLS private key shares) for each id### Verification of generated key shares
`./fb_bls_verify_key.py [--RSA ]`* Verification of signature shares on test message can be reconstructed to a valid signature
* If RSA file given, verify test message was signed correctly with BLS private key share.### Derive a public key (at index), and generate a signature share on a message
`./fb_bls_derive_key_and_sign.py --index [--sign_msg --RSA [--hex]]`* Derive a BLS public key (at index from master pubkey).
* If given sign_msg (and RSA private key file), use decrypted BLS private key share to generate signature share on the message
* sign_msg can be given in hexadecimal, and signed as bytes
* Withdrawal credentials are also printed for the derived address### Verify signature, reconstructed from signature shares
`./fb_bls_verify_signature.py [-t threshold]`* Verification of signature shares on test message can be reconstructed to a valid signature
* If threshold is given, checks any subset of threshold signature shares can be reconstructed and verifies (otherwise just checks all)