Git Product home page Git Product logo

fireblocks-bls-tools's Introduction

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 share

Key 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 <list of RSA public keys for all parties (space seperated)> -t <threshold>

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 <bls_key_json> [--RSA <RSA_private_key_file>]

  • 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 <bls_key_json> --index [--sign_msg --RSA <RSA_private_key_file> [--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 <list of bls_signature_json files (space seperated)> [-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)

fireblocks-bls-tools's People

Contributors

idan-fb avatar udi0peled avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

stakehound

fireblocks-bls-tools's Issues

Segmentation Fault

Unable to generate BLS keys

Please enter BLS public key integrity passphrase (minimum 8 characters):
Setting ids:
id: 1	file: /home/user/pubkey
id: 2	file: /home/user/pubkey2
zsh: segmentation fault  ./fb_bls_generate_key.py "/home/user/pubkey" "/home/user/pubkey2" -t 2

OSX 11.4 M1
Python 3.9.6

Anything specific i could be missing?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.