└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # eclambda 2 | 3 | eclambda is a set of tools for computing elliptic curve interval discrete logarithms using Pollard's lambda algorithm, also known as the kangaroo algorithm. It is GPU accelerated using OpenCL. 4 | 5 | There are two components, a client and a server. Multiple clients can work on the same problem and send their results to the server. 6 | 7 | ## Limitations/things to improve 8 | 9 | - ~~Private key interval cannot be spciefied i.e. limited to an interval of [1, 2^n - 1] for an n-bit private key~~ see `--start` option in the `jobsubmit` usage. 10 | - The client stores distinguished points in RAM. They are lost if the program closes before they can be sent to the server. 11 | - There are no options for tuning the server database 12 | - The only supported curve at the moment is `secp256k1` (the Bitcoin curve) 13 | 14 | # client program 15 | 16 | The client program performs the lambda algorithm on the GPU. Periodically it will sends the results to the server. 17 | Before sending results to the server, progress is saved on disk so that no work will be lost in the event of a failure. For machines with multiple GPUs, multiple instances of the client can be run with a different device specified for each instance (see --list-devices and --device options). 18 | 19 | The client displays the number of distinguished points (DP), total points (TP) and calculation speed (points per second). Note that DP and TP are 20 | not updated until the client contacts the server. The client will contact the server every 3 minutes to check the job status and get the latest 21 | count for DP and TP. DPs's are uploaded to the server every 10 minutes by default. 22 | 23 | 24 | `--name NAME` 25 | Job name 26 | 27 | `--gpu-mem-usage N` 28 | Specify percent of GPU memory to use for points e.g. 0.8 for 80%. 29 | 30 | `--list-devices` 31 | List available GPUs then exit 32 | 33 | `--device N` 34 | Specify the device to use (see --list-devices) 35 | 36 | `--submit-interval N` 37 | Submit points to the server every N minutes. The default is 10 minutes. 38 | 39 | `--host HOST` 40 | Specify the server name to connect to. Default is 127.0.0.1 41 | 42 | `--port PORT` 43 | Specify the port to connect on. Default is 5311. 44 | 45 | 46 | 47 | # server program 48 | 49 | The server accepts results from the client and stores them in a database. Job progress is written to a text file in the working directory. When 50 | the solution is found it is also written to a file. 51 | 52 | `--working-dir DIR` 53 | Specify the working directory of the server. Default is the current directory. 54 | 55 | `--port PORT` 56 | Listen for connections on port PORT 57 | 58 | 59 | The jobsubmit utility submits work to the server. 60 | 61 | # jobsubmit program 62 | 63 | `--host HOST` 64 | Specify the server to connect to. Default is 127.0.0.1 65 | 66 | `--port PORT` 67 | Specify the port to connect on. Default is 5311. 68 | 69 | `--name NAME` 70 | Specify the name of the job. Required. 71 | 72 | `--keylen KEYLEN` 73 | Length of the target private key in bits. Required. 74 | 75 | `--start START` 76 | The lower end of the interval to search. The default is 0 i.e. the beginning of the entire keyspace. The program will search the interval of `[START, START + 2^KEYLEN - 1]`, where `KEYLEN` is specified by `--keylen`. 77 | 78 | `--pubkey PUBKEY` 79 | The public key encoded in hexadecimal, either compressed or uncompressed. If no public key is given, test mode is enabled and a key is automatically generated and displayed. 80 | 81 | `--dbits BITS` 82 | The number of distinguished bits. The default is 18. 83 | 84 | 85 | # Example 86 | 87 | Solving a 65-bit problem 88 | 89 | Start the server 90 | 91 | ``` 92 | eclambda-server.exe 93 | ______ ______ __ ___ __ ___ ____ ____ ___ 94 | / ____// ____/ / / / | / |/ // __ ) / __ \ / | 95 | / __/ / / / / / /| | / /|_/ // __ |/ / / // /| | 96 | / /___ / /___ / /___ / ___ | / / / // /_/ // /_/ // ___ | 97 | /_____ / \____/ /_____//_/ |_|/_/ /_//_____//_____//_/ |_| 98 | EC LAMBDA SERVER 99 | VERSION 1.0 ALPHA 100 | [2020-06-12.16:11:23] [Info] Database thread started 101 | [2020-06-12.16:11:23] [Info] Server started 102 | [2020-06-12.16:11:23] [Info] Waiting for connection... 103 | ``` 104 | 105 | 106 | 107 | Submitting a job to the server 108 | ``` 109 | jobsubmit.exe --name job65 --pubkey 028F75A32E657F80503BC904215711D9717AEA7376AF8B70A0A130FF56F370F7CA --keylen 65 --dbits 20 --host 192.168.0.123 110 | 111 | EC LAMBDA SERVER JOB SUBMITTER 112 | VERSION 1.0 ALPHA 113 | Job name: testjob65 114 | Public key: 028F75A32E657F80503BC904215711D9717AEA7376AF8B70A0A130FF56F370F7CA 115 | Key length: 65 bits 116 | Distinguished bits: 20 117 | ``` 118 | 119 | 120 | Running the client 121 | ``` 122 | eclambda.exe --name testjob65 --gpu-mem-usage 0.9 --device 1 --host 192.168.0.123 123 | ______ ______ __ ___ __ ___ ____ ____ ___ 124 | / ____// ____/ / / / | / |/ // __ ) / __ \ / | 125 | / __/ / / / / / /| | / /|_/ // __ |/ / / // /| | 126 | / /___ / /___ / /___ / ___ | / / / // /_/ // /_/ // ___ | 127 | /_____ / \____/ /_____//_/ |_|/_/ /_//_____//_____//_/ |_| 128 | EC LAMBDA CLIENT 129 | VERSION 1.0 ALPHA 130 | [2020-06-12.16:15:01] [Info] Connecting to 192.168.0.123 131 | [2020-06-12.16:15:02] [Info] Target public key: 132 | [2020-06-12.16:15:02] [Info] X:8F75A32E657F80503BC904215711D9717AEA7376AF8B70A0A130FF56F370F7CA 133 | [2020-06-12.16:15:02] [Info] Y:A4B836212E42F63C8CE2B899E46F44FA7792A730AF836520245A387C8AF93254 134 | [2020-06-12.16:15:02] [Info] Distinguisher: 20 bits 135 | [2020-06-12.16:15:02] [Info] Sending results to server every 10 minutes 136 | [2020-06-12.16:15:02] [Info] Initializing gfx900 137 | [2020-06-12.16:15:02] [Info] Compiling OpenCL kernels... 138 | [2020-06-12.16:15:06] [Info] Initializing... 139 | [2020-06-12.16:15:06] [Info] Generating 59,812,724 starting points (7358.4MB) 140 | ``` 141 | 142 | The server will report the solution when it finds one 143 | 144 | ``` 145 | [2020-06-12.17:25:08] [Info] Checking database for collisions 146 | [2020-06-12.17:25:08] [Info] Found matching points! 147 | [2020-06-12.17:25:08] [Info] Finding solution... 148 | [2020-06-12.17:25:08] [Info] Colliding point: 041634D34BE16F7CD81367A6CDEE08F861042BF57315014C5942300000523876948C85F71DD8BD386E3E4EFB719BD9D5B68815ED6D7BE358A0841F38B61189D67A 149 | [2020-06-12.17:25:08] [Info] Performing walk 1 150 | [2020-06-12.17:25:08] [Info] Performing walk 2 151 | [2020-06-12.17:25:08] [Info] k1: 0000000000000000000000000000000000000000000000009A0667AA8D349361 152 | [2020-06-12.17:25:08] [Info] k2: 000000000000000000000000000000000000000000000001DD61FB2694F19661 153 | [2020-06-12.17:25:08] [Info] k2 - k1 154 | [2020-06-12.17:25:08] [Info] 000000000000000000000000000000000000000000000001435B937C07BD0300 155 | [2020-06-12.17:25:08] [Info] Found valid solution! 156 | [2020-06-12.17:25:08] [Info] Found key for 'testjob65' 157 | [2020-06-12.17:25:08] [Info] Writing solution to testjob65_solution.txt 158 | ``` 159 | --------------------------------------------------------------------------------