Skip to content

feat: use ethereum-cryptography for enr crypto#285

Merged
wemeetagain merged 2 commits intomasterfrom
cayman/enr-noble-crypto
Jan 25, 2024
Merged

feat: use ethereum-cryptography for enr crypto#285
wemeetagain merged 2 commits intomasterfrom
cayman/enr-noble-crypto

Conversation

@wemeetagain
Copy link
Copy Markdown
Member

In order to make @chainsafe/enr more usable as a standalone library, we'd like to remove its heavy dependency bcrypto and replace it with something more suitable for cross-environment usage, ethereum-cryptography.

For @chainsafe/discv5, which already uses bcrypto, we can continue to use its enr crypto. This PR adds a side effect of switching enr crypto to use bcrypto when importing from @chainsfafe/discv5.

For users of @chainsafe/discv5 who would like to use ethereum-cryptography for enr crypto, you can always override the enr crypto like so:

import {setV4Crypto, defaultCrypto} from "@chainsafe/enr";

setV4Crypto(defaultCrypto)

By default, use ethereum-cryptography. Provide a more performant option
for nodejs in the discv5 package, see the discv5 README for details.
@wemeetagain wemeetagain requested a review from a team as a code owner January 24, 2024 19:29
Copy link
Copy Markdown
Member

@nflaig nflaig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@wemeetagain wemeetagain merged commit 50cee57 into master Jan 25, 2024
@wemeetagain wemeetagain deleted the cayman/enr-noble-crypto branch January 25, 2024 14:27
This was referenced Jan 25, 2024
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

Successfully merging this pull request may close these issues.

2 participants