Bitcoin Forum
November 12, 2024, 03:50:12 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there secp25k1 for the cuda api on C ++?  (Read 349 times)
mamuu (OP)
Member
**
Offline Offline

Activity: 73
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
NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7372


Top Crypto Casino


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.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
mamuu (OP)
Member
**
Offline Offline

Activity: 73
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: 73
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: 206
Merit: 447


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
*
Offline Offline

Activity: 1778
Merit: 7372


Top Crypto Casino


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.

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
mamuu (OP)
Member
**
Offline Offline

Activity: 73
Merit: 19


View Profile
August 08, 2024, 09: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

1DWA3Sa8i6eHVWV4AG4UP2SBhYB2XrfiHW
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!