-
Notifications
You must be signed in to change notification settings - Fork 2.5k
ECKey: remove native interface to libsecp256k1 #2267
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
Conversation
|
I think it makes sense to remove this code if it is unused and untested. However we should at least consider refactoring it to a separate module rather than removing it entirely. As you know, I recently was looking at this code and made some minor improvements via a PR or two. One important question is what are the advantages to using this code over Bouncy Castle? I was going to propose that we create an interface for the core EC (and I suppose Schnorr) functionality needed by bitcoinj. We could then provide one or more of the following implementations:
One specific argument for not removing this code is it at least provides an example of an alternate implementation and would allow us to use it as a starting place for the refactoring. |
|
btw. The JNI bindings were removed in libsecp256k1 too: bitcoin-core/secp256k1#682 |
Good question. If we were aiming to implement a full node, it would probably make sense to use native code from Bitcoin Core, at least for the consensus-critical parts. But I guess we aren't. BouncyCastle is well supported and widely used. And I don't remember any bug that affected us. |
|
I went ahead and at least deprecated the classes via 24095fd. |
ab79e3e to
be10cd8
Compare
|
Rebased this PR. |
be10cd8 to
c9e2054
Compare
Of course, BouncyCastle is still used.
c9e2054 to
cf3c023
Compare
|
Rebased once more. |
|
I finally merged this. If we ever have an interface backed by multiple implementations (see #1874), I believe we'd have to rewrite this removed code anyway. |
I propose removing support for libsecp256k1 until a clear support path is established. Currently, the removed code is untested and it's not clear to me if it's still compatible.
Also I suspect this native code path stands in the way of implementing Schnorr signatures.
But don't worry: Of course, BouncyCastle is still used.