Bitcoin Mining

In previous post I started a discussion about Bitcoin, though did not provide details on what actually Bitcoin is and how it works. There is much information on this in the internet. You can start with reading this wiki: https://en.bitcoin.it/wiki/Introduction or read a whitepaper for technical details: https://bitcoin.org/bitcoin.pdf

Bitcoin is based on an idea of a public ledger (blockchain): a list of all transactions ever happened, publicly available for everyone in P2P network. To prevent double spend there should be a way to make sure that only one blockchain exists. Blockchain solves this problem by using something called “proof of work” https://en.bitcoin.it/wiki/Proof_of_work . Large amount of computational work is required for a new block to be accepted into blockchain, and all bitcoin clients have the same understanding of how to validate new blocks, and how to check proof of work. So in order to compromise bitcoin protocol an attacker must control more than 50% bitcoin client computation power.

Hard computation which is done for proof of work is actually calculation of hash of a bitcoin block. Beside of transaction information, a block contains a field with random value, named “nonce”. Bitcoin miners are changing this value and calculating sha256 hash of the block, trying to find such nonce which will give hash value less than predefined small number.

Whoever finds such value can send the block to blockchain, and get 50 BTC as a reward. This is bitcoin mining. Work of hash calculation looks meaningless, but it is what provides bitcoin decentralized system its stability and protection against attacks.

There is much software which can be used for bitcoin mining, and there are several hardware options. Mining power is measured in hashes per second. Another useful metric is hashes per joule of energy, because electricity is main cost of bitcoin mining.

Bitcoins can be mined using CPU. It is a slowest method, and it is not efficient, mining power is somewhere between 1 and 10 MHash/s. Most likely you will not even earn more than spend for electricity: 0.02 to 0.6 MHash/j.

GPU is much much better, it computes sha256 with up to 800 MHash/s, and up to 3 MHash/j. GPU is much faster for sha256 because it is designed to make many simple operations simultaneously. “A CPU core can execute 4 32-bit instructions per clock (using a 128-bit SSE instruction) or 8 via AVX (256-Bit), whereas a GPU like the Radeon HD 5970 can execute 3200 32-bit instructions per clock (using its 3200 ALUs or shaders). This is a difference of 800 (or 400 in case of AVX) times more instructions per clock.https://en.bitcoin.it/wiki/Why_a_GPU_mines_faster_than_a_CPU

Here is comparison of various CPU/GPU: https://en.bitcoin.it/wiki/Non-specialized_hardware_comparison

GPU were the best option before 2013 when first ASIC (application-specific integrated circuit) came to market. These are devices specifically designed for bitcoin mining, and they are very fast and very efficient. For example this device with size of a memorystick makes 11 GHash/s (13 times more than the best GPU): http://techcrunch.com/2014/04/04/the-11ghs-hexfury-will-is-the-latest-in-low-power-asic-bitcoin-miners/

Here is comparison of various ASICs: https://en.bitcoin.it/wiki/Mining_Hardware_Comparison. The best of them makes 6 THash/s and 1714 MHash/j.

Another option is to use cloud services which offer mining performance for fixed price. https://en.bitcoin.it/wiki/Category:Mining_contractors

Mining profitability depends on mining power, electricity utilization, electricity costs, hardware costs, bitcoin market price, mining difficulty (internal variable of bitcoin network which allows to adjust mining speed depending on total mining power).

Did you try to mine bitcoins?