Post
Topic
Board Development & Technical Discussion
Re: How are you guys representing 256-bit ints in C/C++?
by
barrysty1e
on 23/11/2022, 02:52:08 UTC

It's simply a fact that Python is slow; it's an interpreted language. 10 to 15 minutes may still be acceptable in this case, but what if you need to analyze 1 million private keys?
python can handle 1 million private keys.

Quote
Or do something more complex with fewer keys?
like what? what would someone be needing to do exactly? other than make a vanity address or crack a bitcoin address.

Quote
The same program in C or Rust can easily run 10-100x faster; so instead of 3 months a program would run for a day. That's quite significant.
i'm sure the cpu makes a difference too. get a high end cpu and run python on it and it will be just as fast as a low end computer running c. there's optimizations to be made everywhere not just in software.

or just use the same types that bitcoin provides:
https://github.com/bitcoin/bitcoin/blob/master/src/arith_uint256.h
https://github.com/bitcoin/bitcoin/blob/master/src/uint256.h

usable in any c++ program once trimmed down, to 2-3 files.