Mining using Khovratovich's Equihash

Hello!
I'm trying to mine using my c# script and i seems to be stuck.
Okay, i have response from server:

{"id":null,"method":"mining.settarget","params":["00083126e978d4fdf3b645a1cac083126e978d4fdf3b645a1cac083126e978d4"]}_

{"id":null,"method":"mining.notify","params":["d5d089334ffb504728d1","04000000","676b6198c0e1ba68f75938e7474c143e62787b5c51846e7c0ae32b2b00000000","3184e60fa06ee728cc94f5f7487ec5bbdefd5b4059f5da89835a447e1974e4ed","0000000000000000000000000000000000000000000000000000000000000000","c11a4459","7750311c",true]}

And i have the Khovratovich's Equihash in C#:


which is taking following parameters:

    _N               The width (number of bits) of the generalized birthday problem, integer divisible by (K+1) _

_ K The length of the generalized birthday problem, small integer_
_ Seed Seed for the problem, to distinguish between solutions. Integer._

I really have no idea what to do next.
Could you explain me what to do?
Thx.

for mining you will also need nonce_1 value, it sends by the mining pool right after you've connected.

then you join in one buffer parameters of mining.notify from second to seventh (should be 108 bytes), append nonce_1 from the pool, append your nonce_2 (nonce_1+nonce_2 should be 32 bytes), and after that use these 140 bytes of so called "block header" to find solutions, according to Protocol Specification[1] paragraph 6.4.1

in this implementation it looks like the block header is called "SEED", but all constants require tweaking.

[1] https://github.com/zcash/zips/raw/master/protocol/protocol.pdf

1 Like

Thanks for the answer!
As i see, the Khovratovich's Equihash is taking uint Seed, how i can use it with a block header which is not uint variable?

his Seed is array on uint32 actually: https://github.com/khovratovich/equihash/blob/master/Source/C%2B%2B11/pow.h#L27

apparently you're supposed to make some bit manipulations to adapt inputs and outputs.

i would recommend you to study some more compete miner, for example Tromp's.