The other day, a friend of mine told me about how he has been playing the Litecoin market for weeks now, and was slowly growing his one Litecoin, into several by just playing on market volatility. I’m not a crypto-currency nut, but this did sound really fun, and low risk. I’m an IT Security Consultant, and cryptography has always interested me. So, why not convert some of my electric bill into LTC and give it a shot? In the process of mining my single Litecoin, I learned a few lessons that I’ll share with you here.
I’m sure by now you’ve all heard about Bitcoin. Litecoin is like the silver to Bitcoin’s gold. It’s worth substantially less, but it still has a healthy market surrounding it. Furthermore, because it’s much less popular the barrier to entry is substantially lower. I chose to play with Litecoin because of how highly specialised Bitcoin mining has become. The barrier to entry for Bitcoin is becoming too high for a project like this, Whereas, the Litecoin algorithm ’scrypt’ is actually built to be somewhat resistant to specialised hardware attacks by FPGAs and ASICS. This means that although GPUs might be more efficient at performing scrypt calculations, they are not orders of magnitude more efficient like with Bitcoin’s algorithm.
Can you make money this way?
I did the math, and based on my rather rough calculations, at the current value of litecoins, and using my ATI Radeon HD 6900, and my AMD Phenom II x6 , the ROI of mining litecoin seems to be about break even. You can look up to see the expected output from your hardware here. That said, I’m still pretty hesitant about the entire process considering that I’ve done my time on a computer repair bench, and I know what excess heat can do to computer hardware over time. To summarise, although for the sake of this experiment, this coin will probably be break even, over the long term I’m sure my thermal compound and GPU fan would suffer over months. But realistically, I’m doing this for entertainment, this isn’t an article about profitable mining, it’s about getting your foot in the door.
Simultaneous CPU and GPU Mining
I’ve decided that I’m going to maximise the equipment in my computer, in order to get to my one Litecoin goal as fast as possible. For this purpose, I’ll use both my GPU, and my hex-core CPU. Simultaneously. During the day while I’m working, I’ll be turning off CPU mining, but at night I’ll be using both at full power.
For gpu mining cgminer seems to be the most popular choice. CPUMiner seems to be the Litecoin preferred CPU miner as the Litecoin wallet natively supports it. I found this attractive as the LItecoin Wallet GUI is pretty nice. The cgminer command line gui is actually very nice as well. There is a windowed GUI available for cgminer, but I found it inferior to its original GUI. Both are clearly pretty mature products that made this process substantially easier.
Pool vs Solo Mining
We have the option of both pool mining and solo mining. At this point pool mining is probably always the wiser choice, per the recommendation of a friend, I jumped on Litebonk.
You’re going to need to create two sets of usernames and passwords. The first one, will be the actual Litecoin pool web account. The second will be individual worker accounts for your miners. This allows you to monitor their individual outputs, and serves as an important security safeguard since these passwords are sent in the clear.
Alright, let’s get started.
Here’s an outline of our gameplan.
1. Download Litecoin Wallet
2. Download CPUMiner and copy to path
3. Choose Pool
4. Sign up with pool
5. Create worker accounts
6. Determine correct server
7. Test Litecoin Miner with settings
8. Adjust cpu priority
9. Do you have a good GPU?
10. Download cgminer
11. Use this batch file or create your own
12. Adjust intensity accordingly
13. Possible errors/issues
1. Download and Run Litecoin Wallet
Run over to Litecoin.org and download Litecoin-Qt from the main page.
Go ahead and open it once it’s installed, and let the block chain start downloading. It’s going to take sometime, so you might as well get it started now.
2. Download CPUMiner and copy to your Litecoin-Qt path.
Typically, litecoin-qt.exe is located at ”C:\Program Files (x86)\Litecoin\litecoin-qt.exe”. So we’re going to want to copy the CPUMiner files into ”C:\Program Files (x86)\Litecoin\”
The CPUMiner project downloads are located here: http://sourceforge.net/projects/cpuminer/files/
You’ll need to download either the win32 or win64 versions depending on if you have a 32bit or 64bit version of windows. I imagine most if not all of you are on 64bit by now.
Get the appropriate version for your computer
Once you have the .zip downloaded, open it and extract it to your Litecoin path.
Extract the CPUMiner files to the Litecoin-QT.exe path
3. Choose a pool
litecoin-project on GitHub has an excellent comparison of Litecoin Pools. Generally the factors that people balance are size, reward type and fee. Larger pools tend to pay out less Litecoin more frequently. Smaller pools tend to get less blocks, but may a larger percentage to each miner. At the bottom of that article, Reward Types, Difficulty and other factors are explains really well to help you make a decision. I chose LiteBonk because it seems to exist in the middle of the road, and I have a couple friends that already mine there.
4. Create an account with the pool
Not all pools require signup, but I actually prefer a pool with a GUI that let me track stats, etc. Sign up is a pretty routine affair. I would recommend using a randomly generated password. Everything that touches cryptocurrencies are often the target of hacking attempts.
Use a randomly generate password, pools are often hacked.
5. Create your worker accounts
Your worker accounts will represent unique accounts for each of your miners, for this example you’ll need at least two, one for your GPU Miner, the other for your CPU Miner. Use randomly generated passwords, these passwords are sent in the clear over the internet.
Use randomly generated passwords, these are not secure.
6. Determine the correct server settings
On every pool, there will be a page that contains the server settings for the pool. In our case we’re looking for the “GetWork Protocol” servers. Often times multiple servers will be listed. If the first one or two don’t work, keep trying. I found that with cgminer, it would only work with the alternate server with Litebonk.com. After later research I learned that often times each server is not necessarily created equally, and may or may not have compatibility problems with your client, even if it’s the same pool operator.
GetWork Protocol Servers is what we want
7. Test Litecoin with your Pool Settings
Open up your Litecoin Wallet, and jump over to the “Mining” tab. At this point you should probably still be downloading the block chain, as evidence by the blue bar moving on the bottom. That blue bar will take some time to complete. Mining while the block chain is catching up, can hurt system performance, although I didn’t have much of a problem.
Fill in the pool information from the pool page
Fill in the details using the information you gathered from the pool server page. Under “threads”, you should ideally select the same number of threads as your computer has virtual cores. In my case, I went one lower, because I wanted to keep one core free for actual computer use. Certain processors might do better with very high thread counts, for me personally, I wanted a little more control.
Give it a shot by pressing “Start Mining”. If it works, you’re good to go on the CPUMining front. If not, might want to checkout section 14, Common errors/issues.
8. Adjust CPU Priority (Optional)
If you’re going to let this thing run overnight with you not around, it probably doesn’t matter. But personally, I like to keep mining in check. It might cost me 1 or 2 hashes, but I often run other processes on my computer that I don’t want to suffer.
I set mine to “Low”
Open up your task manager, and find the minerd.exe process. Right click on it, and go to set priority. I prefer setting it to low, so that the minerd.exe process only uses unused CPU cycles. This means that it will get out of the way if a higher priority application comes along.
9. Do you have a good GPU?
Using the article we posted above, do you have a good GPU? If you have a gaming GPU or something half way decent, you may be able to double your hash output by using your CPU and GPU together. If you do, continue on to the next steps, if not. You’re done. You can skip ahead to either our next series on trading / speculating with Litecoin. Or enjoy your new Cryptomine.
10. Download cgminer
cgminer is being updated pretty frequently, https://github.com/kanoi/cgminer-binaries/ . You can Download, any one of the official binaries, as all of them as of today support Litecoin I’m using 2.11.3 right now. You’ll want to download the .7z or .zip. The 32 vs 64 bit versions matter much less, as the mining is performed in the GPU vs the CPU.
Download the current binaries
11. Use this batch file or create your own
cgminer is a little trickier to get going than cpuminer since there is no gui to run the application for us. But it’s still pretty simple. I run cgminer from a batch file located in the same directly as cgminer. The syntax for running cgminer is as follows:
cgminer –scrypt -o http://serverpath.com:80 -u workerusername -p workerpassword –thread-concurrency 8192 -I 10 -g 1 -w 256
Change the -u and -p values, as well as the server to reflect your mining pool and worker usernames. The other variables in this script are adjustable, but for a novice these default values will work just fine. You can download this as a batch file here. cgminerbatch Just download the .zip, extract the .bat into your cgminer directory, and edit it with notepad to point to the correct path. When you go to save the file. You’ll need to select “Save as”, and then set “Save as type” to “All Files”, before you will be allowed to save the file as a .bat
Select “All Files” from the save as type section, before setting the filename to .bat
Alernatively, you can make a shortcut directly to the file with all of those variables included. Just right click on your desktop, go to create new shortcut, and use browse to either point it to your batch file. Or, point it to your cgminer.exe. If you point it directly to cgminer.exe, you’ll need to copy and paste the variables that appear after cgminer above. i.e.
–scrypt -o http://serverpath.com:80 -u workerusername -p workerpassword –thread-concurrency 8192 -I 10 -g 1 -w 256
So that the full box looks like C:\folder\name\cgminer.exe –scrypt -o http://serverpath.com:80 -u workerusername -p workerpassword –thread-concurrency 8192 -I 10 -g 1 -w 256
Adjust the variables to match your settings
Once it opens, cgminer will start to run, with all settings preloaded. It’ll look like this
This is cgminer running properly
12. Adjust your intensity according
The intensity level is more or less how much load you want to put on your GPU.
10 is actually a pretty good middle of the road number, but if you want to set it higher, or lower, that’s your call! Go to your cgminer window, and press “G” for GPU Management
Press G from the main windows for GPU Management
Once that’s up press I, and set a level between 1 and 20. Press enter when you’re ready. You should hear your GPU fan spin up almost instantly as the low increases and it attempts to take heat off the GPU. Prolonged high intensity mining with only stock cooling may cause damage to your GPU.
Pick a number, between 1 and 20
13. Common Errors / Issues
The errors, that I ran into while I was building this article focused primarily on some stupid little problems.
Firstly, I kept getting the error: ”Rejected Diff 1/0 GPU 0 (target-miss)” This was because, when I was having server pool connection errors, I removed the –scrypt from my file temporarily and forgot it off. If you’re getting that error, you’re not running cgminer with the –scrypt command set.
The other one I ran into involved my cgminer unable to connect to the pool. I got the error:
“Pool 0 slow/down or URL or credentials invalid
Wrong protocol, or problem with the pool”
Turns out, that the primary pool server just didn’t support something with cgminer, but the alternate did. Turns out this is not an uncommon issue, and the typical solution is just to make sure you try all of the pool servers before running to the message boards.
I’m currently mining my one Litecoin right now, once I’ m done with that, I’ll post another article on speculating with them! To check on how much Litecoin you’re generating, you’re going to want to look around the pool’s website. Many will estimate your production for you, as well as provide useful metrics like your average production rate (hash rate). With my setup, I’m averaging about .2LTC/day. Which means by the end of this week, I should have my Litecoin ready to go. Your results of course will vary.
Update 2 May 2013: 1.17 LTC Acquired! I’ve deposited it into my wallet. It looks like the LTC market has stabilised a bit, but let’s see if we can make some…coin.