Bitcoin Forum
May 09, 2024, 09:25:59 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there secp25k1 for the cuda api on C ++?  (Read 221 times)
mamuu (OP)
Member
**
Offline Offline

Activity: 71
Merit: 19


View Profile
April 05, 2021, 11:16:38 AM
Merited by ABCbits (1)
 #1

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..

1DWA3Sa8i6eHVWV4AG4UP2SBhYB2XrfiHW
"There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715246759
Hero Member
*
Offline Offline

Posts: 1715246759

View Profile Personal Message (Offline)

Ignore
1715246759
Reply with quote  #2

1715246759
Report to moderator
1715246759
Hero Member
*
Offline Offline

Posts: 1715246759

View Profile Personal Message (Offline)

Ignore
1715246759
Reply with quote  #2

1715246759
Report to moderator
NotATether
Legendary
*
Online Online

Activity: 1596
Merit: 6731


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 05, 2021, 01:38:19 PM
Merited by ABCbits (1), DireWolfM14 (1)
 #2

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
mamuu (OP)
Member
**
Offline Offline

Activity: 71
Merit: 19


View Profile
April 05, 2021, 02:51:51 PM
 #3

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?

1DWA3Sa8i6eHVWV4AG4UP2SBhYB2XrfiHW
mamuu (OP)
Member
**
Offline Offline

Activity: 71
Merit: 19


View Profile
April 05, 2021, 03:00:23 PM
 #4

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

1DWA3Sa8i6eHVWV4AG4UP2SBhYB2XrfiHW
j2002ba2
Full Member
***
Offline Offline

Activity: 204
Merit: 437


View Profile
April 05, 2021, 04:21:55 PM
 #5


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.

NotATether
Legendary
*
Online Online

Activity: 1596
Merit: 6731


bitcoincleanup.com / bitmixlist.org


View Profile WWW
April 05, 2021, 05:42:55 PM
 #6

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!