Yo!
I just wrote a C library that showcases how to use libsecp256k1 for super quick batch additions. It can scan a specified range from start to end really fast.
You can stream the generated points or use it to test your CPU's performance. Check it out on GitHub!
Just set a start point, define a size, and pick the number of threads. The rest is all magic!
It uses only two EC point multiplications, so it’s efficient. To generate a billion points, it’s crazy fast.
Results on my old Ryzen 7 5800H:
Using 16 threads, I’m hitting about 42.63 million keys per second.
Sure, it’s slower than your i9 by 45-50%, but still pretty decent! Have you tried RELIC? I think it’s faster than libsecp256k1.
Appreciate the code!
Just skimmed it on my phone. Is it just batch inverse and additions? I think I have an OpenCL version that does something similar. I’ll benchmark it on my 7950X.
Definitely!
The inversion tree is parallelized, allowing SIMD optimizations. Field multiplications can run in parallel, making it quicker to create and break down the inverses.
You’re spot on!
That would save a few operations. And yeah, small optimizations can make a difference. I also forgot to add -march=native for native CPU instructions. Gonna fix that.
It’s about fast point generation across the entire range.
Check db.c for how the X coordinates are stored. They’re saved as little-endian bytes, with an integer key offset. What did you expect?
Compile it according to the README.
You can manipulate the database however you want, just treat the values as offsets. The code is stable, but watch out for specific edge cases I’ll fix.