December 2013 Project of the Month, CPU Miner

“Pooler” is the admin for cpuminer. Here is my interview with him on cpuminer

d.: Tell me about your project, cpuminer…

Pooler: cpuminer was started by Jeff Garzik, a former Red Hat engineer and one of the core developers of Bitcoin. When Litecoin, a clone of Bitcoin using a different hashing algorithm, was launched two years ago, cpuminer was forked and modified to work with it. This initial adaptation was written entirely in C, so I became interested in discovering what kind of performance benefits could be gained by rewriting the most important pieces of code in assembly language for both the x86 and x86-64 architectures.

The performance boost turned out to be very noticeable: the optimized routines were able to mine over two times faster than the original C code. As time passed, I became more and more interested in this project, and decided to start maintaining it. Bugs were fixed, new functionalities were added, and new optimizations for various microarchitectures were introduced.

d.: I’d also like to know what sort of community activity you all have; is there a central place where folks discuss cpuminer?

P: Up until now I’ve done most of the coding myself, probably also due to the fact that the assembly code that I wrote for cpuminer is relatively complex and can take quite some time to understand, but from time to time I receive pull requests for new features and bug fixes. Most discussions about cpuminer take place in a dedicated thread at bitcointalk.org I also see people chat about it every day in the #litecoin channel on Freenode IRC.

d.: What is your view of BitCoin’s influence on other financial software?
P: I believe Bitcoin, and more in general the very idea of a decentralized currency whose security is guaranteed by cryptographic algorithms, has started quite a revolution in the financial world. Many payment processors already exist for Bitcoin and Litecoin, allowing merchants to easily accept payments in bitcoins just like they do with credit cards or PayPal. The fact that anyone can manage his or her bitcoins without the need for a bank or other centralized institution drastically changes the way people relate to money, and creates a new niche of software tools that allow people to interact with their savings. The influence of cryptocurrencies is growing so quickly that I wouldn’t exclude that in the near future banks and e-commerce businesses will be forced to start supporting bitcoins and litecoins as well.

d.: Why LiteCoin, it seems like BitCoin is the 900lb gorilla here…
P: Litecoin is not inherently better than Bitcoin, of course, just like the euro is not inherently better than the US dollar. cpuminer can also mine bitcoins, but it mainly targets Litecoin as Bitcoin mining has now moved to specialized hardware, thus making CPU mining bitcoins way too unprofitable. On the other hand, the recent surge in the price of Litecoin has brought the profitability of CPU mining to new heights, drawing renewed interest in cpuminer.

d.: Who can benefit the most from cpuminer?
P: Anybody who has a computer with a modern, energy-efficient processor and wants to use it to generate some litecoins. Mining may or may not be profitable depending on how much one pays for electricity, though, so it is important to consider all factors before starting. Online calculators exist that allow potential miners to estimate their profits. Aside from actual miners, cpuminer is very useful for developers, as it constitutes the simplest way to test mining-related functionalities and does not require any specialized hardware.

d.: – Have you seen the current climate around personal privacy impact your project?
P: Not really. While one of the main targets of the project is to implement certain cryptographic algorithms so that they can be executed as fast as possible, the project itself has little interest from a purely cryptographic standpoint. I do have noticed that most developers working on cryptocurrency-related projects seriously value their anonymity and privacy, but I think it’s always been like that… just think of Bitcoin’s creator, Satoshi Nakamoto, whose identity remains a mystery to this day.

d.: – What’s the best way to get the most out of using cpuminer?
P: I think one of the best features of cpuminer is that it can detect the characteristics of the CPU it is run on and automatically use the most suitable algorithm implementation. This means that there’s no need to play with options and flags to get the best performance from it.

d.: You have noted the virus risk here; what is the key takeaway from this for users and potential users?
P: Botnet operators have been illegally running miners on their victims’ computers for a long time, and this has caused antivirus suites to
recognize most mining software as malware. Since a malicious programmer could actually exploit this false positive to distribute modified versions of cpuminer, it is important that end users only download binaries from the official repository at SourceForge.

d.: – Are you all doing anything else to mitigate this issue?
P: Since cpuminer is not malware and we have nothing to hide, I believe using techniques to circumvent antivirus defenses would be totally inappropriate. False positives are always possible, so if a given antivirus doesn’t give the ability to whitelist a specific application that the user knows it is safe to use, the problem is with the antivirus, not with the application.

d: What was the first big thing that happened for your project?
P: I think this project would now be largely abandoned if it wasn’t for the launch of Litecoin two years ago, so I would definitely cite that as one of the most important events in the history of cpuminer. It is now utterly pointless to mine bitcoins using ordinary computers, as specialized hardware can mine them a lot faster. This is not the case with Litecoin, as its hashing algorithm is much friendlier to ordinary CPUs.

d.: – What was the net result for that event / effort?
P: The fact that cpuminer can mine litecoins at decent speeds on modern CPUs has brought a lot of new interest to our project. The price of Litecoin has skyrocketed this past month, and many people are willing to invest into it. Not many people have enough money to buy specialized hardware, though. CPU mining, on the other hand, requires no initial investment, and gives pretty much anybody the opportunity to easily earn their first litecents.

d: What is the next big thing for cpuminer?
P: I am currently working on adapting cpuminer to support a new mining protocol, known as “getblocktemplate”, which is typically used for solo mining and by pools. This will make it easier for Bitcoin developers to test mining functionalities, and will finally allow them to get rid of the obsolete internal miner that is still present in the official client for debugging purposes only. I’m also looking forward to write optimized implementations of the Litecoin hashing algorithm for the upcoming 64-bit ARM architecture.

d.: – How long do you think that will take?
P: A full implementation of the “getblocktemplate” protocol may take some time, as the protocol itself allows for a considerable number of extensions. As for the AArch64 implementation, I will postpone its release at least until I can test it on an actual device.

d.: – Do you have the resources you need to make that happen?
P: Unfortunately my job and more urgent projects don’t leave me much time to work on adding new features. Other than that, I’m always looking forward to improving cpuminer!

d.: If you had it to do over again, what would you do differently for cpuminer?
P: I think Jeff Garzik did an excellent job when he wrote the original cpuminer. I don’t think I would have done anything much differently.

d.: – Why?

P: I like the simplicity and modularity of his code. I particularly like how cpuminer conforms to the KISS (“Keep it simple, stupid”) principle, and never tried to provide unneeded fancy functionalities but just tries to do one thing really well.

Thank you to Pooler for taking the time to provide this id-depth look at cpuminer. Congratulations on being selected as the December 2013 Project of the Month!

2 Responses to “December 2013 Project of the Month, CPU Miner”

  1. irctc login Dec 17, 2013 at 2:19 am #

    Lol kiss


  1. PrimioGryfen - Jun 3, 2014

    […] December 2013 Project of the Month, CPU Miner […]