Grin’s unique dual PoW system allows for a smooth transition from GPU

mining to ASIC mining, with guaranteed rewards for the secondary PoW

where GPUs need not compete with ASICs.

The main ingredient for its ASIC resistance is frequent pre-planned PoW changes.

In [0] I introduced Cuckarood as the first tweak of Cuckaroo.

Just like Cuckaroo was only active for the 6 months from Jan 15, 2019 through Jul 17, 2019, so Cuckarood will no longer be active when Grin executes its 2nd pre-planned Hard Fork around Jan 15, 2020.

Its successor, and latest member of the Cuckoo Family,

“Cuckaroom”, was unveiled last Friday at GrinCon1 as can be seen in slides [1] and video [2].

In the earlier post linked above I mentioned 3 aspects of Cuckaroo that could be tweaked:

- the underlying hash function, currently siphash-2-4
- the computation of endpoints of a whole block of edges
- the type of cycle

Where Cuckarood made tweaks in 1) and 3), Cuckaroom makes tweaks in 2) and 3) instead.

Regarding siphash, Cuckaroom reverts to the standard siphash.

Regarding edge block computation, instead of xoring intermediate siphashes with the final one:

```
const u64 last = buf[EDGE_BLOCK_MASK];
for (u32 i=0; i < EDGE_BLOCK_MASK; i++)
buf[i] ^= last;
```

as in Cuckaroo/Cuckarood, in Cuckaroom we xor with all subsequent siphashes:

```
for (u32 i=EDGE_BLOCK_MASK; i; i--)
buf[i-1] ^= buf[i];
```

The biggest change is in the type of cycle. The CuckarooM graph is no longer bipartite, with the ‘M’ standing for ‘Monopartite’.

Cuckaroom29 has 2^29 directed edges on 2^29 nodes, resulting in cycles of all possible lengths, including odd ones, and even including unicycles.

Cuckaroom is implemented in the cuckoo repository at [3].

The proof verification function [4] may serve as the specification,

while Makefile targets simple19/simple29 implement a simple CPU miner and target cuda29 a reasonably performant CUDA mean miner. Due to the alternation of marking starting-points and end-points, this miner takes twice as many rounds to trim a given fraction of edges.

The expected number of 42-cycles in a Cuckaroom graph is 1/42, as it was in Cuckaroo, which is half of Cuckarood’s current value of 1/21.

So we can expect a large drop in C29 solution rate come hardfork time,

from 1) slower solvers, 2) halved solution rate, and the seemingly unavoidable 3) unprepared miners. However, difficulty should adjust within a matter of hours.

In the coming week, I will push Pull Request on grin [5] and grin-miner [6] to implement the PoW changes on the Grin side of things. Then we’ll have a chance to see Cuckaroom activate on Floonet around December 19.

Happy Cuckoo Cycling!

[0] https://www.grin-forum.org/t/mid-july-pow-hardfork-cuckaroo29-cuckarood29

[1] https://github.com/mimblewimble/grin-pm/blob/master/presentations/grincon1/10-cuckaroom-tromp.pdf

[2] https://www.youtube.com/playlist?list=PLvgCPbagiHgrQa5KVt4XixK9t_NbfpkuP

[3] https://github.com/tromp/cuckoo/tree/master/src/cuckaroom

[4] https://github.com/tromp/cuckoo/blob/master/src/cuckaroom/cuckaroom.hpp#L133-L164

[5] https://github.com/mimblewimble/grin/pull/3136

[6] https://github.com/mimblewimble/grin-miner/pull/231