What to mine? Choosing between Cuckatoo31+ and Cuckaroo29

Grin’s dual PoW system present miners with a choice: should they mine the GPU oriented Cuckaroo29, or the ASIC oriented Cuckatoo31+?

First of all, let’s assume you want to mean mine with a GPU. CPUs kind of suck at the whole Cuckoo Cycle family, and lean mining is inherently very inefficient on all types of DRAM.

The two PoWs have rather different memory requirements.
The current cuckaroo_cuda_29 grin-miner plugin requires close to 5.5 GB, while both cuckatoo_mean_gtx_cuda_31 and cuckatoo_mean_rtx_cuda_31 require close to 11 GB.

So if your GPU has under 5.5 GB then your only choice is to wait
for a 3rd party miner that has even lower memory requirements. It appears possible to get under 4 GB by computing all siphashes twice, but I have no plans yet to implement that myself.

If you have at least 5.5 GB but less than 10.5 GB then the choice is simple: use cuckaroo_cuda_29, or C29 for short.

If you have at least or close to 11 GB, then you have a real choice.
First, your choice between cuckatoo_mean_gtx_cuda_31 and cuckatoo_mean_rtx_cuda_31 depends on whether you have a Pascal based GTX card like the 1080 Ti, or a Turing based RTX card like the 2080 Ti. Let’s call that the C31 miner. The + in Cuckatoo31+ signifies that you could also mine C32 or C33 or …, each of which doubles the memory requirement of the previous one. Those miners have yet to be implemented though, so we’ll ignore them for now.

Assuming you want to maximize your chances of an acceptable solution,
the choice between C31 and C29 depends on 3 factors:

  1. your graph-rate on C31, denoted GPS31
    1a) your fidelity on C31, denoted F31

  2. your graph-rate on C29, denoted GPS29
    2a) your fidelity on C29, denoted F29

  3. the secondary scale, or as I like to call it, ar_scale (for asic resistant)

Fidelity of a miner is the probability of it finding 42-cycles in graphs that have them. Normally that should be over 0.999, so we can consider it equal to 1 for all intents and purposes. But when a (mean) miner is constrained by available memory, it has to spill a small fraction of edges that do not fit into the buckets and this reduces the fidelity. Notably, the cuckatoo_mean_cuda_rtx_31 miner has a reported fidelity of about 0.7

Your solution rate at mining C31 is going to be GPS31 * F31 / 42 solutions per second, since the probability of a random graph having a 42-cycle is 1/42. The probability of a C31 solution being accepted is
weight(31) / difficulty. To be precise, the cyclehash of the solution, viewed as a fraction in [0,1) has to be below weight(31) / difficulty. So your reward rate will be

(GPS31 * F31 / 42) * weight(31) / difficulty.

Similarly, your reward rate for mining C29 will be

(GPS29 * F29 / 42) * ar_scale / difficulty.

This is where the variable header field ar_scale comes in. Higher values make it easier to get C29 solutions accepted, while smaller values make it harder. It starts out at weight(29) in genesis, and is then adjusted every block to try move the balance between C29 and C31 rewards toward the goal balance at that height. E,g, 90%-10% at launch 45%-55% after 1 year, and 0%-100% after 2 years. If the total C29 hashpower is 9x that of the C31 hashpower, then we expect ar_scale to remain close to weight(29). But the C29 hashpower could easily be more than 10x the C31 hashpower, which would cause ar_scale to drop. That makes mining C31 more attractive. Eventually we expect C31 ASICs to show up and tip the balance in hashpower. Once they push ar_scale to values well above weight(29), all GPUs will be better off mining C29. But at least they only compete against other GPUs there. C31 ASICs won’t be able to take away any of the prescribed C29 rewards.

Putting everything together, we see that C31 mining is preferred when

(GPS31 * F31 / 42) * weight(31) > (GPS29 * F29 / 42) * ar_scale,

or in other words, when

ar_scale < weight(31) * (GPS31 * F31) / (GPS29 * F29).

Relevant weight values are weight(31) = 31 * 2^8 = 7936
and weight(29) = 29 * 2^6 = 1856.

The value weight(31) actually starts changing after one year, to force a migration to Cuckatoo32+. Over the course of 31 weeks it will linearly drop from 31 * 2^8 to 0 * 2^8. So remember that as you make the choice next year…

Happy choosing!

Also see the related post https://forum.grin.mw/t/on-dual-pow-graph-rates-gps-and-difficulty


Hi Tromp, thank you for the write up. Let me see if I get this straight by plugging in some numbers

Assuming my 1080ti does the following:

cuckatoo_mean_cuda_rtx_31: 2.65 GPS (can’t get mean working as out of memory :\ )
C29: 4.3

And constants:
ar_scale is weight(29)
weight(29) = 1856
weight(31) = 7936

plugging into the formula, ar_scale < weight(31) * GPS31 / GPS29.
it seems C31 is way preferred as the right side only comes to 4890.79.

In practice, how would the ar_scale be determines? Do we look at past block type?


Like I said, ar_scale is adjusted every block to try move the balance between C29 and C31 rewards toward the goal balance.

If the past 60 blocks have more than 6 (initial goal of 10%) of type C31, then ar_scale tends to increase, and if fewer than 6, it will tend to decrease. The actual code is in function secondary_pow_scaling at line 316 of https://github.com/mimblewimble/grin/blob/master/core/src/consensus.rs

1 Like

Great explanation once again.

Will we have access to that ar_scale on the explorer?
Or is it possible to calculate it - maybe knowing the balance between C29 and C31?

Thank. I would like to see an online service with the display of coefficients and estimated efficiency of some video cards on different algorithms.

Just curious - I did not read deeply into the miner sources yet, but are this numbers available to the mining software over stratum? Because it would be great if (later) some 3rd party miner could detect if the one or the other gives better reward (in case both work on the system) and tries to aim for balancing it too.

Since there are only few 11G cards among miners but a lot of 8G it may even be that a balancing could pick cuckato-31-lean in the beginning over cuckaroo-29 mean. At least for a limited time that may happen.
What do you think?

Yes, both GrinScan and GrinExplorer show the AR scale of the blocks. Just look at the latest block to get an idea what the scale currently is.

Looking at https://floonet.grinexplorer.net/block/01cc04ecbb0b1e486c5fd2e91b6703b1c71e7c4089440f36192fe5023ca162e3

that would be “Secondary Scale - 542” correct?

Correct, and “AR scale” on GrinScan.

Thanks for explaining. It was extremely useful information for newcomers like me but I’m having trouble reconciling the numbers.

Using block 12,008 as an example, Total Difficulty was 635,576,754.

Assuming I’m mining on C31, am I right to say that in the event that my miner has a solution, the probability of it getting accepted in block 12,008 was

7936 (weight) / 635,576,754 (difficulty) = 0.001248629681632%?

The theoretical probability seems to be too low. Am I using the wrong difficulty to calculate?

Total difficulty is the sum of difficulties from genesis to current block.
You should instead use the target difficulty of 84,490 …

1 Like

Hi Diemen,
I saw in 2016, and following since, the first article on MimbleWimble and it immediatly caught my attention.
A few weeks ago I bought myself a rig(je) and wanted to mine Beam but I am not sure anymore.
With a company behind it is more vunerable to outside influences.
I see there is not much mining done on cuckatoo31+.
But with 1080ti cards it would be better to mine with cuckatoo31+ right?
Just looking at the probability that I would ‘hit’ a block.
So dont know right now…

Will there be a cuda miner or only open cl for mainnet?
Thank you?

Would be nice to exclude mining farms.So lets say everything above 50 or 100 gpus would be excluded.
I dont know if it is possible to achieve that but it would give more power to the ‘people’.


That is not possible.

That would be a real community driven coin instead of centralised farms with a few owners, right? But if it is not possible it is not possible

Hi lolliedieb, question about your question. :blush:

Since there are only few 11G cards among miners but a lot of 8G it may even be that a balancing could pick cuckato-31-lean in the beginning over cuckaroo-29 mean. At least for a limited time that may happen.

What does it mean with lean or mean mining? I am going to mine grin but don’t know which one I will have to use,with 6 1080ti. Cuckoo 29 with a lot of hash or cuckoo31+ with a few miners.

To make a long story short we have two PoWs here, cuckaroo-29 and cuckatoo-31.

Both each have two algorithm types to mine, lean and mean mining. The first type uses much less memory but requires memory access in a way thats not efficient on a GPU while second works much faster on GPU.

The 31-mean miner will only work on GPUs with 11G memory at the moment. So we can estimate the hash rate is rather low. I just anticipated it may be that although not efficient on GPU 31-lean gives more profit then 29-mean.

I’ve been mining with CUDA on Ubuntu. Check this tutorial out:

1 Like

And which page tu use from github? 1) MimbleWimble / grin-miner or 2) grin-pool/ grin-pool. Or is it the same miner? Thanks