Mining Bitcoins

tl;dr: I've experimented with Bitcoin, the p2p, digital crypto-currency, for over a month, made some profit and eventually decided to build a dedicated mining machine. Recently Bitcoin has gained a lots of attraction and has been both praised and criticized. While there are multiple threats to the technology and community, Bitcoin is something definitely worth keeping an eye on.

What is a Bitcoin

Bitcoin is an anonymous, decentralized, p2p, digital (crypto)currency that comes with a network to maintain it. There is no central authority to maintain the currency, thus the network has a mechanism to track transactions and the ownership of Bitcoins, as well as prevent any fraudulent behavior such as spending Bitcoins you don't have, double spending or creating Bitcoins out of a thin air. New Bitcoins are created at predictable rate through a process known as 'mining' which requires a lot of computational power to do and is also used to verify past transactions. Bitcoin has been created in 2009 by a mysterious Satoshi Nakamoto who wrote the original client and helped the network to take off, then gradually reducing his involvment. To join the Bitcoin community and start using it is an open source client which you can download from bitcoin.org.

Mining explained

Mining is the process of generating new Bitcoins as well as validating transactions that have been made by other members of the network. The process itself is somewhat peculiar and there are some who would say it's a pointless waste of resources. In simple terms a miner would continually calculate a sha256 hash of a representation of Bitcoin transactions and a certain nonce (a meaningless number used only to change the hashing result) to generate a block and create a proof of work. Generated hash is then compared to a target (current value) and if it is less or equal it is accepted and the block is generated (if it is grater than the target then hash is discarded, nonce is modified/increased and process is continued). If a miner is successful he is allowed to append a transaction of 50 BTC credited to his Bitcoin account - an incentive for miners for doing the hard work. The block generated is then propagated into the Bitcoin network where it exists inside a 'chain' so that each block is connected to a previous one and the next one. More detailed (and far more technical) description of the process can be found on Bitcoin Wiki/Help page.

The Bitcoin economy

Gradually, over time, the amount of Bitcoins awarded for generating a block will decrease at predictable rate (it's halved every 210'000 blocks, recently we've reached block 127'000 so it is still months if not years till that happens). Bitcoin network controls the amount of blocks generated every week by amending the difficulty of coming up with a valid hash (see 'target' above) - the target is to achieve exactly 2016 blocks generated every week (in other words 144 a day or 1 every 10 minutes). At some point in distant future generating a block will yield a neglectable amount of Bitcoins thus making it inefficient for miners to participate. For that reason one can add an additional fee to the transaction which will be awarded to the miner discovering the block. Transactions with fees will have higher priorities thus being processed and confirmed first. Currently and in the near future this is not really needed as the default 50 BTC is lucrative enough but in the future it will ensure a well-being of the Bitcoin network.

Bitcoin Markets

Bitcoins can be used for paying for goods and services in many places but it is still far from common to accept Bitcoins as a form of payment. Another thing you can do with your Bitcoins is trade them for fiat currencies and gold on various markets. Out of curiosity I've experimented with trading few Bitcoins for GPB and getting money in and out with wire transfers - it all went well. Usually you can trade Bitcoins without paying any fees - similarly, as of today, you can send them around without paying any transaction fees. That means that with a little extra effort you could use Bitcoins to send money to different countries without paying outrageous bank fees for such transfers. I can also think of some 'shady' ways Bitcoins could be possible used but let's leave this out of the picture.

Reception

Bitcoin community has gained a lot of attraction during past month. There were couple of interesting articles that have made it to the top of the Hacker News, most notable: Why Bitcoin will fail aka 'the rant' and the answer for that. Bitcoin seems to gain popularity and it is about time that governments start poking around sniffing potential threat to the controlled economies. While this interest is a potential threat to the Bitcoin currency, the currency itself is doing very well. Over past month the value of a Bitcoin raised multiple times:

BTC/USD exchange rate value 1 April - 28 May - chart courtesy of bitcoincharts.com
BTC/USD exchange rate value 1 April - 28 May - chart courtesy of bitcoincharts.com

My findings

I've begun mining with my desktop machine approximately a month ago. After trying couple of different miners I've chosen a Phoenix Miner for my Linux box with Ati Radeon 6950 (flashed to 6970) which is capable of doing approximately340Mhash/s without breaking a sweat (usable desktop, fat @50%). At current difficulty mining solo with this kind of computational power might turn out to be very unrewarding - you could be mining for days, weeks even months without finding a single block and thus earning exactly 0 BTC. However a group of people working together can easily find a block within minutes thus mining pools have been conceived. Effectively pool is just a group of people working together on the same block in order to boost chance of finding a block. Pool's computational power reaches many GHashes per second and finding a block is a matter of hours or even minutes for a crowded pool! Once block is found, the reward is then divided between all participants usually based on amount of shares each has provided. I've tried 2 different pools, deepbit and bitcoinpool, first one being the biggest public pool currently in existence and running at speeds above 1 Thash/s (!), second much smaller (currently around 100 Ghash/s). Effective earnings at each pool are comparable - deepbit gives you a lot of small payments (they usually find a block within minutes), bitcoinpool gives you a slightly bigger payouts but less often - still it is at most couple of hours between payouts.

With my 340Mhash/s machine I've been initially able to generate approximately 3BTC during each 24hrs period but due to the increase in difficulty over past month I can now roughly do half of that. At the same time I've been using the same machine for day-to-day activities and occasionally I've been forced to switch mining off if I had a need of GPU. After a month I've decided to get a dedicated mining machine and see how it fares.

For my dedicated machine I've chosen Radeon 5870 cards with hope to keep it most cost-effective. I've built the following spec:

Couple of things you don't really need but will make things easier:

Which can produce between 1.1 and 1.3Ghash/s (depending on how good cooling you have) using Phoenix miner executed as follows:

python2.7 phoenix.py -u http://login:password@miningpool:8334/ -k phatk DEVICE=0 VECTORS BFI_INT AGGRESSION=11 WORKSIZE=128

There are couple of things you can tweak. Theoretically with excellent airflow through your case and A/C in the room it should be possible to overclock all your cards to 900Mhz and reach speeds >400Mhash/s per card (thus total speed of 1.2-1.3Ghash/s is possible). In practice, the cards are sandwiched and the card in the middle will run at slightly higher temperature than other two thus I've been forced to lower it's clock:

My mining rig which I proudly call Arrakis
My mining rig which I proudly call Arrakis

Threats

Ok, this all sounds exciting so before you jump onto the wagon and spend your savings on numerous top-shelf graphic cards, let me at least outline couple of potential and actual threats that can make mining unprofitable or even trip the entire Bitcoin ecosystem.

  • Raising difficulty. There are more and more miners, the overall speed of a network is rising in a steep curve and Bitcoin network tries to catch-up by increasing the difficulty. Due to the nature of the network, mining will eventually become unprofitable:

Difficulty of Bitcoin network over time - chart by courtesy of bitcoin.sipa.be
Difficulty of Bitcoin network over time - chart by courtesy of bitcoin.sipa.be

  • Governments will try to kill it, there is no doubt in that. Bitcoin can turn out to be an interesting experiment in fields of p2p, the Internet and social freedoms in general.
  • Technology fails big time - a single failure of the technology could cause a huge and violent hyperinflation which in turn renders mining hugely unprofitable discouraging most miners and, in worse case scenario, killing the network.
  • A new technology comes with computing power so great that it will render GPU mining obsolete, in a similar fashion that GPUs made CPU mining obsolete.

This is by no means complete list of threats but only ones that I've personally found most accurate.

Summary

Recently Bitcoin has definitely gained some traction and more and more people are looking into it. Currently value of a Bitcoin it pretty unstable but the general trend is upwards, or using more economic we're in a long-term rally period. At this moment mining using a GPUs should turn out profitable but it might change due to multiple threats and rather unpredictable market. Whether you're looking into becoming a miner, trading currencies, thinking about accepting Bitcoins on your e-commerce or just found Bitcoin an interesting curiosity it is definitively something worth keeping an eye on.

Resources

If you would like to support my world domination plan, please send Bitcoins to: 1DNeuiLoEj6yJ16snHKg3e1DHyTeb6dz5g. I shall share them with Pinky and Brain.