filecoin-signing-tools icon indicating copy to clipboard operation
filecoin-signing-tools copied to clipboard

Find a BLS javascript library for test and pure js lib

Open rllola opened this issue 4 years ago • 6 comments

We need to support BLS signing. We need to pick a proper javascript lib that we could use in the pure js lib and for tests.

:link: zboto Link

rllola avatar Aug 28 '20 14:08 rllola

We need to support BLS signing. We need to pick a proper javascript lib that we could use in the pure js lib and for tests.

We need the same thing. Have you guys found the solution?

jtomtan avatar Dec 07 '20 13:12 jtomtan

No, for the moment, we recommend using the WASM-based implmentation.

jleni avatar Dec 07 '20 15:12 jleni

It looks like ChainSafe has been working on a BLS javascript lib. https://github.com/ChainSafe/bls

It might be a good fit.

rllola avatar Mar 07 '22 11:03 rllola

Let's use it and run comparison tests with the WASM version

jleni avatar Mar 11 '22 01:03 jleni

Looks like @ChainSafe/bls is ESM only so we can't use require to load the library. One way would be to convert the whole lib to be ESM only but it would break a lof of things for downstream devs. The other way is just to make the transactionSign async.

rllola avatar Jul 06 '22 14:07 rllola

Now that we have migrated to ES module we can implement BLS signature for the pure js lib.

rllola avatar Oct 14 '22 20:10 rllola

i see wasm implement in current version, but why have a todo for signTransaction

 // TODO: support BLS scheme
  const signedMessage: SignedMessage = {
    Signature: {
      Data: signature.toString('base64'),
      Type: ProtocolIndicator.SECP256K1,
    },
  }

any work need to do, is this signature correctly

hunjixin avatar Mar 15 '23 09:03 hunjixin

i see wasm implement in current version, but why have a todo for signTransaction

 // TODO: support BLS scheme
  const signedMessage: SignedMessage = {
    Signature: {
      Data: signature.toString('base64'),
      Type: ProtocolIndicator.SECP256K1,
    },
  }

any work need to do, is this signature correctly

BLS is not supported on the pure JS implementation. That is why the TODO is there.

emmanuelm41 avatar Mar 15 '23 13:03 emmanuelm41

thansk, i know this. not see the pure environment code

hunjixin avatar Mar 15 '23 15:03 hunjixin

A new complete package, built from scratch, will take filecoin signing tools place regarding JS implementation. As this issue refers to BLS on JS, it will be implemented on the new package.

Please, check it out here 🔗.

emmanuelm41 avatar Mar 17 '23 13:03 emmanuelm41

Refers to this issue on the new package https://github.com/Zondax/izari-filecoin/issues/71

emmanuelm41 avatar Mar 17 '23 13:03 emmanuelm41