Bitcoin Mining and Security

If you’re new to Bitcoin or the world of digital currency, the concept of mining can be more than a little bit confusing. This article is going to be a bit vocabulary intensive, but fear not. Everything will be defined clearly, for the sake of informing more people of exactly how this process works.

Let’s start with the concept of “proof of work.” A proof of work is defined as a piece of data that is difficult to produce, in order to satisfy a requirement. Bitcoin uses the hashcash proof of work, which was invented by Dr. Adam Back in 1997 and proposed for a lot of purposes that don’t make much sense to someone who isn’t tech savvy. A simpler example for the use of hashcash is email spam-blocking. The system requires a proof of work on the email’s contents to be able to authorize it as a legitimate email. A single email does not require more than a little bit of work, the proof is simple. The idea is that mass spam emailers and their many, many emails will have a hard time generating the required proofs. To do so would require a lot of resources, from a processing perspective.

Now, to tackle mining itself. Since bitcoins are not affiliated with any central bank or government, there is no one to regulate the production of currency. One aspect of mining for blocks is what you might call the photosynthesis of money creation. Only, instead of water, sunlight, and carbon dioxide, mining requires hardware, energy, and time. Mining Hardware is sold on amazon and in other places. This process is difficult, so as to keep the rate of mining (and generation of new coins) stable. Simplified for the purpose of explanation, a hash block has to contain a certain number of zeros. Since the probability of calculating a hash starting with a whole lot of zeros is low, so a lot of attempts have to be made. Confused? You’re not alone. Fear not, understanding this process on a technical level requires a lot more information than included in this article. The important information to take away from this paragraph is that mining blocks=a certain amount of bitcoins being generated.

Possible monetary gain aside, bitcoin mining is the process of adding transaction records to the public record (Blockchain) in order to ensure that all of the transactions are confirmed and legitimate. Mining a block confirms transactions to the rest of the network, and also distinguishes attempts to re-spend coins that have already been used from first-time transactions. When a block is mined it needs a proof of work or it will not be considered valid. The proof of work is verified by other Bitcoin nodes (defined as any computer running bitcoin client software/participating in the peer-to-peer network). Since the task of generating blocks is difficult (the probability of generation is low, it is impossible to tell which worker computer in the network will generate the next block.

It should be noted that each block contains the hash of the block preceding it, hence the name Blockchain. Since each block contains information from the preceding block, each block contains a chain of blocks that, together, contain a large amount of work. Also to be noted, a block can only be changed by creating a new block with the same predecessor. Thus for any block to be changed and considered valid, a miner would have to go through and regenerate every successor, redoing the work they contain.

Currently, the ideal average “mining time” is around 10 minutes per block. This target is recalculated every 2,016 blocks mined, or approximately every two weeks. There is a life cycle of sorts that comes with this average time, and it is measured by the number of blocks created to the difficulty of mining to the number of miners on the network. As more miners join the network, block creation rate increases. The average mining time decreases, and so the difficulty of mining increases. The increase in difficulty means that the block creation rate goes down, and so the the average mining time goes back to the normal rate. That is, until more miners join the network.

The biggest and most important purpose of mining is to allow all of the Bitcoin nodes to reach a consensus that is secure and tamper-resistant. Though there is an opportunity to earn bitcoins, that is more of a motivation for people to keep the nodes in agreement than it is the overall goal. If mining sounds like a worthwhile hobby or experiment to you, the technology is available. There is also a lovely “For Dummies” book all about this process. Remember that your initial profit will be affected by all of the above variables, and that the machines each cost an average of hundreds of dollars.