Skip to content

KB 044: replacing hand-written secp256k1 BigInteger arithmetic with a curve library (Java Schnorr signing) - #29

Merged
schulzchristian merged 1 commit into
CHSZLab:mainfrom
tcheeric:kb/044-java-secp256k1-library-arithmetic
Nov 26, 2026
Merged

schulzchristian merged 1 commit into
CHSZLab:mainfrom
tcheeric:kb/044-java-secp256k1-library-arithmetic

Conversation

@tcheeric

Copy link
Copy Markdown
Contributor

Adds knowledge-base entry 044 from an AAE session on a Java Nostr SDK (BIP-340 Schnorr, JSON event serialization, filter matching).

Highlights:

  • Swapping a BigInteger affine double-and-add for a library curve (Jacobian coordinates, precomputed comb for the generator) made sign about 93x and verify about 91x faster; sumOfTwoMultiplies took a further 42% off verify.
  • Geometric mean over seven workloads: 579 us to 63.5 us (9.1x), five kept experiments, one discarded.
  • Measurement lessons for loaded shared machines: thread CPU time with the minimum over rounds, re-checking warmup after a big speedup, and confounding when one operation contains another.
  • A refuted hypothesis (liftX swap saved about 2%) is recorded under "What Didn't Work".

Numbered 044 because 041 to 043 are taken by open PRs (#23, #24, #25, #26).

🤖 Generated with Claude Code

…tic in Java

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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