laanwj / bitcoin-qt

Original Bitcoin-Qt repository. No longer used, Bitcoin-Qt was merged upstream.
MIT License
55 stars 27 forks source link

Support for mining? #23

Closed p2k closed 13 years ago

p2k commented 13 years ago

Are there plans to include Bitcoin mining at some point?

So far, Bitcoin clients and miners are separate applications and also there is no platform-independent modular GUI miner out there (I'm on OS X) as far as I know.

I could imagine spending some of my free time to integrate this feature into bitcoin-qt i.e. I'm not just asking but also willing to actually do that.

laanwj commented 13 years ago

CPU mining used to be included in the (Wx) UI about a year ago; however, it was removed because mining was becoming less and less profitable for "normal users", and mining is not really the point of bitcoin so we don't want to focus on it too much.

p2k commented 13 years ago

This is true; you need appropriate hardware or mining doesn't make much sense at all. However, mining is an important part in the whole system. Without miners, no transactions could be made, because they need to be stored in valid blocks which are generated by them. Also, having lots of "good" miners is what effectively secures the system and locks out "bad" miners which try to inject false transactions.

Mining is not very profitable anymore, yes, but it is still necessary and I believe it should be easy for everyone to contribute to the system in that way. Moreover, I consider mining as a donation for which a small tip can be obtained, not a source of profit.

laanwj commented 13 years ago

I agree. But the problem is getting people's hopes up. If you mine in your client, independently, it may take years to generate one block even with a decent PC. Obviously they will complain that they get absolutely nothing. Pooled mining spreads the reward more, hence it is much more popular. This requires an external miner program. Also, miners are very specific pieces of codes these days, geared toward a certain GPU or FPGA or whatever... so there are many advantages to having it as separate external module.

I don't think there are enough use-cases to include mining in the client GUI.

p2k commented 13 years ago

Well, my plan was to add registering and participating in a mining pool right from the beginning - I would even make that mandatory, because indeed, mining on your own doesn't make sense at all. Luckily, all pools do have the same RPC interface, there aren't any external programs which are dedicated to a specific pool.

My more detailed plan for mining support is, to port an existing miner which uses OpenCL to C++/Qt. As far as I've been looking around, Phoenix-Miner is the most suitable. Combined with a nice GUI which lets you configure GPUs and tweak some options, everything should be fine.

It is no problem if you, as this project's maintainer, don't agree with me there. Having the Bitcoin client and a Bitcoin miner in one application is what I personally want for me. I will create a separate branch and commit mining-related code exclusively there so any non-mining parts can still be pulled by you easily. My version will then be subtitled "Miner's Edition".

laanwj commented 13 years ago

If you support connecting to remote RPC mining pools, you are essantially making a "GUI miner". Which is great, as people have requested that, but it has zero overlap with a bitcoin client (To connect to a mining pool you don't need to be connected to the P2P system, and vice versa).

I don't see the point in rolling it into one project. But anyway, if you want to fork, sure, go ahead :)

p2k commented 13 years ago

Ok, you've convinced me. I'll be making a standalone GUI miner in Qt first and then I'm going to combine it with Bitcoin Qt forming a simple 2-in-1 application. You're right, the only link between the miner part and the normal client part is the topic: participating in and supporting the Bitcoin system. There isn't much point in this 2-in-1 app other than the fact that you only have to start one app instead of two.

Thank you for this discussion and your patience. If you don't have anything more to add, the issue can be closed.

laanwj commented 13 years ago

ok I'll close this issue then, good luck with your app!