Java code for Bitcoin Mining?

1

2

I am a student and doing research on Bitcoin. I wanted to know how mining is done but I wanted it see the some basic java code. Can some one provide me with resources? I would appreciate if some one can suggest me some libraries to look into. I checked BitcoinJ but found out that it does not support mining.

Thanks

EmbarkPro

Posted 2015-04-06T18:52:22.397

Reputation: 11

There are several mining clients written in Java. https://en.bitcoin.it/wiki/Mining_software Does one of those answer your question?

Nick ODell 2015-04-06T19:03:20.483

@coder121: does it need to be a Java library? Which platform are you running it on? Android, per chance?Wizard Of Ozzie 2015-04-10T12:38:59.037

@WizardOfOzzie It should be Java. I am not running on any mobile device. I wanted to run it on my pc.EmbarkPro 2015-04-12T16:07:05.750

Answers

3

One of the very fist GPU miners was in java using OpenCL. It was called DiabloMiner and you can find the source here;-

https://github.com/Diablo-D3/DiabloMiner

It hasn't been updated the the past two years but it is still fully functional.

MineForeman

Posted 2015-04-06T18:52:22.397

Reputation: 41

2019- Does not support the current protocolscopessuckM8 2019-06-07T00:44:20.267

Will surely look into this.EmbarkPro 2015-04-15T18:19:50.753

2

I'm not aware of any Java mining code existing, and I would not expect it to: mining needs to be as fast as possible, so you wouldn't want to write it in a language that runs on a virtual machine.

Since the reference implementation, Bitcoin Core, stands as the ultimate documentation of the protocol, and it is written in C++, I would say that anyone doing research on Bitcoin needs at least a competent reading knowledge of C++. Once you have that, you can read the mining code in Bitcoin Core.

Nate Eldredge

Posted 2015-04-06T18:52:22.397

Reputation: 21 420

Thanks Nate. But I am not competent in C++ .Hence I am looking for something in Java.EmbarkPro 2015-04-15T18:19:34.850

@Coder121: My point is that I think your best bet to reaching a full understanding of this process is to learn enough C++ to read the existing code. I don't think it will be a tremendous leap if you already know Java.Nate Eldredge 2015-04-15T19:42:50.733