# Mining using Khovratovich's Equihash

**URL:** <https://forum.zcashcommunity.com/t/mining-using-khovratovichs-equihash/17294>\
**Category:** Mining Support\
**Created:** [June 16, 2017, 6:06pm UTC](https://forum.zcashcommunity.com/t/mining-using-khovratovichs-equihash/17294 "2017-06-16T18:06:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wing13](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@Wing13](https://forum.zcashcommunity.com/u/Wing13)\
**Post date:** [June 16, 2017, 6:06pm UTC](https://forum.zcashcommunity.com/t/mining-using-khovratovichs-equihash/17294/1 "2017-06-16T18:06:11Z")

</div>

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.set\_target”,“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#:

> **[GitHub - divinci/khovratovich-equihash-cs: A C# translation of Dmitry...](https://github.com/divinci/khovratovich-equihash-cs)**
>
> A C# translation of Dmitry Khovratovich's original C++11 Equihash reference implementation. - GitHub - divinci/khovratovich-equihash-cs: A C# translation of Dmitry Khovratovich's original 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.

---

<div class="post-metadata">

**Author:** ![mtve](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mtve](https://forum.zcashcommunity.com/u/mtve)\
**Post date:** [June 16, 2017, 7:18pm UTC](https://forum.zcashcommunity.com/t/mining-using-khovratovichs-equihash/17294/2 "2017-06-16T19:18:44Z")

</div>

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](https://github.com/zcash/zips/raw/master/protocol/protocol.pdf)

---

<div class="post-metadata">

**Author:** ![Wing13](https://avatars.discourse-cdn.com/v4/letter/w/a5b964/32.png) [@Wing13](https://forum.zcashcommunity.com/u/Wing13)\
**Post date:** [June 18, 2017, 4:49am UTC](https://forum.zcashcommunity.com/t/mining-using-khovratovichs-equihash/17294/3 "2017-06-18T04:49:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![mtve](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mtve](https://forum.zcashcommunity.com/u/mtve)\
**Post date:** [June 18, 2017, 8:51am UTC](https://forum.zcashcommunity.com/t/mining-using-khovratovichs-equihash/17294/4 "2017-06-18T08:51:06Z")

</div>

his Seed is array on uint32 actually: [equihash/pow.h at master · khovratovich/equihash · GitHub](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.
