-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the bundle smaller #1
Comments
The reasons I chose the I see that the I think if we have a dependency on the bitcoinjs-lib anyway, it's suitable and we can pack a single version of it, then that would have to be the way to go. If not then it looks like we should be able to successfully make this version a lot smaller |
Worth mentioning that there may be ways around that. We could possibly just generate a private key from random data ourselves, but we'd have to drop invalid keys. However I also didn't see any way of using subtle crypto to look up the public key for a given private key. My instinct is to stick with predefined function calls so we don't stumble cryptography-wise. |
I think subtle crypto should be able to export the pub key. I was just looking at Also I haven't added minify yet. |
The issue wasn't the exporting of the key, it was deriving the public from the private. If you import a private key into subtle it won't export a public key for you (as far as I could see). That said, it looks like an ECDSA in jwk form ( If that's correct then to use subtle we'd have to generate a random key, make sure the key is valid for p256, put the key into either pkcs8 or jwk and use subtle.importKey, then export the private key as jwk and delete/alter some properties on it. |
I got it down to 143KB with uglify. If the jwk thing works out, I expect we'll get it down to ~10KB which would be great. |
dist/DualCrypto.js
is over 500kb.This is how we're using
elliptic
:Maybe we can tree shake?
Maybe there is an alternative?
The text was updated successfully, but these errors were encountered: