CUDA for SECP-256k1 and Keccak-256

Job ID: 38758941

Budget: ₹1,500 – ₹12,500 INR

The goal is to develop a small application that calculates a hash on CUDA cores. All computations and searches should be performed on the GPU.



The expected outcome of the task is a working application for Ubuntu 20/22/24, along with source code and build/compilation instructions.



- The program takes as arguments the GPU card number and an initial hex hash. Example: ./calc 0 f6406a1636543c04256b64e7d38002a13cf26c645cecf1cf7287e5800000000b

- It loads a file with input data (a set of sorted uint64 numbers) into GPU memory.

- It calculates a uint64 from the hash on the GPU.

- Using binary search, it checks for the presence of this uint64 number in the array. If the number is found, it outputs the hash from which the number was derived.

- The hash is then incremented by 1. Example: f6406a1636543c04256b64e7d38002a13cf26c645cecf1cf7287e5800000000c



Calculating uint64:

1. Private key → Public key (ECDSA on SECP-256k1).

2. Public key → Hashing (Keccak-256).

3. Take the last 20 bytes of the hash to get the address.

4. Obtain the uint.

4.1. Example in Go: binary.BigEndian.Uint64([]byte{hash[0], hash[1], hash[2], hash[3], hash[16], hash[17], hash[18], hash[19]})

4.2. Example in JS: BigInt(`0x${hashString.substr(0, 8)}${hashString.substr(32)}`)

4.3. The hash c3ea4627b15cfdb6869f35ca150f93e6dee40e32 corresponds to the number 14117173119003397682



Example console output:



./calc 0 9f6eb28ac682aff612f1480a374f86c3a5b4b4e531da2a4b2edca050a2c98763

GPU: 0

Start: 9f6eb28ac682aff612f1480a374f86c3a5b4b4e531da2a4b2edca050a2c98763

9f6eb28ac682aff612f1480a374f86c3a5b4b4e531da2a4b2edca050a2c98763

9f6eb28ac682aff612f1480a374f86c3a5b4b4e531da2a4b2edca050a2c9b1c6

9f6eb28ac682aff612f1480a374f86c3a5b4b4e531da2a4b2edca050a2c9dc29

9f6eb28ac682aff612f1480a374f86c3a5b4b4e531da2a4b2edca050a2ca068c

9f6eb28ac682aff612f1480a374f86c3a5b4b4e531da2a4b2edca050a2ca30ef





Sample file:



665827009123879698

5583111258928654999

6419952329182340394

7595130425839639305

15461504444051265698