
Making a case for JavaScript, in-browser Mining - berkes
http://berk.es/2018/02/15/making-a-case-for-javascript-mining/
======
blocksceptic
This idea is fundamentally flawed because mining is ultimately a zero-sum
game. If this approach became commonplace as the author suggests, it would
greatly increase the number of publishers squabbling over much smaller pieces
of the pie.

In any case, you're effectively paying for the mining on your power bill. So
nevermind that this approach disadvantages users who pay higher rates for
electricity or have older, less-power-efficient computers.

~~~
jonfor98
the environmental and social impacts of mining at large scale have to be
considered. it just does not seem wise to spend so much electricity and CO2
for mining.

~~~
berkes
I did consider this, and spent an entire paragraph on it, in my article.

I agree, up to an extent, that mining as whole, has a problem to overcome.
But, so far, there is no way to have a stake other than "electricity". And you
need that stake (in the Proof Of Work) to solve the Byzantine Fault Tolerance.

Proof of stake, or even Proof of RAM (I'm just making that up here), Proof of
Space are alternatives, some are actively being developed. Proof of Stake,
might, potentially, solve this whole "energy wasting" thing.

But the fundamental question is: "Is it a waste of energy"? Is the burning of
energy to secure a decentralized, autonomous, permissionless monetary system a
"waste"? Maybe. but in that case there are far more obvious cases of "wasting"
energy.

------
Santosh83
When I pay in cash (digital or otherwise), I know what I give out in terms of
value for goods or services. This concept of renting out your computer time on
the other hand is vague. How much 'currency' will be mined? Will it be
proportional to the goods/services I get to use in exchange? How long will the
process take? What if my system fails midway during 'payment'? Can this
concept be extended to run arbitrary code in your browser in exchange for the
service? Right now Javascript is at least nominally related to the page you
access. But what if tomorrow the code you're asked to execute is totally
unconnected with the service being offered?

This just smacks of convenience for the implementers and as for the user, it
exchanges a straightforward system for a murky deal.

~~~
scotty79
Actually that's what I like about the idea. Reading prices, considering value
of the things I buy in relation to those prices, picking most worthy
alternative is a job that is assigned to every consumer by free market. I find
it bothersome and after two decades or so of being consumer it is boring for
me. Just saying "pay this guy whatever" without the fear of being taken to the
cleaners sounds very attractive to me.

~~~
SturgeonsLaw
Hopefully it would encourage more interesting, long form content that keeps
people on the page

------
bryanlarsen
Opting in to in-browser mining is either stupid or theft. CPU mining costs
more in electricity than you get out in currency. If you pay for your own
electricity, you'd be better off donating directly. If you don't pay for your
own electricity, you're donating electricity from whoever is paying for that
electricity. This may or may not be theft, but is definitely morally dubious.

~~~
piaste
> If you pay for your own electricity, you'd be better off donating directly.

But to donate directly, you'd need a common payment service. That means
registering (password and two-factor), then either transferring money to your
account or authorizing it to draw from your bank account, and finally sending
the payment, probably revealing a fair few bit of information about yourself
to a website you may like but not necessarily trust. And every step of that
process can be hacked, or have connection problems, or you may be on a
different computer and need to re-login, and so on.

Paying with electricity lets you skip all that, and HN should be well aware
that convenience is worth a lot of money.

In addition to that, with money you must choose how much to donate, and that
is a burden on its own. (Does this blogger deserve one buck, or two? I gave
two to that article last week, and this dude is almost as good, but I've
decided my weekly budget is X €, and I'm almost over it, etc. etc.)

With a JS miner, you pay exactly as long as you keep the tab open, which is a
pretty good proxy for how much the page is personally valuable to you.

~~~
minitech
> With a JS miner, you pay exactly as long as you keep the tab open, which is
> a pretty good proxy for how much the page is personally valuable to you.

I don’t think it is. People open links in new tabs for later, and “later” can
be quite a while.

~~~
philipodonnell
I mean its not like webpages know when tabs aren't active so they can suspend
mining when you're not actively reading the content, right?

And its definitely not true that browsers can actively manage the resources
available to inactive tabs, right?

Just because the current set of options doesn't respect these, that is not a
reason to discard the idea entirely.

------
OscarTheGrinch
If browser mining was a good deal for the end user the vast majority of its
proponents wouldn't feel the need for stealth. As it is implemented currently
It's yet another example of preaditory behaviour killing herbivores at the
digtal watering hole.

~~~
onion2k
_If browser mining was a good deal for the end user the vast majority of its
proponents wouldn 't feel the need for stealth._

Paul Graham might disagree;

"The two most important things to understand about startup investing, as a
business, are (1) that effectively all the returns are concentrated in a few
big winners, and (2) that _the best ideas look initially like bad ideas._ "
(emphasis mine) [From
[http://www.paulgraham.com/swan.html](http://www.paulgraham.com/swan.html)]

Stealth is not necessarily a sign something is bad; it might just be hard to
persuade people that it's good, and that's a reason to be stealthy.

~~~
jellicle
I'm afraid the doctrine of "if it looks bad, it must be good!" is not in fact
true or generally applicable. And it's not what Graham is saying, for that
matter. If you read a bit further:

"It also reminds you that the vast majority of ideas that seem bad are bad."

The idea of running up every web browsing computer to 100% CPU, costing them
tens of dollars in electricity while giving you a few cents of cryptocurrency,
seems bad and is bad.

------
ddebernardy
Please no, the carbon footprint is just too high:

[https://www.wired.com/story/bitcoin-mining-guzzles-
energyand...](https://www.wired.com/story/bitcoin-mining-guzzles-energyand-
its-carbon-footprint-just-keeps-growing/)

~~~
loverofthings
Compared to heating and cooling, and a bunch of other stuff it is negligible.

I guess you could complain about the usefulness of mining.

Well, people do a bunch of useless stuff that has magnitudes bigger carbon
footprint than mining.

Let's not optimize things that are insignificant.

~~~
pavlov
It's not insignificant. Bitcoin mining already consumes as much energy
annually as Denmark – that means the entire country, heating, cooling,
industry, everything:

[https://arstechnica.com/tech-policy/2017/12/bitcoins-
insane-...](https://arstechnica.com/tech-policy/2017/12/bitcoins-insane-
energy-consumption-explained/)

~~~
saint_fiasco
I don't have a good intuition for that kind of heterogeneous comparison.

Can it be compared with other Internet services? How much electricity does
Facebook consume, for example? What about internet advertisements?

~~~
wor3q
It's 5 times what USA use on christmas lights:
[https://phys.org/news/2015-12-christmas-energy-entire-
countr...](https://phys.org/news/2015-12-christmas-energy-entire-
countries.html)

Or 3,5 times what Amazon US-East cluster consumes:
[https://datacenterfrontier.com/amazon-
approaches-1-gigawatt-...](https://datacenterfrontier.com/amazon-
approaches-1-gigawatt-of-cloud-capacity-in-virginia/)

------
trey-jones
I wrote a tool to enable this, and promote responsible use:

[https://github.com/trey-jones/xmrwasp#a-word-about-
responsib...](https://github.com/trey-jones/xmrwasp#a-word-about-
responsibility)

So I guess I'm clearly in favor of it. In general I would prefer opt-in mining
to advertising. If you are interested in why, I'll be happy to discuss. I
think my thoughts are laid out in the README.

I also made a simple demo page here:

[https://www.xmrwasp.com](https://www.xmrwasp.com)

It won't mine unless you ask it to. The point of the demo is to check out what
impact various degrees of mining have on your other activities. The default is
VERY low with a single thread and 50% throttle.

I'm not sure if this is a polarizing topic, or if I'm not thinking clearly
about it because I've gotten on the boat, drunk the kool-aid, or whatever.

------
gwbas1c
When we look at conventional money, (specifically the USD,) "printing" money
is available to almost everyone with decent credit. We print money when we use
credit cards and when we take out a mortgage on a home.

If websites took small payments in a cryptocurrency where mining the
cryptocurrency took about the same amount of time as it takes to consume the
content, then "printing" money is available to almost anyone with a decent
device. It's also a good way to set a price for content; instead of some bozo
thinking that his/her article is worth $3 or $15.

I think that cryptocurrency, as a technology, still has far to go before it
can support this kind of commerce. This is in terms of technological
improvement, scalability, and a design that takes into account how economics
works on a large scale.

------
philipodonnell
HN of all places really surprised me with this reaction. Publishers
_desperately_ need an alternative payment system with the convenience of an
ad-supported model, microtransactions, and a direct payer-payee relationship.
Browser-based mining has a potential to provide that, but it is still very
early and evolving.

Also why is everyone talking about Bitcoin in this thread? No one is trying to
mine Bitcoin in the browser. There are other cryptocurrencies than Bitcoin.
Some of those are designed to run in the browser specifically to address the
concern with using a POW system in an intentionally resource-constrained
environment.

------
viach
> Quite some cryptocurrencies use a mining algorithm for which making
> specialised hardware is impossible

There is a GPU miner for Monero (actually, there is a GPU miner for
everything) which turns in-browser mining into not that profitable idea.

~~~
trey-jones
Cryptonight is specifically designed to be more friendly to CPU mining. You
can read more about that in the Monero team's recent blog post:

[https://getmonero.org/2018/02/11/PoW-change-and-key-
reuse.ht...](https://getmonero.org/2018/02/11/PoW-change-and-key-reuse.html)

It seems they have opted to prefer browser miners and botnets over
centralization caused by dedicated hardware (ASICs).

Profitibility in the traditional sense factors in electricity, but when you're
using someone else's electricity, that's not a consideration. If you have
enough users, the return is quite reasonable for the site owner.

------
mxschumacher
What is groundbreaking about Brave?

~~~
atticusberg
Whenever an advertisement is displayed to you, brave awards you BAT which you
then pay a percentage of to the site owner.

Brave also controls what kind of advertisements you can see and prevents
things like auto playing videos and full screen ads from cropping up.

It also allows you to apportion micro payments to content producers.

Won’t weigh in on whether this makes brave groundbreaking or not, but this is
at least part of what it does that makes it unique.

It also has this whole interface it exposes to advertisers and content owners
I don’t fully understand.

------
ebbv
Is this for real? There is no justification. It’s theft plain and simple.
Nothing has gotten me to turn on NoScript by default but if this becomes
commonplace I will.

I know the author is doing opt-in mining but that’s obviously going to be as
popular as opt-in ad tracking vs automatic. The model will be pages just serve
up the in browser mining without asking.

~~~
berkes
> It’s theft plain and simple

I explicitly made a case for opt-in. How is that "theft"?

And whether or not that is popular is besides the case. If it is impopular, it
still is not "theft", is it?

------
akkadak
[https://medium.com/@fubukilabs/ethical-use-of-browser-
based-...](https://medium.com/@fubukilabs/ethical-use-of-browser-based-
cryptocurrency-mining-4c6c82c1a7f6)

------
afeezaziz
I think the best use case is would be for non-profit that depend on donations
like Wikipedia or perhaps video streaming websites like Youtube(consumed using
Desktop).

~~~
imtringued
Maybe youtube could secretly encode keyframes in your browser.

------
jxub
The fonts and images on the blog are really stylish. Props for the design!

~~~
berkes
Thanks! If you're interested, the blog is in Jekyll, and all of it is open
source ad on github:
[https://github.com/berkes/berkes.github.com/](https://github.com/berkes/berkes.github.com/)

