Mining Bitcoin

Posted on at


Introduction
Mining is the process of adding transaction records to Bitcoin's public ledger of past transactions. This ledger of past transactions is called the block chain as it is a chain of blocks. The block chain serves to confirm transactions to the rest of the network as having taken place. Bitcoin nodes use the block chain to distinguish legitimate Bitcoin transactions from attempts to re-spend coins that have already been spent elsewhere.

Mining is intentionally designed to be resource-intensive and difficult so that the number of blocks found each day by miners remains steady. Individual blocks must contain a proof of work to be considered valid. This proof of work is verified by other Bitcoin nodes each time they receive a block. Bitcoin uses the hashcash proof-of-work function.

The primary purpose of mining is to allow Bitcoin nodes to reach a secure, tamper-resistant consensus. Mining is also the mechanism used to introduce Bitcoins into the system: Miners are paid any transaction fees as well as a "subsidy" of newly created coins. This both serves the purpose of disseminating new coins in a decentralized manner as well as motivating people to provide security for the system.

Bitcoin mining is so called because it resembles the mining of other commodities: it requires exertion and it slowly makes new currency available at a rate that resembles the rate at which commodities like gold are mined from the ground.

Difficulty
The Computationally-Difficult Problem
Mining a block is difficult because the SHA-256 hash of a block's header must be lower than or equal to the target in order for the block to be accepted by the network. This problem can be simplified for explanation purposes: The hash of a block must start with a certain number of zeros. The probability of calculating a hash that starts with many zeros is very low, therefore many attempts must be made. In order to generate a new hash each round, a nonce is incremented. See Proof of work for more information.

The Difficulty Metric
The difficulty is the measure of how difficult it is to find a new block compared to the easiest it can ever be. It is recalculated every 2016 blocks to a value such that the previous 2016 blocks would have been generated in exactly two weeks had everyone been mining at this difficulty. This will yield, on average, one block every ten minutes. As more miners join, the rate of block creation will go up. As the rate of block generation goes up, the difficulty rises to compensate which will push the rate of block creation back down. Any blocks released by malicious miners that do not meet the required difficulty target will simply be rejected by everyone on the network and thus will be worthless.

Reward
When a block is discovered, the discoverer may award themselves a certain number of bitcoins, which is agreed-upon by everyone in the network. Currently this bounty is 25 bitcoins; this value will halve every 210,000 blocks. See Controlled Currency Supply.

Additionally, the miner is awarded the fees paid by users sending transactions. The fee is an incentive for the miner to include the transaction in their block. In the future, as the number of new bitcoins miners are allowed to create in each block dwindles, the fees will make up a much more important percentage of mining income.

The mining ecosystem
Hardware
Users have used various types of hardware over time to mine blocks. Hardware specifications and performance statistics are detailed on the Mining Hardware Comparison page.

CPU/GPU Mining
The least powerful category of bitcoin mining hardware is your computer itself. Theoretically, you could use your computer's CPU to mine for bitcoins, but in practice, this is so slow by today's standards that there isn't any point.

You can enhance your bitcoin hash rate by adding graphics hardware to your desktop computer. Graphics cards feature graphical processing units (GPUs). These are designed for heavy mathematical lifting so they can calculate all the complex polygons needed in high-end video games. This makes them particularly good at the SHA hashing mathematics necessary to solve transaction blocks.

You can buy GPUs from two main vendors: ATI and Nvidia. High-end cards can cost hundreds of dollars, but also give you a significant advantage over CPU hashing. For example, an ATI 5970 graphics card can give you over 800 MH/sec compared with a CPU, which will generally give you less than 10 MH/sec.

One of the nice things about GPUs is that they also leave your options open. Unlike other options discussed later, these units can be used with cryptocurrencies other than bitcoin. Litecoin, for example, uses a different proof of work algorithm to bitcoin, called Scrypt. This has been optimized to be friendly to CPUs and GPUs, making them a good option for GPU miners who want to switch between different currencies.

GPU mining is largely dead these days. Bitcoin mining difficulty has accelerated so much with the release of ASIC mining power that graphics cards can't compete. If you do want to use them, you'd best equip yourself with a motherboard that can take multiple boards, to save on running separate PSUs for different boards.

FPGA Mining
A Field Programmable Gate Array is an integrated circuit designed to be configured after being built. This enables a mining hardware manufacturer to buy the chips in volume, and then customize them for bitcoin mining before putting them into their own equipment. Because they are customized for mining, they offer performance improvements over CPUs and GPUs. Single-chip FPGAs have been seen operating at around 750 Megahashes/sec, although that’s at the high end. It is of course possible to put more than one chip in a box.

FPGA mining is a very efficient and fast way to mine, comparable to GPU mining and drastically outperforming CPU mining. FPGAs typically consume very small amounts of power with relatively high hash ratings, making them more viable and efficient than GPU mining. See Mining Hardware Comparison for FPGA hardware specifications and statistics.

ASIC Mining
An application-specific integrated circuit, or ASIC, is a microchip designed and manufactured for a very specific purpose. ASICs designed for Bitcoin mining were first released in 2013. For the amount of power they consume, they are vastly faster than all previous technologies and already have made GPU mining financially unwise in some countries and setups.

Mining services (Cloud mining)
Mining contractors provide mining services with performance specified by contract, often referred to as a "Mining Contract". They may, for example, rent out a specific level of mining capacity for a set price for a specific duration.

Pools
As more and more miners competed for the limited supply of blocks, individuals found that they were working for months without finding a block and receiving any reward for their mining efforts. This made mining something of a gamble. To address the variance in their income miners started organizing themselves into pools so that they could share rewards more evenly. See Pooled mining and Comparison of mining pools.



About the author

160