Is it possible to use browser's crpyo primitives with bsv library?

I have some code that does a lot of HD derivation and ECIES encryption/decryption and I noticed that it runs quite slow in the browser. I did some profiling and it seems that it spends most of the time in the libraries that handle primitives (sha256 hashing, big int, …).

This makes sense as it seems that we have this primitives natively in node, but we need to use libraries in the browser. I did some Googling and it seems that newer browsers do have some support for this things so I was wondering if it is possible to use that when available? I suspect that would speed up things significantly?

I am thinking about browser’s native APIs such as SubtleCrypto and BigInt. Or even an Emscripten-compiler Javascript library such as js-nacl.

Submit an answer See answers Share on Twitter Share on Facebook
There are currently no answers to this questions. Add one!

You are creating this answer as an anonymous user. If you log in we will be able to store the draft as you write it.

Submit an Answer

By swiping I acknowledge that the answer will be immutably stored on the Bitcoin SV blockchain forever and that I take full responsibility for any legal or other consequences that might be related to that.
Made with in Slovenia.