Avatar
M. Sean Gilligan
dc10fc72059ab11cef2678cdb5306b1009fd2ed1549657259308ed323eb2b65e
Developer at bitcoinj.org, ConsensusJ

I doubt they’ve given it much thought. They’re probably just amplifying criticism they’ve heard from within the Bitcoin community.

Nice interview of nostr:npub1hea99yd4xt5tjx8jmjvpfz2g5v7nurdqw7ydwst0ww6vw520prnq6fg9v2 about Sparrow Wallet on JavaFX in Action. Frank Delporte asks good questions about reproducible builds, JavaFX, etc and also gets an introduction to Bitcoin using the Sparrow UI.

https://www.youtube.com/watch?v=Mc3fUTxoKIg

In the JBang script? You change from Java 17 to what version? And I wouldn’t think the `import` statement would have to change? I must be missing something.

There’s a Nostr workshop in Santa Cruz this month. I’ll probably do it there…

Getting started with secp256k1-jdk in a note!

nostr:note13lhmq20lcy5jsxl8v77hgapl6zvuxg5kv5reey7zh7thrnqzfwgsg4u5kk

To run the Schnorr Signature example with JVM:

nix run github:msgilligan/secp256k1-jdk-flake#secp256k1-jdk

To run it the natively-compiled version:

nix run github:msgilligan/secp256k1-jdk-flake#secp256k1-jdk-native

If you want to play with source, do:

nix shell nixpkgs#jbang

enter the below code into a file named SecpEcdsa.java and then `jbang SecpEcdsa.java`.

(Schnorr sig is little trickier to run in JBang because you need libsecp256k installed, but the flakes above handle it.)

——

///usr/bin/env jbang "$0" "$@" ; exit $?

//JAVA 17+

//REPOS mavencentral, secpjdk=https://gitlab.com/api/v4/projects/55956336/packages/maven

//DEPS org.bitcoinj.secp:secp-bouncy:0.2

import org.bitcoinj.secp.*;

byte[] message = sha256("Hello World!");

void main() {

IO.println("secp256k1-jdk ECDSA Sample");

try (Secp256k1 secp = Secp256k1.getById("bouncy-castle")) {

var pair = secp.ecKeyPairCreate();

var sig = secp.ecdsaSign(message, pair).get();

var isValid = secp.ecdsaVerify(sig, message, pair.publicKey()).get();

IO.println("Valid ECDSA signature = " + isValid);

}

}

byte[] sha256(String message) {

try {

return MessageDigest.getInstance("SHA-256").digest(message.getBytes());

} catch (NoSuchAlgorithmException e) {

throw new RuntimeException(e); // Can't happen.

}

}

——

secp256k1-jdk is a modern, functional-style Java API with two implementations for Java, JDK, GraalVM native-image, Kotlin, Scala, etc.

It aims to be the standard library for secp256k1 in the greater JDK/JVM Bitcoin ecosystem.

Thanks to Andreas Schildbach and nostr:npub1hea99yd4xt5tjx8jmjvpfz2g5v7nurdqw7ydwst0ww6vw520prnq6fg9v2 for their help!

Version 0.2 is now available for early integration testing.

Binaries are available in a GitLab Maven repo, but remember: "Don't trust. Verify." This is an experimental pre-release.

https://github.com/bitcoinj/secp256k1-jdk/releases/tag/v0.2

nostr:npub18pudjhdhhp2v8gxnkttt00um729nv93tuepjda2jrwn3eua5tf5s80a699

Yeah, haven’t done the Zap thing yet. I’ll set it up eventually. Should be fun! But I’m on a “mission from Satoshi” right now and focused on other things.

Cool. I will post some instructions for you soon.

I know a few Java developers who are very excited about this…

nostr:npub18pudjhdhhp2v8gxnkttt00um729nv93tuepjda2jrwn3eua5tf5s80a699