I’ve recently started mining DOGEcoin, a new cryptocurrency based around an increasingly overused meme. What drew me to it was the fact that each block is solved in a minute and yields a reward of 1-1,000,000DOGE. So in about 3 days of running my mining rig, I’ve collected about 50,000DOGE, worth about $30 at the time of writing this. Here’s what I’ve done and what I’ve learned.
My first step was following this article to build my mining rig. I purchased a Radeon R9 290 for about $500 and used my existing ASUS motherboard, generic power supply, Intel i7 CPU (which is a huge waste of money for its current use), and 100GB SSD (another gross waste of a resources.) I downloaded CGMiner and got it up and running within a few hours on Xubuntu 13.04. From there, my mining computer is running with no monitor - just a USB wireless receiver and electricity - and boots up into mining DOGEcoin automatically.
The upside is that I can get about 750KH/s, which is above average (though I did drop $500 on the GPU). Neutral would be that it draws about 600W/m, or about $40 in electricity costs each month (for a monthly profit of about $250). And the downside is that, when running at full power, it sounds like a jet engine.
I read about how the Bitcoin protocol works in this article and it’s quite interesting. Basically, I am trying to find some number I can append to the end of a series of transactions to produce a hash below a certain target. If I was mining solo with approximately 1% of the network hash rate (so theoretically if there were 100 other people mining with the same equipment as me), I’d find that number (called a nonce) once every 100 minutes. And when I did, I would confirm a group of transactions, add it to the blockchain, and be rewarded with some random number of DOGEcoin under 1 million. As the network hashrate increases, the target for the hash to be under drops, increasing the difficulty. This autoscales to try and make it so one block is solved approximately every minute.
Another interesting thing about mining (best thought of as “verifying” transactions) is what’s known as a 51% attack. If I control over 50% of the network hashrate, I could be the one verifying all of the blocks. In addition to giving me absurd amounts of DOGEcoin and everyone else very little, I could “double spend” - give 1000DOGE to a merchant and the same 1000DOGE to me - and then solve both blocks and withhold one from the blockchain. Apparently this is a problem with the newer currencies that have low network hashrate/low difficulty, as currencies like Bitcoin have so much computational power going into them that it would be impossible to gain a 51% share of the network hashrate.
I’ve also invested about $300 in Litecoin, which I think will see another bubble when it becomes possible to go directly between LTC and USD without needing a BTC intermediary. That is currently not possible on Mt. Gox or Coinbase, but there is talk of introducing it. Until then, the price of LTC has been pretty much directly coupled with BTC - upticks in BTC cause upticks in LTC and the same for downticks. However, mining LTC is not as profitable.
Lastly, it seems the GPU mining for Scrypt-based currencies will become obsolete as soon as they come out with application-specific integrated circuits (ASICs). These are specialized devices for mining cryptocurrencies - ones for BTC using the SHA-256 algorithm have hashrates in the GH/s. That’s over 1000x faster than graphics cards. ASICs for Scrypt do not yet exist, but I believe are being developed. Hopefully I can get in on the first round of orders for that…
I had a nice unobtrusive idea for my mining rig, which has become something of a chore: a cronjob to kill it at 6pm before I get home from work, and to reboot/restart the mining process at 8am to let me know it’s on and running before I’m out the door.
Unfortunately, when I panicked that I lost all the shit I had on my computer before I installed Xubuntu and turned it into a mining rig (whatever that means..) – well, I reinstalled Ubuntu in some irrational manner to retrieve what was lost. Turns out, I backed it up on a hard drive.
Anyway, so now I have to do a fresh install. And there were some issues with the drivers, so I’m documenting it here in case I forget and have to do it again.
Followed this guide up until installing the fglrx drivers. According to a forum thread, Ubuntu does not support those proprietary drivers, and I followed this to remove them and install the open source ones.
Update - Getting an error: libOpenCL.so.1: cannot open shared object file: No such file or directory
First trying to install python-pyopencl, which has dependencies I just installed. Nope. Now trying this solution. Nope. Hmm.. Another try to python-pyopencl. I have held broken packages. Gonna try rebooting. Alright, so I realized I never actually installed the drivers. Installed the AMD Catalyst driver (the less-gangster path) and got some output on my cgminer dry run. Sweet.
Alright, got the mining script on my computer. Haven’t mucked around with the startup / kill aspect of it, but it’s mining Litecoins on mine-litecoin.com. Only took an hour. I’d consider that a success.