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

Use libp2p-crypto #344

Closed
D4nte opened this issue Dec 7, 2021 · 6 comments
Closed

Use libp2p-crypto #344

D4nte opened this issue Dec 7, 2021 · 6 comments
Assignees

Comments

@D4nte
Copy link
Contributor

D4nte commented Dec 7, 2021

Problem

We are using several crypto libraries in js-waku: https://docs.wakuconnect.dev/docs/crypto_libraries/.
Some of them import polyfills as they were written for node first.
It can be quite messy too as there is a current node + browser support. We only want browser support so the complexity is unnecessary.

Solution

Review whether libp2p can be used, if so, use it and remove other crypto dependencies.
If not, review what work needs to be pushed upstream.

Notes

Consider vacp2p/rfc#414, would libp2p-crypto support those operations?
Check if libp2p crypto does use the CryptoSubtle browser API. If not, consider whether it is an issue.
Also consider ethereum-cryptography if it does not work out.

@dao
Copy link
Contributor

dao commented Jan 19, 2022

The link has moved to https://dev-docs.wakuconnect.dev/docs/crypto_libraries/

Should https://github.com/ethereum/js-ethereum-cryptography be considered as well as libp2p? They just released 1.0rc1 a couple days ago.

@D4nte
Copy link
Contributor Author

D4nte commented Jan 20, 2022

The link has moved to dev-docs.wakuconnect.dev/docs/crypto_libraries

Corrected, thanks.

Should ethereum/js-ethereum-cryptography be considered as well as libp2p? They just released 1.0rc1 a couple days ago.

We can consider it.
However, libp2p-crypto is a dependency of libp2p-noise, which in turn, is a dependency of js-waku. Hence, whatever we do, we'll have libp2p-crypto in the dependency tree.

So better use a crypto library we already have in the dependency tree (if it's good enough) than adding a new one.

Moreover, libp2p-crypto has done some recent effort to move away from node dependencies: libp2p/js-libp2p-crypto#180 as js-waku targets the browser, it's good to see.

@D4nte
Copy link
Contributor Author

D4nte commented Feb 21, 2022

Iceboxing it, likely to be part of the plan that is the output of #527

@D4nte D4nte mentioned this issue Mar 5, 2022
@fryorcraken fryorcraken added this to Waku Jan 31, 2023
@fryorcraken fryorcraken moved this to Todo in Waku Jan 31, 2023
@fryorcraken
Copy link
Collaborator

Out of icebox, need to review crypto deps and see if we can improve bundle size.

@fryorcraken fryorcraken self-assigned this Mar 2, 2023
@fryorcraken fryorcraken moved this from To Do to In Progress in Waku Mar 2, 2023
@fryorcraken
Copy link
Collaborator

fryorcraken commented Mar 2, 2023

API exposed by @libp2p/crypto:

@fryorcraken
Copy link
Collaborator

Review done, see comment above.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Waku Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

3 participants