3 ms·
In addition to simply being rather pissed off about all of this, I was just wondering (don't worry--I'd rather just block ads than actually be arsed to implemen
by tripzilch 9y ago
In addition to simply being rather pissed off about all of this, I was just wondering (don't worry--I'd rather just block ads than actually be arsed to implement it):
If your browser becomes a node in a crypto-mining network, it'll start number crunching and occasionally send the results to some central server for collection.
What if your browser doesn't play nice? What if it sends bad or misleading data?
I'm not sure how Monero exactly does its thing, but I know that for Bitcoin it goes a little something like this[0]: You start out with a quasi-random "salt", I think it comes from the previous block. Then you append a bunch of random bytes to that salt, and hash it (SHA256? or some popular hash function, anyway). The goal is to find just the right random bytes so that the hashed value has the longest run of ones as its least-significant bits. If the length of that run is equal or longer than the current "difficulty level", then you're the lucky winner and you just mined a block of bitcoin! These correct random bytes are hard to find, you have to bruteforce them, but super easy to check: just one hash and see if it has a long enough run of ones.
Because even on decent hardware, odds of personally mining a block are in the order of once-a-year-maybe, people often join mining pools that share the profit. I'm not sure how they make sure everyone in the pool plays fair and divide up the profit based on the amount of work they put in (or amount of hashes they checked). The crypto-miner obviously joins a pool because with the shitty performance of stolen CPU-time over millions of people visiting an infected site for a few seconds, they kind of have to if they want a payout more often than once-a-decade-perhaps-not-even.
Can you mess this up for whoever owns the pool account that the distributed cryptominers send their data to? I suppose if that miner's account tries to scam the pool and report way more hashes checked than they actually did, or something like that, would it ban the account and lose all profit up till then?
What if your browser just reports any bunch of random bytes as "nope, that's not it", without even bothering to hash it? What if one of those just happens to be the winning bytes and it gets discarded and never tested again? Does it even work like that or do the JS miners just pick a random value to append to the salt, hash and test (with the risk of trying certain values more than once).
Even then, I'm certain that you can bugger up whatever protocol these hostile JS miners use, and cause all sorts of "interesting" and costly misbehaviour in the pool. Though I should read up on how these things actually work, the above is just vague guesses based on what I know about bitcoin's crypto/protocol/algorithm (I actually did read the whitepaper once, but it was maybe a decade ago or so) and even vaguer guesses on how these mining pools work (that I haven't digged in to very much).
[0] I'm probably wrong about some details because it's been a while since I read that whitepaper, so correct me if they're interesting details :)