harmony-one / bounties

Bounty program is to help the community take part in the development of the Harmony blockchain. It covers from core feature to validator tooling, from dApp development to DeFi integration.
MIT License
59 stars 23 forks source link

integrate blst library into harmony #8

Closed LeoHChen closed 3 years ago

LeoHChen commented 3 years ago

Description

Add blst library support in harmony node program.

Context

Harmony is using BLS signature to sign and verify the transaction blocks. Currently, it is using the golang binding of herumi bls library (https://github.com/herumi/bls) to sign and verify.

However, there is a new BLS library using the same curve was developed (https://github.com/supranational/blst). It claims to have at least 3x performance improvement over the herumi library for the verification of the aggregated signature. It was also used in the prysm ethereum2 beacon chain validator (https://github.com/prysmaticlabs/prysm).

This bounty is to add blst library support into harmony node program, so that validator can choose between herumi bls library or blst library.

This bounty requires a good understanding of the BLS12_381 curve and golang. You'd get familiar with both herumi bls and blst library.

Reference

https://medium.com/supranational/introducing-blst-2b6a988d68ee

Acceptance Criteria

Reward

USD15,000 equivalent amount of ONE token.

tac0turtle commented 3 years ago

Is there a preferred API or can we propose an api?

@decanus and I can work on this.

LeoHChen commented 3 years ago

We currently has an interface in https://github.com/harmony-one/harmony/tree/main/crypto/bls, but it is only designed to support "github.com/harmony-one/bls/ffi/go/bls", which is a fork of the https://github.com/herumi/bls. You are free to use existing api so that you don't have to change most of the core code that rely on the bls signature signing/verification/serialization/deseralization.

Of course, you may propose your own API for easier wrap. But that may require some touch of the core code to use the new API anyway.

Feel free to take a first stab and we can discuss further.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 75494.2342 ONE (14911.02 USD @ $0.2/ONE) attached to it.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 3 weeks, 2 days from now. Please review their action plans below:

1) zyfrank has started work.

Integrate Blst Library Into Harmony 2) mul1sh has started work.

An integration of BLST into harmony 3) boler99 has started work.

integrate blst library into harmony

Learn more on the Gitcoin Issue Details page.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 75494.2342 ONE (12651.85 USD @ $0.16/ONE) has been submitted by:


gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 75494.2342 ONE (11932.09 USD @ $0.16/ONE) has been submitted by:

  1. @boler99

@papiofficial please take a look at the submitted work:


LeoHChen commented 3 years ago

@boler99 thanks for the submission.

gitcoinbot commented 3 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 75494.2342 ONE (8493.40 USD @ $0.12/ONE) attached to this issue has been approved & issued to @boler99.

LeoHChen commented 3 years ago

This bounty is done. High quality submission. Due to the base point is different between Harmony and Eth2, we can't merge the PR right now. Thanks for finding the issue and we will find a solution on the base points, then merge fix.