Author

Topic: Is there secp25k1 for the cuda api on C ++? (Read 345 times)

member
Activity: 73
Merit: 19
August 08, 2024, 04:53:52 AM
#7
Hello

I found a new work and I'm adding it to the subject, I haven't tried it yet.

https://github.com/HareInWeed/gec
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Is it the right way to make a new secp256K1 library with the CGBN number library on Cuda?

No. We should not base a CUDA secp256k1 implementation on an arbitrary precision library like GMP or the one you just mentioned, because we don't need all of that precision and bitlength.

Dealing with arbitrary precision numbers deprives us of the opportunity to optimize the code for a specific bitlength. Instead of 4 statements of 64-bit words, now you need a loop, which doesn't optimize well on CUDA, especially when future results inside it depend on previous ones (the loop cannot be unrolled).

I strongly believe that for maximum performance the ideal library would be written from scratch. CUDA doesn't play well with C++ classes so the library would just be a series of global functions plus a type such as secp256k1_t or something.
full member
Activity: 206
Merit: 447

Fastest parts of secp256k1 for CUDA I know of are in https://github.com/JeanLucPons/VanitySearch and https://github.com/JeanLucPons/Kangaroo

Slower, but easier to follow code is in https://github.com/brichard19/BitCrack

All these are heavily optimized for specific tasks, you would need to understand what it does first, and then copy/modify it for your needs.

member
Activity: 73
Merit: 19
Not one that I know of.

The fastest secp256k1 library in existence, libsecp256k1 (Pieter Wuille's brainchild), currently works only on CPU. So, what someone would do from here is find somebody who can port this to CUDA.

It's unlikely the actual operations themselves can be optimized further beyond placing them on blocks and threads, but the ideal way to create a super-fast secp256k1 CUDA implementation, or for any math library really, is to design it so that millions of these numbers can be operated on in parallel.

Someone made a start for OpenCL but it's not as fast as it could be.

Another ones this -> https://github.com/ilaychen/ECDSA-OpenCL
member
Activity: 73
Merit: 19
Thanks NotATether for the reply

For CUDA, the number library is important for fast transactions, especially in parallel transactions, the CGBN project started in 2019. I'm not sure how useful the CGBN number library would be compared to the large number use in Bitcrack and Kangaroo projects, but there is a table for the duration of mathematical operations.

Project address: https://github.com/NVlabs/CGBN

Is it the right way to make a new secp256K1 library with the CGBN number library on Cuda?
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Not one that I know of.

The fastest secp256k1 library in existence, libsecp256k1 (Pieter Wuille's brainchild), currently works only on CPU. So, what someone would do from here is find somebody who can port this to CUDA.

It's unlikely the actual operations themselves can be optimized further beyond placing them on blocks and threads, but the ideal way to create a super-fast secp256k1 CUDA implementation, or for any math library really, is to design it so that millions of these numbers can be operated on in parallel.

Someone made a start for OpenCL but it's not as fast as it could be.
member
Activity: 73
Merit: 19
Hi

Is there secp25k1 for the cuda api on C ++?
How can I create such a project in Visual Studio?
Do you have a project ready? I will only use CUDA ..



like
https://github.com/brichard19/BitCrack and  https://github.com/JeanLucPons/Kangaroo

however, I do not have enough knowledge of C ++ to understand the documents in these projects.
I just want to increase the mathematical operations in parallel.
So I am looking for a C ++ platform project that works in the CUDA API of secp256k1 library.

Thank you..
Jump to: