📜 ⬆️ ⬇️

The miner on the site is evil (although it can be good)

Often on Habré you can find comments in the spirit of “Miner is a good replacement / addition to advertising on the site” or “I’d better give 10-40% of CPU”. This article will give arguments why such statements are fundamentally wrong. The article will also suggest how to solve the above problems (not all), allowing the miners to become an additional source of monetization, which can have a positive impact on the web.

Reference: miner is a program for mining cryptocurrency. Can be embedded in sites, bringing the author of the site profit. Mining can use both processor power and video card (javascript can run shaders using WebGL).

Why miner is evil


These reasons may be obvious to many, but proponents for mining do not take them into account.

  1. A user bought an expensive processor / video card most often not for the miners to eat half of the cores. Suppose I spent 20k on the processor. If I lose half of its cores, it turns out that 10k is wasted. And if I bought a cheap processor / video card, then this item is even more critical, because then the resources are more important to me.
  2. Due to unscrupulous miners, not only the open site, but also other sites and even the entire system lags. But if you are a bona fide miner, only part of the resources are not the solution, since :
    • This still does not guarantee the absence of lags.
    • If the user opens several tabs, and minites several sites at once, then we still get an excess, after which the lags begin. In conditions when hundreds of tabs can be opened, such a scenario is very likely.
    • Similarly, we will get exceeded if the user himself has launched some programs.

    Lags due to mining is difficult to control. As a user, I'd rather not open that site at all, than to get lags. Only not always I know about the miner.
  3. If the site did not notify me about mining, it just might interfere with my work. For example, if I bought 8 cores, there will be times when they will be idle, but there will also be times when they are needed all. One of the simplest examples - I decided to watch a movie, but could not do it because of the miner. And no matter how powerful a computer you buy, its resources will be mined by the miner.
  4. Mining is the transfer of electricity to money, so a miner who does not notify me about his work, in fact steals my money, because I have to pay for the electricity I spent.
  5. Miner leads to battery discharge.
  6. Miners can not check whether miners are running on other open sites. Already having opened several tabs it is possible to completely overload the system.
  7. Usually, a certain amount of resources should always be free for normal operation. Miner can not know how many resources are free at the moment.
  8. Miners cause fan noise.
  9. Miner usually acts covertly. For example, when I see a site with ads, I can give preference to another site, that is , I have a choice. But with a miner of choice, I do not have.
  10. Inexperienced users may not understand why the system lags.
  11. When you realize that a miner is bothering you, finding a tab with a miner is very annoying. And even worse, when you did not understand what a miner is bothering you.
  12. Miner honesty is difficult to control. At the same time, conscientious miners are rare.
  13. Heating device (laptop, mobile phone , etc.).
  14. Quite critical financial problems (see below).

In short, miners cause lags, interfere with work, steal money (with the help of electricity), discharge the battery, cause fan noise and completely overload the system when opening several tabs. At the same time, the miner, in contrast to advertising, acts covertly, taking away the user's choice.


Financial difficulties

  1. If all sites began to install miners, the profits that they can receive would also fall, since user resources are limited. Even now, the profit is very small, but what if it falls another 10 times? In this case, the inconvenience to the user, we cause enormous.
  2. Differences in the cost of electricity. For example, part of users spending $ 2 can generate only, for example, $ 1.
  3. Performance. But this item is hardly applicable, since javascript can mine on a video card using shaders written in GLSL. And if we are talking about mining on a CPU, then we mean the currency sharpened just by the CPU - on a video card its mining is impossible or inefficient. And to speed up the CPU, we can use WebAssembly.

Strengthening environmental problems

Previously, electricity for miners was not free, so they were not engaged in unprofitable mining. But when the work began to be shifted to the user, the miner no longer needs to save, which will lead to a much more huge expenditure of electricity.
')
If earlier the consumption of electricity was equal to the market value of the coins (and it was also huge), now it will increase several more times. Very dubious perspective.

Solutions to some problems


p. 2 (lags), p. 3 (interferes with work), p. 6 (several tabs) and p. 7 (leaving free resources) can be tried programmatically, for example, doing a 100% test load every second for a fraction of a second , and checking how many calculations it was possible to carry out. Of the minuses:


Item 5 (battery discharge) - you can decide if the browser will notify you if the device is connected to the network.

Section 8 (fan noise) and Section 13 (device heating) - you can decide if you set the browser setting, what percentage of the resources can be totally involved in the system. This setting should be taken into account by sites. Of the minuses - it can be used to track.



Solution of all points at once (except financial and environmental)


You can solve all the points at once if the browsers blacklist sites with miners that do not comply with the following rules:

  1. Miner must leave at least 50% of free resources, regardless of the system load. If the system is already loaded at 50%, the miner should not work.
  2. The miner should send a special mining notice to the browser. This notification browser will display an icon in the address bar, as well as on the tab itself, as is already done with playing audio.
  3. Miner should not work if the user has prohibited mining on all sites or on the current site.
  4. Miner should not work when running on battery.

Of course, even if the site is on the black list, the user should still be able to enter the site after the appropriate warning. Similarly, the search engines can do, lowering unscrupulous sites in the results of the issue.

The disadvantage is that checking sites is very time consuming, and the miner may not be shown to all visitors. Another drawback - the eighth point is not solved (fan noise).



More advanced solution


A more advanced solution is to embed the mining directly into the browser, then the browser itself will automatically control the execution of all items, and the user will not get any inconvenience (pay attention to the four rules that I mentioned above). The author of the site can only choose which currency to mine.

Benefits

  1. Now all embedded miners will be considered unscrupulous, that is, identifying miners will not be more difficult than they are now. In the previous method, this was complicated.
  2. We can provide the best performance (as well as the worst, since there is no competition between the miners).
  3. The problem with the fan noise has been solved, because now the power setting is stored in the browser itself and is not transmitted to sites, and therefore cannot be used for tracking.
  4. Easy settings for the author site.

In this case, in fact, browsers do not need to block unscrupulous sites on their own, but you can leave it to third-party products, for example, anti-virus programs or add-ons.

disadvantages

The solution has a number of significant drawbacks:

  1. Maintaining this all by browsers is time consuming. Especially time-consuming support for different miner programs from different currencies. On the other hand, browsers can get additional monetization by promoting certain currencies.
  2. The ninth point (lack of benefits, when everyone starts mining), we can not overcome. This means that browser developers have to do a lot of work that may not do any good to the web.
  3. There are a lot of nuances in determining free resources. It’s more profitable for me as a user to turn off mining. However, by turning off general mining, I can forcibly enable it on my favorite sites, so that they will not have to compete with other sites.
  4. Mining profitability is very unstable. Few people want to implement the functionality, the use of which is very doubtful.
  5. None of the problems described in the “Financial problems” section has been resolved.
  6. The ecological problem is not solved, in which the expenditure of electricity increases several times in comparison with the current situation, since the miners no longer need to save on electricity. Well, just by supporting the mining, we support a meaningless waste of energy.


Results


The scheme described above has significant drawbacks, but few will be against it - in extreme cases, you can simply turn off mining in the settings.

But those who are in favor of mining usually do not indicate related problems and their solutions, and without this mining will cause great inconvenience to the user.


It should also be noted:


PS: This article is not the ultimate truth, so it would be interesting to hear other arguments that I missed.

PS: This article is not in favor of or against mining, but merely indicates disadvantages, ways to correct them and advantages. But if you define a point of view, it’s rather against, because without support by browsers it does not make sense, and with support it will never pay off and has a number of other serious problems.

Source: https://habr.com/ru/post/347868/


All Articles