Yes, there are many techniques we've tried for around a decade, with each being a filter that helps a certain amount, and nothing being a magic bullet. This doesn't really answer your question, but maybe gives a sense of perspective at least. I've run a range of sites that provide free online compute to people for over 20 years, starting with sites related to number theory that I hosted at Berkeley back in the late 1990s. Cryptocurrency mining wasn't a problem for the first 10 years, since cryptocurrency didn't exist. Before cryptocurrency, the problems were mainly spammers sending out spam emails, people launching attacks or abusively trying to exhaust all resources (disk, cpu, memory, etc.). People using up all resources became a lot easier to deal with the advent of cgroups and Docker (VM's were not a solution since they are too expensive to allocate for each free user).
The next useful filter is to completely disable the network, except for paying customers: this dramatically reduces malicious use, since it's not possible to use CoCalc to launch outgoing DDOS attacks, run port scanners for weaknesses, etc. Disabling the network also discourages crypto miners, since the default crypto mining software typically communicates over the network with a mining pool. Of course, some small percentage of crypto miners will: (1) use a stolen credit card, or (2) manually upload data from a mining pool and manually copy their results out, and similar issues. You then have to deal with each of these problems, and they do cost you time and money. The goal is that they cost you less than the value that comes from having non-paying users, and so far that is the case for us. For (1), using Stripe helps a lot with stolen credit cards, since Stripe is quite good at detecting and preventing use of stolen cards, but they definitely aren't 100%. Regarding (2), there's really no way around having to develop heuristics and scans of your infrastructure to look for malicious and costly behavior, and manually look into it. Indeed, some technique involve silently throttling abusers, so they hopefully don't even realize their attempt to waste your resources is failing.
There's also a discussion of this problem linked to from a big red box at https://sagecell.sagemath.org/
All that said, providing compute as a free service to mathematicians at least, isn't hopeless! People appreciate what we do, and the jerks who try to wrecks things for the rest of us haven't succeeded.