filecoin-signing-tools
filecoin-signing-tools copied to clipboard
Find a BLS javascript library for test and pure js lib
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
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?
No, for the moment, we recommend using the WASM-based implmentation.
It looks like ChainSafe has been working on a BLS javascript lib. https://github.com/ChainSafe/bls
It might be a good fit.
Let's use it and run comparison tests with the WASM version
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.
Now that we have migrated to ES module we can implement BLS signature for the pure js lib.
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
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.
thansk, i know this. not see the pure environment code
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 🔗.
Refers to this issue on the new package https://github.com/Zondax/izari-filecoin/issues/71