Bitcoin mining with the Raspberry Pi, using an AntMiner U2
New Bitcoins are introduced to the Bitcoin system by a process known as mining. Just as precious metals have to be laboriously won from the Earth, new coins have to be created by a computationally intensive process that takes a considerable amount of time to complete.
This proof of work also uses hashing. The computer takes data from the list of pending transactions, adds a number (called the nonce), then computes a hash.
This hash is compared to a target value shared around the network. If the hash is equal to, or less than, the target then the computer shares its nonce with every other computer on the Bitcoin network who validate the claim. If the nonce is valid, the block has been authenticated and transactions can be completed. If the hashed value is larger than the target, a new nonce is chosen and the value rehashed – millions and millions of times every second.
Small changes to the values passed into hash functions can produce very large changes to the hash values which change in a manner that is hard to predict. There is no shortcut to hashing, so a miner has to laboriously grind through possible values for the nonce hoping to be the first one to find a value below the current target. The more processing power a miner can bring to bear on the problem, the greater the probability they will beat the competition to find the nonce. New Bitcoins are the incentive for validating a block; the first computer to find a nonce is rewarded with 25 Bitcoins.
The Bitcoin network aims to validate a new block every ten minutes. Every 2016 blocks, the network decides if the target value needs to be altered. If fewer computers are validating blocks, or if the problem is taking too long to solve, then the target will be raised (producing more possible solutions for the nonce); but if more computers, or faster computers are validating blocks faster than expected, the target will be lowered to reduce the rate again.
Approximately every four years, the reward for solving a block is halved. Currently it is 25 Bitcoins per block, in August 2016 it will become 12.5 Bitcoins per block; eventually the reward will fall to zero, and then there will be no more Bitcoins – ever. Right now, there are approximately 13 million Bitcoins in existence. Approximately 21 million Bitcoins will be mined in total with the last coin appearing around the year 2140. While mining has been the main reward for users, they can also earn Bitcoins (or fractions of Bitcoins) by validating transactions for other users, just in the same way banks charge for providing financial services.
The upper limit on the number of Bitcoins doesn’t put a cap on the value of Bitcoins. In many ways Bitcoin is similar to historical money which was based on precious metals such as gold or silver – the total amount of money in circulation could never exceed the total value of the metal stored in bank vaults. If Bitcoins become relatively scarce, and provided the Bitcoin system remains trusted and legal, then the value of a single Bitcoin can be expected to rise against other currencies and fewer Bitcoins will be needed in the future to buy the same amount of goods and services.
Just in case you are worried that a single Bitcoin might become too expensive to use, a single Bitcoin can be subdivided into smaller chunks – so it is perfectly reasonable to talk about an item costing one three-thousandth of a Bitcoin; in fact, the smallest amount of a Bitcoin that can be recorded is one one-hundred millionth of a Bitcoin – and there is no reason why even smaller amounts could be allowed in the future.
Mining rigs
The initial target values needed to validate blocks and produce new Bitcoins were relatively large and could be found by a computer after relatively few hashes. The CPU found in a desktop computer is easily capable of performing several million hashes every second so even quite small computers were able to solve blocks and release new coins. Miners quickly discovered that the dedicated chips found in high-end graphics cards used on games PCs and workstations were dramatically faster at solving hashes and the next generation of miners relied on so-called GPU miners. The first miners to adopt GPU miners were able to mine large numbers of coins, but as more and more GPU miners joined the race, the complexity of the validation increased and even these new miners began to slow down.
Miners have subsequently switched to specially programmed FPGA miners and the current generation of ASIC miners (which are computers designed to do nothing more than solve blocks and mine Bitcoins). They are in a race to build ever faster computers capable of performing not millions, but billions of hashes every second - the fastest miners can now perform over 700 billion hashes every second! A single mining computer might cost from $500 to tens of thousands of dollars, and most miners use many computers, or even rent time from cloud computing suppliers.
The ever-increasing difficulty of the targets means that mining computers have relatively short lifetimes. Anyone buying a mining computer must calculate whether the value of the new Bitcoins it produces will outweigh its cost and the cost of the energy it consumes. Such is the complexity of mining that a single miner has only a very small probability of solving a block. Most miners now belong to mining pools who combine their processing power to find new blocks more quickly and share the reward among their members.
Rate and Review
Rate this article
Review this article
Log into OpenLearn to leave reviews and join in the conversation.