Bitcoin Forum
May 03, 2024, 09:34:43 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Creating Bitcoin addresses in OpenCL  (Read 140 times)
dlystyr (OP)
Jr. Member
*
Offline Offline

Activity: 77
Merit: 7


View Profile WWW
November 03, 2022, 10:26:00 PM
Merited by ABCbits (1)
 #1

Hi,

I am looking at creating Bitcoin addresses in OpenCL but I am wondering what is the best way to go about it.

Should I look to do all the computation of the address on the GPU starting with the secp256k1 keypair or should I only be looking at creating the keypair on GPU and the other functions on the CPU once returned?

I am new to GPU programming and I am trying to understand the costly part of the process. If anyone experienced with either OpenCL or Cuda could point me in the right direction I would really appreciate that.

Dly

Crack Puzzle #66 Pool - http://www.ttdsales.com/66bit/index.php
"Bitcoin: the cutting edge of begging technology." -- Giraffe.BTC
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714772083
Hero Member
*
Offline Offline

Posts: 1714772083

View Profile Personal Message (Offline)

Ignore
1714772083
Reply with quote  #2

1714772083
Report to moderator
1714772083
Hero Member
*
Offline Offline

Posts: 1714772083

View Profile Personal Message (Offline)

Ignore
1714772083
Reply with quote  #2

1714772083
Report to moderator
1714772083
Hero Member
*
Offline Offline

Posts: 1714772083

View Profile Personal Message (Offline)

Ignore
1714772083
Reply with quote  #2

1714772083
Report to moderator
n0nce
Hero Member
*****
Offline Offline

Activity: 882
Merit: 5818


not your keys, not your coins!


View Profile WWW
November 04, 2022, 01:50:22 AM
Merited by ABCbits (1)
 #2

You should be able to complete the whole process on GPU so quickly that the communication overhead in any intermediary steps will impact the address generation throughput a lot.
Do you have a source of entropy that you'd like to use? If not, you may even be able to sample the private key on the GPU.

Simply do the EC math to receive a public key, as well as the SHA256 and RIPEMD160 all on GPU.

This is a Python (CPU) version of what I believe you're trying to make; maybe it can help as orientation: https://github.com/Isaacdelly/Plutus
And some GPU bruteforcing tools: https://github.com/bkerler/opencl_brute

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6726


bitcoincleanup.com / bitmixlist.org


View Profile WWW
November 04, 2022, 07:20:18 AM
Merited by ABCbits (1)
 #3

A more important question would be, how are you going to move those addresses back to host memory? CUDA has a copy-memory-between-device-and-host function, but I am not so sure about OpenCL - at any rate, calling such a function for each address would be very slow, and I advise you to fill up a block of device memory with address bytes before copying it to the host RAM.

@n0nce

You can't directly collect entropy from OpenCL's device memory. That requires some *SSL call followed by a copy-from-host-to-device call.

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

Activity: 77
Merit: 7


View Profile WWW
November 04, 2022, 07:49:50 AM
 #4

A more important question would be, how are you going to move those addresses back to host memory? CUDA has a copy-memory-between-device-and-host function, but I am not so sure about OpenCL - at any rate, calling such a function for each address would be very slow, and I advise you to fill up a block of device memory with address bytes before copying it to the host RAM.

@n0nce

You can't directly collect entropy from OpenCL's device memory. That requires some *SSL call followed by a copy-from-host-to-device call.

Thank you I will check them out.

A more important question would be, how are you going to move those addresses back to host memory? CUDA has a copy-memory-between-device-and-host function, but I am not so sure about OpenCL - at any rate, calling such a function for each address would be very slow, and I advise you to fill up a block of device memory with address bytes before copying it to the host RAM.

@n0nce

You can't directly collect entropy from OpenCL's device memory. That requires some *SSL call followed by a copy-from-host-to-device call.

I am working with Rust but for example sake, on PyOpenCL I have previously used "enqueue_copy" to copy a GPU Buffer back to host Memory, you are correct however that to make the program more streamlined and faster I should really fill this buffer before pulling anything back to the host otherwise I will be wasting precious time.

Crack Puzzle #66 Pool - http://www.ttdsales.com/66bit/index.php
PawGo
Legendary
*
Offline Offline

Activity: 952
Merit: 1367


View Profile
November 04, 2022, 08:16:17 AM
 #5

You should be able to complete the whole process on GPU so quickly that the communication overhead in any intermediary steps will impact the address generation throughput a lot.
Do you have a source of entropy that you'd like to use? If not, you may even be able to sample the private key on the GPU.

Why not to use any build-in RNG? Or you may generate them on CPU (using your favorite method), copy to GPU and then generate addresses.

Maybe look at that project: https://github.com/bstatcomp/RandomCL (https://link.springer.com/article/10.1007/s11227-019-02756-2)
dlystyr (OP)
Jr. Member
*
Offline Offline

Activity: 77
Merit: 7


View Profile WWW
November 04, 2022, 12:30:43 PM
 #6

You should be able to complete the whole process on GPU so quickly that the communication overhead in any intermediary steps will impact the address generation throughput a lot.
Do you have a source of entropy that you'd like to use? If not, you may even be able to sample the private key on the GPU.

Why not to use any build-in RNG? Or you may generate them on CPU (using your favorite method), copy to GPU and then generate addresses.

Maybe look at that project: https://github.com/bstatcomp/RandomCL (https://link.springer.com/article/10.1007/s11227-019-02756-2)


I was actually looking at going for an RNG implementation, but I did not know whether to create the whole key or just part of the key on the GPU but it appears the whole key is better.

You can't directly collect entropy from OpenCL's device memory. That requires some *SSL call followed by a copy-from-host-to-device call.

I got curious and did quick google search. I found presentation file which state there are 5 OpenCL RNG library/implementation (Random123, MTGP, OpenCLRNG, RANLUXCL, MWC64X). But i don't know whether it directly collect entropy from GPU or not.

[1] https://dotneststatic.com/media/gpuday/GPUDay2019/talks/thursday/7_IstvanKiss.pdf, page 20

Thanks for looking, I will check them out also.

Crack Puzzle #66 Pool - http://www.ttdsales.com/66bit/index.php
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!