Diversifying PoW with RandomX and/or other algorithms

I wonder what is the community’s opinion of adding RandomX or other PoW algorithm(s) to the consensus mechanism. In short, a portion of the block reward could be given to RandomX or other algos. The idea is to decentralize mining.

To maintain security, the portion given to equihash ASICs could go down very slowly?

Just an idea that I think could be a big improvement for Zcash. I can come back and discuss in more detail later but I wanted to throw the idea in early to see if anyone has interest, similar ideas, show-stopping problems, etc.

Why or why not?

Here is a single-shot to GPT4 asking what is special about RandomX:

3 Likes

I support adding a GPU friendly algorithm to Zcash again. If it’s RandomX, or Ethash as I suggested in another thread or something else.

Zcash is likely going hybrid PoW/PoS before full PoS, so what’s the advantage of keeping the current (ASIC dominated) Equihash algorithm as the PoW half of the consensus?

If the hybrid PoW/PoS is structured so that the PoW portion cannot successfully 50% double spend attack then the algorithm isn’t as important for network security. We have to fork either way, so it’s the perfect opportunity to bring back hobby miners IMHO.

3 Likes

RandomX is even CPU-friendly which could really open the doors to orders of magnitude more decentralization - even ocassional mining in a web-browser could be possible. I’ve only just begun thinking about this. Maybe someone can jump in with some counterpoints or downsides. I think adding a CPU-friendly algorithm is a homerun.

I’m not a fan of the CPU friendly option TBH. Monero is known for having used it for awhile, and I heard (unconfirmed) that large portion of the hashrate is/was botnets.

I would rather have a slight higher barrier to entry to show that you have some skin in the game, but not so high as to require a $4k ASIC sucking down 3000watts to be profitable.

1 Like

How is a botnet worse than an ASIC farm?

Most people are not wealthy enough to dedicate a GPU to mining. Billions more people might be able to join a “botnet” and earn some small amount. I guess I’ll have to look up the precise definition of “botnet.” It certainly has a bad connotation. But, maybe I want to help people voluntarily join a botnet to help secure the network and earn ZEC.

Edit: I guess if I botnet is defined as malicious malware, that’s not what I want to build. Maybe I can coin a new word … voluntarynet ;9 goodnet ;9 … ChatGPT

That’s the key word “voluntarily” :slightly_smiling_face:. If it’s light load on the CPU a malicious miner (virus) can be hidden on infected computer and the owner won’t detect it. All you need to do is Google Monero malware to see how prolific it is.

Something that takes up your whole GPU to mine would be more noticable.

GPU prices have plummeted since ETH switched to PoS. I just saw an ad on Craigslist the other day the guy was selling Nvidia 1060 cards for $60 a piece.

2 Likes

Well, if the consensus is going to be hybrid, why not prepare for multiple algorithms for different types of hardware? Obviously “complexity” to implement and maintain is a good answer. But, still worth considering adding multiple PoW algos?

At this point I’m leaning towards thinking that PoS transition is not a panacea and maybe not even a good idea. But, this is a weakly held opinion.

The early generation of the AI specific chiplets are coming out and foreseably will eventually replace most all of the gpus currently being used for GPT, image generation, etc.
eventually, this ai stuff is really new

Is that comment in support of the idea that GPUs are “cheap enough”?

Rather than try to anticipate the market, I’m leaning towards maximum inclusivity. I guess the main counterpoint to maximum inclusivity is that mining could become so accessible that even a botnet could do it without you noticing. But, I think there are ways to mitigate that.

Developing pools and libraries for combining small miners could be a fun and profitable space for developing truer decentralization.

Right now we have the devfund and miners (maybe 100s or 1000s (?)). It is alleged that these miners dump all of their proceeds rather uniformly (I dont necessarily believe that). Overall the block reward is not very decentralized.

Wouldn’t it be cool if anyone in the world could use their laptop to mine some small amount in a day?

I had an idea way back around the asic megathread time, that was a hybrid system that involved GPU’s folding for some scientific medical math purpose On some other chain that maybe also had staking or something and then you could only redeem that on the main chain in a one way kind of thing and not actually transact amounts into a larger stake accumulation then earned on this other chain. It’s a somewhat grandoise idea so thats why I think it didn’t really carry on too far, I suppose. It’s also counter intuitive to the sheer amount of electricity the network would use, which was another big point in both the asic mega and PoS discussions that happened just a short time afterwards. I liked it because it becomes more inclusive but doesn’t actually pivot the security dependency away from the asics; they drive the main chain, GPUs use other, people stake andcrunch numbers, send it to the main chain, something like that.
There was another idea back then where basically the blocks were split every-other for asic or gpu, @ChileBob and I tried it out in a sort of test thing back then, it was great fun. I think I remember it coming a little late, and obviously, there is more to the technical aspects of block finding and security, gameability etc that we never discussed.

A twitter poll just for fun:

In a perfect world yes, that would fulfill the dream of decentralized mining and distribution. That was the reason Equihash was selected as the Zcash mining algorithm in the first place:

Equihash is a memory-oriented Proof-of-Work, which means how much mining you can do is mostly determined by how much RAM you have. We think it is unlikely that anyone will be able to build cost-effective custom hardware (ASICs) for mining in the foreseeable future

But sadly that’s not what ended up happening. Bitmain figured out how to make an ASIC for Equihash and we didn’t change the algorithm.

Where there’s money to be made someone will spin up a bunch of Amazon CPU instances or design an ASIC and the regular guys with their laptop CPU will be left in the dust because the difficulty adjusts so high finding a block becomes impossible.

Which is why I suggested:

You can’t beat the game but you can try to level the playing field.

I’m mostly familiar with the history. We should evolve and iterate. If we could do anything from here, what would it be?

What if we added new algorithms and dialed up their share of the block reward over time? Equihash, ethash, randomX… maybe if we kept the ASIC equihash and slowly reduced their share of the block reward in favor of eg ethash and/or randomX. Easier said than done but I think a change like this could be impactful and perhaps worth the effort.

A goal of the mining should be to widely distribute the block reward to many people around the world and I dont think the current setup does a very good job of that.

Zcash started as ASIC-resistant and gave up on that property. I think that’s basically the whole story so far. But, rather than shrug and leave it alone, this is an area that could be continuously tuned towards the properties we want to see. (?)

I’m not sure what engineering effort is involved to tweak mining parameters, my guess is that it’s not a ton.

The hard part is when you want to do so it requires a hard fork and Zcash core teams have been reluctant to fork more than absolutely necessary. So with the upcoming shift to some sort of change in the consensus rules (requiring a hard fork) that may be the best/only opportunity to change the algorithm.

1 Like

Ideally there could be continual adjustments or at least some adjustments without a hardfork (once a hardfork has been made to introduce continual adjustments)? In my current thinking, adjusting the PoW to enhance decentralization, accessibility, etc should be made a priority over some of the more far-out things that are being considered.

1 Like

RandomX or a similar CPU friendly seems like an improvement to me. At minimum it will encourage more people to run full nodes (since it will be cheaper to get started mining).

Of course it will take some development effort to implement and likely adjust over time (to maintain ASIC resistance.

It doesn’t seem like the community had much of a say in assigning development priority.

If there is an opportunity to make money Bitmain will design a chip for it…

I’m not sure if that qualifies truly as an ASIC or more like a bunch of CPUs optimized to efficiently hash randomX. I went down a few rabbit holes and it seems that this so-called ASIC does not preclude CPU mining with normal devices. I bet 1000 laptops could generate a lot more hashpower while people are still able to work and do normal browsing. I haven’t discovered solid numbers but it seems that this is not orders of magnitude more efficient than normal devices and many normal devices can still band together to produce more hashes.

Plus, these risc-v chips sound interesting… its still CPUs so they could theoretically be used for other purposes whereas a true ASIC is always destined to be e-waste in short order.

Edit after some research:

Yeah, 212 kh/s … so a normal i7 or ryzen 7 can do like 5k, an old low-end i3 maybe 0.5k, a nice m2 probably 2.5k, a single vCPU on the cloud maybe 0.25k ish …

So, if you want something that is 100% dedicated to hashing randomX, then this is a nice little box that is on the order of 40 nice computers. But, you can still have people using those 40 nice computers while mining. This “ASIC” doesnt really change the game I don’t think. The whole point of this randomX thought is decentralization, accessibility, and censorship resistance - 100 people on average computers should still be able to out-hash that thing while reading a forum post.

Edit after even more research:

… yeah, it would be really hard / TBD to coordinate many smaller devices at scale … hrm …

1 Like

A difference of 40x is huge.

Say you had 40 people hashing then it could match the output of a single ASIC, true, but the mining reward for the individual will be reduced by the same 40x. This likely makes it not worth doing because the cost of electricity then outweighs the rewards.

Similar to how you can still technically mine Zcash now with your GPU, … and since we’re wandering down rabbit holes :rabbit:

----- warning long boring calculation------

If the old EWBF cuda code was dusted off and updated then you could run it on your old Nvidia 1080 GPU and mine a whopping 465 Sols/s at a cost of 165 Watts.

So that’s: 465 Sols /165W = 2.8 Sols per Watt

In todays Zcash that GPU will make 0.00018 ZEC per day, so in a solid year of mining you would earn 0.0657 ZEC.

So GPU mining for 365 days (at $23 per ZEC) you earn $1.20 in ZEC while your electric (at $0.11kW) cost you ~ $159:man_facepalming:

—end—

True, the ratio isn’t as bad for a RandomX CPU vs ASIC as it is for a GPU vs ASIC in Zcash, but the end result is the same: any algorithm that has a factor of 10x or more disadvantage to an ASIC is very bad for individual hobby miners, but good for ASIC mining farms that have scale and cheap electricity.

Which brings me back to what I mentioned before:

The 3x disadvantage is the reason GPU miners were viable/profitable for ETH until it moved to PoS. By tweaking the power consumption/hashrate settings (depending on firmware/card) ETH miners were able to further reduce the disadvantage to about 2-2.5x.

1 Like