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

Import libp2p-crypto dependants directly #114

Closed
dapplion opened this issue Nov 30, 2021 · 2 comments
Closed

Import libp2p-crypto dependants directly #114

dapplion opened this issue Nov 30, 2021 · 2 comments

Comments

@dapplion
Copy link
Contributor

This library depends and imports from libp2p-crypto which hosts multiple crypto libs and utils. Since noise only requires a subset of those, should this library skip the libp2p-crypto middleman and import strictly what's necessary directly @achingbrain ?

Related: libp2p/js-libp2p-crypto#215

@achingbrain
Copy link
Collaborator

achingbrain commented Nov 30, 2021

This sounds appealing but it would make it much easier to end up with multiple versions of dependencies and/or competing implementations of the same algorithms which would increase bundle sizes when libp2p-* modules are packaged up for the browser, plus you still have it as a transitive dependency through peer-id.

Looking into the code here, libp2p-crypto is only used in non-test code to verify the payload of incoming messages - you could use the pubKey property on the incoming peerId to do the same thing. Then you could make libp2p-crypto a dev dep - eg: #115

@wemeetagain
Copy link
Member

resolved with #116

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

3 participants