jceminer / cn_cpu_miner

Cryptonote CPU Miner
35 stars 23 forks source link

Implement CryptoNight Dark hashing algorithm #25

Open cmarshall108 opened 5 years ago

cmarshall108 commented 5 years ago

CryoNote uses the CryptoNight-Dark hashing algorithm which is optimized for CPU based mining.

Specifications

Last 4 states of the CryptoNight hashing algorithm is replaced with just blake256 in order to achieve more efficient stable hashrate...

#define MEMORY         (1 << 19) /* 0.5 MiB */
#define ITER           (1 << 18)
#define AES_BLOCK_SIZE  16
#define AES_KEY_SIZE    32 /*16*/
#define INIT_SIZE_BLK   8
#define INIT_SIZE_BYTE (INIT_SIZE_BLK * AES_BLOCK_SIZE)
  memcpy(state.init, text, INIT_SIZE_BYTE);
  hash_permutation(&state.hs);
  hash_extra_blake(&state, 200, hash);
  oaes_free((OAES_CTX **)&aes_ctx);
  free(long_state);

Source: slow-hash.c

Links

CryoNote Website CryoNote Github Repository

jceminer commented 5 years ago

Nice, a 512K scratchpad variant, that would be fine to mine on older CPUs I'll take a look, thanks!

jceminer commented 5 years ago

looks easy to implement but where can i get a pool to mine on? jce miner is for pool mining only, no solo-mining

cmarshall108 commented 5 years ago

Feel free to checkout this pool:

jceminer commented 5 years ago

That's exactly what I needed, thanks!

jceminer commented 5 years ago

Done, in 0.33f --variation 17

cmarshall108 commented 5 years ago

Great, thanks!

cmarshall108 commented 5 years ago

I do have a proposed feature that will be implemented into the algorithm. Essentially this feature allows you to mine and submit hash’s using both BLAKE2b and BLAKE2s which gives x32 and x64 machines absolute optimal performance. Currently CryptoNight Dark uses BLAKE2s...

jceminer commented 5 years ago

The cost of the Blake256 on PC is negligible compared to the whole cryptonight loops (even on the Dark one where the loop is shorter). Don't spend time tweaking that part of algo to give advantage to x86/x64. Even the Keccak part takes more time than the Blake.

jceminer commented 5 years ago

The standalone .exe for GPU is an experimental version with some new features, including CN-Dark for GPU, in case you want to take a look.

cmarshall108 commented 5 years ago

Will do, thanks.