|
1 | 1 | # BitCrack |
2 | 2 |
|
3 | | -A set of tools for brute-forcing Bitcoin private keys. Currently the project requires a CUDA GPU. The main purpose of this project is to contribute to the effort of solving the [Bitcoin puzzle transaction](https://blockchain.info/tx/08389f34c98c606322740c0be6a7125d9860bb8d5cb182c02f98461e5fa6cd15): A transaction with 32 addresses that become increasingly difficult to crack. |
| 3 | +A tool for brute-forcing Bitcoin private keys. The main purpose of this project is to contribute to the effort of solving the [Bitcoin puzzle transaction](https://blockchain.info/tx/08389f34c98c606322740c0be6a7125d9860bb8d5cb182c02f98461e5fa6cd15): A transaction with 32 addresses that become increasingly difficult to crack. |
4 | 4 |
|
5 | | -Currently this project is CUDA only, but I would love to bring it to other architectures if there is enough interest in the project. |
6 | 5 |
|
7 | | -## Build dependencies |
| 6 | +### Using BitCrack |
8 | 7 |
|
9 | | -Visual Studio 2017 |
| 8 | +#### Usage |
10 | 9 |
|
11 | | -CUDA Toolkit 9.2 |
| 10 | +Use `cuBitCrack.exe` for CUDA devices and `clBitCrack.exe` for OpenCL devices. |
12 | 11 |
|
| 12 | +Note for OpenCL builds: the .cl files must be in the same directory as clBitCrack.exe, as these are compiled on the fly. |
13 | 13 |
|
14 | | -## Using the tools |
15 | | - |
16 | | -### Usage |
17 | 14 | ``` |
18 | | -BitCrack.exe [OPTIONS] [TARGETS] |
| 15 | +xxBitCrack.exe [OPTIONS] [TARGETS] |
19 | 16 |
|
20 | 17 | Where [TARGETS] are one or more Bitcoin address |
21 | 18 |
|
22 | 19 | Options: |
23 | 20 |
|
24 | 21 | -i, --in FILE |
25 | | - Read addresses from FILE, one address per line. If FILE is "-" then stdin is read. |
| 22 | + Read addresses from FILE, one address per line. If FILE is "-" then stdin is read |
26 | 23 |
|
27 | 24 | -o, --out FILE |
28 | | - Append private keys to FILE, one per line. |
| 25 | + Append private keys to FILE, one per line |
29 | 26 |
|
30 | 27 | -d, --device N |
31 | | - Use device with ID equal to N. Run CudaInfo.exe to see a list of available devices. |
| 28 | + Use device with ID equal to N |
32 | 29 |
|
33 | 30 | -b, --blocks BLOCKS |
34 | | - The number of CUDA blocks. |
| 31 | + The number of CUDA blocks |
35 | 32 |
|
36 | 33 | -t, --threads THREADS |
37 | | - Threads per block. |
| 34 | + Threads per block |
38 | 35 |
|
39 | 36 | -p, --per-thread NUMBER |
40 | | - Each thread will process NUMBER keys at a time. |
| 37 | + Each thread will process NUMBER keys at a time |
41 | 38 |
|
42 | 39 | -s, --start KEY |
43 | | - Start the search at KEY. KEY is any valid private key in hexadecimal format. |
| 40 | + Start the search at KEY. KEY is any valid private key in hexadecimal format |
44 | 41 |
|
45 | 42 | -r, --range RANGE |
46 | | - Number of keys to search. |
| 43 | + Number of keys to search |
47 | 44 |
|
48 | 45 | -c, --compressed |
49 | | - Search for compressed keys (default). Can be used with -u to also search uncompressed keys. |
| 46 | + Search for compressed keys (default). Can be used with -u to also search uncompressed keys |
50 | 47 |
|
51 | 48 | -u, --uncompressed |
52 | | - Search for uncompressed keys. Can be used with -c to search compressed keys. |
| 49 | + Search for uncompressed keys, can be used with -c to search compressed keys |
53 | 50 |
|
| 51 | +--list-devices |
| 52 | + List available devices |
54 | 53 |
|
55 | 54 |
|
56 | 55 | ``` |
57 | 56 |
|
58 | | -### Examples |
| 57 | +#### Examples |
59 | 58 |
|
60 | 59 |
|
61 | 60 | The simplest usage, the keyspace will begin at 0, and the CUDA parameters will be chosen automatically |
62 | 61 | ``` |
63 | | -BitCrack.exe 1FshYsUh3mqgsG29XpZ23eLjWV8Ur3VwH |
| 62 | +xxBitCrack.exe 1FshYsUh3mqgsG29XpZ23eLjWV8Ur3VwH |
64 | 63 | ``` |
65 | 64 |
|
66 | 65 | Multiple keys can be searched at once with minimal impact to performance. Provide the keys on the command line, or in a file with one address per line |
67 | 66 | ``` |
68 | | -BitCrack.exe 1FshYsUh3mqgsG29XpZ23eLjWV8Ur3VwH 15JhYXn6Mx3oF4Y7PcTAv2wVVAuCFFQNiP 19EEC52krRUK1RkUAEZmQdjTyHT7Gp1TYT |
| 67 | +xxBitCrack.exe 1FshYsUh3mqgsG29XpZ23eLjWV8Ur3VwH 15JhYXn6Mx3oF4Y7PcTAv2wVVAuCFFQNiP 19EEC52krRUK1RkUAEZmQdjTyHT7Gp1TYT |
69 | 68 | ``` |
70 | 69 |
|
71 | 70 | To start the search at a specific private key, use the `-s` option: |
72 | 71 |
|
73 | 72 | ``` |
74 | | -BitCrack.exe -s 6BBF8CCF80F8E184D1D300EF2CE45F7260E56766519C977831678F0000000000 1FshYsUh3mqgsG29XpZ23eLjWV8Ur3VwH |
| 73 | +xxBitCrack.exe -s 6BBF8CCF80F8E184D1D300EF2CE45F7260E56766519C977831678F0000000000 1FshYsUh3mqgsG29XpZ23eLjWV8Ur3VwH |
75 | 74 | ``` |
76 | 75 |
|
77 | 76 |
|
78 | 77 | Use the `-b,` `-t` and `-p` options to specify the number of blocks, threads per block, and keys per thread. |
79 | 78 | ``` |
80 | | -BitCrack.exe -b 32 -t 256 -p 16 1FshYsUh3mqgsG29XpZ23eLjWV8Ur3VwH |
| 79 | +xxBitCrack.exe -b 32 -t 256 -p 16 1FshYsUh3mqgsG29XpZ23eLjWV8Ur3VwH |
81 | 80 | ``` |
82 | 81 |
|
83 | 82 | Use the `-r` or `--range` option to specify how many keys to search before stopping. For instance, to search up to 1 billion keys from the starting key: |
84 | 83 |
|
85 | 84 | ``` |
86 | | -BitCrack.exe -s 6BBF8CCF80F8E184D1D300EF2CE45F7260E56766519C977831678F0000000000 -r 1000000000 |
| 85 | +xxBitCrack.exe -s 6BBF8CCF80F8E184D1D300EF2CE45F7260E56766519C977831678F0000000000 -r 1000000000 |
87 | 86 | ``` |
88 | 87 |
|
89 | 88 | Note: |
90 | 89 |
|
91 | 90 | Integer values can be specified in decimal (e.g. `123`) or in hexadecimal using the `0x` prefix or `h` suffix (e.g. `0x1234` or `1234h`) |
92 | 91 |
|
93 | 92 |
|
94 | | -## Choosing the right CUDA parameters |
| 93 | +### Choosing the right parameters for your device |
| 94 | + |
| 95 | +GPUs have many cores. Work for the cores is divided into blocks. Each block contains threads. |
95 | 96 |
|
96 | 97 | There are 3 parameters that affect performance: blocks, threads per block, and keys per thread. |
97 | 98 |
|
98 | 99 |
|
99 | | -`blocks:` Should be a multiple of the number of compute units on the device. The default is 16 times the number of compute units. |
| 100 | +`blocks:` Should be a multiple of the number of compute units on the device. The default is 32. |
100 | 101 |
|
101 | 102 | `threads:` The number of threads in a block. This must be a multiple of 32. The default is 256. |
102 | 103 |
|
103 | | -`Keys per thread:` The performance (keys per second) increases asymptotically with this value. The default is 16. Increasing this value will cause the kernel to run longer, but more keys will be processed. |
| 104 | +`Keys per thread:` The number of keys each thread will process. The performance (keys per second) |
| 105 | +increases asymptotically with this value. The default is 32. Increasing this value will cause the |
| 106 | +kernel to run longer, but more keys will be processed. |
| 107 | + |
| 108 | + |
| 109 | +### Build dependencies |
| 110 | + |
| 111 | +Visual Studio 2017 (if on Windows) |
| 112 | + |
| 113 | +For CUDA: CUDA Toolkit 9.2 |
| 114 | + |
| 115 | +For OpenCL: An OpenCL SDK |
| 116 | + |
| 117 | + |
| 118 | +### Building in Windows |
| 119 | + |
| 120 | +Open the Visual Studio solution. |
| 121 | + |
| 122 | +Build the `clKeyFinder` project for an OpenCL build. |
| 123 | + |
| 124 | +Build the `cuKeyFinder` project for a CUDA build. |
104 | 125 |
|
| 126 | +Note: By default the NVIDIA OpenCL headers are used. You can set the header and library path for |
| 127 | +OpenCL in the `BitCrack.props` property sheet. |
| 128 | + |
| 129 | +### Building in Linux |
| 130 | + |
| 131 | +Using `make`: |
| 132 | + |
| 133 | +Build CUDA: |
| 134 | +``` |
| 135 | +make BUILD_CUDA=1 |
| 136 | +``` |
| 137 | + |
| 138 | +Build OpenCL: |
| 139 | +``` |
| 140 | +make BUILD_OPENCL=1 |
| 141 | +``` |
| 142 | + |
| 143 | +Or build both: |
| 144 | +``` |
| 145 | +make BUILD_CUDA=1 BUILD_OPENCL=1 |
| 146 | +``` |
105 | 147 |
|
106 | | -## Supporting this project |
| 148 | +### Supporting this project |
107 | 149 |
|
108 | 150 | If you find this project useful and would like to support it, consider making a donation. Your support is greatly appreciated! |
109 | 151 |
|
|
0 commit comments