-
Notifications
You must be signed in to change notification settings - Fork 3
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
Feedback on 0.0.1 #79
Comments
Thanks, Craig! This is great news!
For v0.0.1/v0.0.2 I've been focused on just Schnorr and Ecdsa signing/verification. I will add
I have done this many times in the past, but for secp-jdk I've been ignoring that issue until now. During development, especially when using Are you using
I will add this.
This is part of an effort called "Integrity by Default". See draft JEP and this video for more information. This change will affect JNI as well. You should be able to add I like this approach, especially with the module system. This means the person building the app can control which modules are allowed native access and this helps protect against supply chain attacks.
I will look at them and add them or the equivalent functionality.
I'm not sure we will always be using But for now, I do plan to continue with Thanks again for doing this, this is really helpful feedback. I would have expected you to find more serious issues, so to me this is a very encouraging report. |
Also, I have one comment on your drongo changes. Although |
Thanks - I agree, it is encouraging.
Yes I am. I did see this this answer but there would need to be another solution for development/testing to avoid having to run
Yes, good point. |
Take a look at how I am setting it in Gradle. I'm assuming it was installed with Nix, but you don't have to use Nix. You could just set the path in Gradle in a similar way. (I think I even allow overriding the Nix location) |
But again, I am open to supporting the old method of loading it out of a JAR if that is what is needed. |
Yes, it's certainly possible - my point was more that it means a different code path is used between development and production, which means double testing across all platforms. |
To investigate the library in order to provide feedback, I attempted an integration into Sparrow (actually, drongo) in which I replaced the following functions with equivalents from secp256k1-jdk, using the ffm implementation:
I was able to achieve the first 5 items, with some caveats which I'll list below. I've put the changes in a branch. The
secp256k1_ecdh
function was not present in secp256k1-jdk, so I wasn't able to implement the 6th item. Here are the issues I encountered:System.load(filepath)
. However, the approach used by jextract is different - it expects to be able to find the library onjava.library.path
which must be specified on application startup, since it is only read once. The problem is in the static initializer:secp256k1-jdk/secp-ffm/src/main/java/org/bitcoinj/secp/ffm/jextract/secp256k1_h.java
Lines 71 to 73 in 453da0b
secp.ecdsaSign
. Currently, it's set to nullPointer.Apart from these issues, everything went well. The client code was relatively easy to read/write. I did need to create two implementations (
ByteArrayP256K1XOnlyPubKey
andBigIntegerP256k1PrivKey
) of the provided interfaces, which could be considered to be included in the api as I imagine they will be often required. I tested with secp256k1 v0.5.1.The text was updated successfully, but these errors were encountered: