Skip to content
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

remove the use of await sodium.ready #1529

Open
jinglescode opened this issue Nov 14, 2024 · 4 comments
Open

remove the use of await sodium.ready #1529

jinglescode opened this issue Nov 14, 2024 · 4 comments

Comments

@jinglescode
Copy link
Contributor

jinglescode commented Nov 14, 2024

Describe the feature you'd like

To make keys functions non-async.

Rewrite packages/crypto/src/Bip32/Bip32PrivateKey.ts and packages/crypto/src/Bip32/Bip32PublicKey.ts to remove async when derive(derivationIndices: number[]): Bip32PublicKey and toPublic(): Bip32PublicKey

Describe alternatives you've considered

@mkazlauskas
Copy link
Member

Hey @jinglescode, would we require consumer to await it separately/globally then, or do you have some other ideas?

@jinglescode
Copy link
Contributor Author

if reference strica and harmonic implementation as reference, and dont use libsodium lib, might be able to remove async await entirely.
i cannot be 100% sure, about this, @ashisherc for sense check.

@ashisherc
Copy link

@mkazlauskas The existing approach seems due to the way sodium functions. To clarify @jinglescode suggestion, he is advocating for a pure JavaScript library that doesn’t rely on async code for derivation. One example of this type of implementation is here: https://github.com/StricaHQ/bip32ed25519. Just sharing this as an example to help illustrate Jingles’ point.

@AngelCastilloB
Copy link
Member

Thanks for the report guys, we will look into this. We should be able to remove the async from these functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants