Author

Topic: Is A Javascript Based Miner At All Possible? (Read 2594 times)

newbie
Activity: 49
Merit: 0
I ran it locally, and yea it works after I place it on webserver. thanks a lot.
hero member
Activity: 560
Merit: 517
Hmm ... did you run it locally or on a server? It might need to be run on an actual webserver, but I don't remember for sure. Google Chrome in particular gets cranky when JavaScript is run off the filesystem.
newbie
Activity: 49
Merit: 0
Hey fpgaminer, I just tested your javascript miner and it didn't work at all, I mean it didn't return any hash/s value. I try to manually execute 'begin_mining()' with console in Google Chrome's developer tool and got this:

Quote
begin_mining()
Error: SECURITY_ERR: DOM Exception 18

I'm no good programmer, so I don't know what exactly it means. Do you have any ideas about this issue? Thanks Smiley
hero member
Activity: 560
Merit: 517
I took a break from my FPGA miner to throw together a JavaScript miner, mostly for educational purposes. It's on GitHub:
Bitcoin-JavaScript-Miner

If you upload it to a server, it functions. My system gets about 8khash/s, which is just cute  Tongue but that's actually a bit more than I expected.
It hasn't been tested for accuracy, so for all I know there's a bunch of bugs in the hashing code.
It doesn't do a real getwork, nor does it submit work (if it ever actually finds a share ...)

But I commented the code, and tried to make it as clear as possible. The real grunt work is in miner.js, so look there if you want to know how Bitcoins are mined.
work-manager.js is where miner.js is called from. Since a real getwork isn't actually used, there isn't much to see there. Normally it would talk to a mining pool server, and do a "getwork" request, which gives you the information you need to execute the code in miner.js. Once a valid hash is found, that would be returned to the mining pool server.


Enjoy! If I have the motivation and time I'll see what I can do to A) make sure it's bug free, and B) make it work with an actual mining pool ... just for giggles.
sr. member
Activity: 280
Merit: 252
Slush made a Javascript miner a while ago. Never released it as he made it for his own test purposes. But here's the thread:
https://bitcointalksearch.org/topic/m.24236

Thanks for that, I have just PM'ed him for the basic code. Just want a basic understanding of how a bitcoin is generated, and I believe javascript could show this in the simplest format.
full member
Activity: 222
Merit: 100
The limit doesn't matter unless a single mining operation (hashing I suppose?) would take longer. You can just make the mining function call itself in some time intervals.
member
Activity: 61
Merit: 10
Most browsers have a limit for how long a script can run when you load a page.  I think about 30 seconds.
hero member
Activity: 714
Merit: 500
Slush made a Javascript miner a while ago. Never released it as he made it for his own test purposes. But here's the thread:
https://bitcointalksearch.org/topic/m.24236
member
Activity: 112
Merit: 10
Isn't this what ATI is designing for their new 6000 series architecture?

I would link to the youtube videos but the "Subcription" feature is getting updates right now so I cant access their channel, however here is a caveat to look at: http://blogs.amd.com/developer/2010/09/15/hardware-accelerated-web-with-amd-and-internet-explorer-9-beta/
sr. member
Activity: 280
Merit: 252
It'll be more interesting when WebCL becomes available in browsers:

http://www.conceivablytech.com/5978/products/webcl-to-enablegpu-accelerated-web-apps

Whoaaaaa nelly, thanks for the link.
legendary
Activity: 1078
Merit: 1005
It'll be more interesting when WebCL becomes available in browsers:

http://www.conceivablytech.com/5978/products/webcl-to-enablegpu-accelerated-web-apps
sr. member
Activity: 280
Merit: 252
Check this out: http://www.webtoolkit.info/javascript-sha256.html

Apparantly you can create sha256 hashes through javascript in your browser.

So, can you mine with it?

Maybe with some node.js on the server?
Jump to: