Solutions along these lines (though probably not centralized like this one) are interesting alteratives to ads, but if you want to make them acceptable to the end-users you HAVE to make them AT LEAST stoppable and configurable (by the end-users).

Here are some negative effects of abusing the cpu without the user's consent that come to my mind:

- the obvious, energy consumption (and thus money). In some cases it
can be significant, and it will for sure be if these things become
widespread

- it can rev-up the fans, up to extremely annoying noise levels

- on the many old devices that are unable to keep the temperatures
down on high loads it can warm-up the device up to dangerous
levels, high enough to:
- make the device protection features shut it down
- make the device catch fire, if there are no protection features
or they don't work well enough
- ruin some components of the device
- in any case for sure reduce the lifetime of some components
- it lowers battery life on battery-powered devices

- it can easily interfere with the other activities of the user: a
process using a lot of cpu time will easily reduce the performance
of other parts of the system, even if the user were to lower its
priorities

- on the many browsers that don't allow constraining the resources
allotted to individual tabs/servers/scripts it can interfere with
the usage of the browser

- even on the browsers that do support constraining the resources it
will easily require some annoying work on the part of the user to
investigate which tab/server/script is responsible

So you _might_ activate them by default when (really) throttled to a low cpu usage amount, as others suggested, but if you do so you must make them easy to turn off or to configure to a lower usage.

You should consider that an user might be concurrently visiting multiple sites that use this thing, so individual low cpu usages can add-up to a considerable amount.

It might be better indeed to have a means to configure all instances of the script from a single place; I know, hard to do probably.

But really, at least until/if these things become widespread, well understood and standardized (possibly with apis to let the browser control them automatically), it is much better to activate them only at the request of the user.

How to push users to opt-in, without being obtrusive?

Make a big button "DISABLE ADS", with a smaller writing under it "by switching to cryptomining".

When the user clicks it, replace it with two buttons "Turn-off cryptomining - (by re-enabling ads)" and "Configure cryptomining".

Someone might think that it would be unjust to let the users configure the amount of cryptomining, but in reality:

- there are already unfairnesses in the facts that
- users with more energy-hungry systems will pay more than others
- users with more powerful systems will mine more and thus give
more money to the sites and the others involved
- it will always be possible to block them entirely with
script-blockers or other means; that's the state of things and we
should be glad that it's so: Internet would probably become a much
less useful sh*t in the unlikely event that blockers became
preventable; an unprofitable internet would most likely have still
much more potential than one that supported forcing ads or scripts
to the end-users.