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

Replace with pure rust implementation of libsecp256k1 #137

Closed
wants to merge 1 commit into from
Closed

Replace with pure rust implementation of libsecp256k1 #137

wants to merge 1 commit into from

Conversation

Gauthamastro
Copy link
Contributor

PR replaces the secp256k1 with paritytech's libsecp256k1 which is a pure rust implementation.

@elichai
Copy link
Contributor

elichai commented Sep 3, 2021

Thanks for opening a PR :)
May I ask what is the motivation behind this PR?
Thanks!

@Gauthamastro
Copy link
Contributor Author

Gauthamastro commented Sep 3, 2021

We are using this library inside Intel's software extension guard (SGX) environment, which has issues with C code the current version of libsecp256k1 has. It would be great to have a pure rust version, so we don't need to maintain a fork just for this.

Other than that,

  1. Pretty much no change in API
  2. Pure rust version well maintained and used in production blockchains ( Polkadot, Kusama, to name a few)

So I really don't see a reason why not to add it.

@elichai
Copy link
Contributor

elichai commented Sep 3, 2021

Thanks for responding,
Does this patch works for you? because it only changed test related stuff, the actual usage of secp256k1 is inside of the underlying math library https://github.com/ZenGo-X/curv

Also, I'd love to try and help you compile this as is on SGX, there's no reason this won't work.

As for repalcing the secp256k1 backend of curv please see ZenGo-X/curv#44 and ZenGo-X/curv#43

@Gauthamastro
Copy link
Contributor Author

Thanks for responding,
Does this patch works for you? because it only changed test related stuff, the actual usage of secp256k1 is inside of the underlying math library https://github.com/ZenGo-X/curv

Also, I'd love to try and help you compile this as is on SGX, there's no reason this won't work.

As for repalcing the secp256k1 backend of curv please see ZenGo-X/curv#44 and ZenGo-X/curv#43

Here you go, please check this: ZenGo-X/curv#135

Right now, I am using a fork of libsecp256k1 for the PR but as soon as paritytech/libsecp256k1#80 merges, I will change the dependency to official repo

@Gauthamastro
Copy link
Contributor Author

Closing this as per our discussion in telegram.

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