Leave a request
Bitcoin mining is an interesting way of trying to make a few bitcoin tokens on the side, but it also serves a very important purpose in maintaining and keeping the bitcoin blockchain secure.
Unlike regular fiat currencies (such as US dollars or euros) bitcoin assets are not controlled by a central government or bank and new bitcoin (BTC) cannot be printed and issued like paper money. Instead, bitcoin tokens are introduced into the market via a process known as “mining”. BTC are awarded to the miners who have solved the math problems necessary to verify bitcoin transactions.
In this guide we’ll look at how mining works, why it’s a necessary component of bitcoin infrastructure, and whether it’s a good way of making a buck.
This information should not be interpreted as an endorsement of cryptocurrency or any specific provider, service or offering. It is not a recommendation to trade. Cryptocurrencies are speculative, complex and involve significant risks – they are highly volatile and sensitive to secondary activity. Performance is unpredictable and past performance is no guarantee of future performance. Consider your own circumstances, and obtain your own advice, before relying on this information. You should also verify the nature of any product or service (including its legal status and relevant regulatory requirements) and consult the relevant Regulators' websites before making any decision. Finder, or the author, may have holdings in the cryptocurrencies discussed.
What is mining?
Whenever a transaction is made in bitcoin, a record of it is made on a block containing other recent transactions, like a page in a ledger. Once the block is full, bitcoin miners compete against each other to verify and validate the block and all its transactions by solving a complex cryptographic problem.
The first miner to accomplish this is awarded a set amount of bitcoin, based on the mining difficulty at the time. The verified block is then added to the blockchain, a history of all blocks verified since the beginning of bitcoin, and transmitted to all users of bitcoin so that they can have the latest blockchain.
At the heart of bitcoin mining lies a hard, mathematical problem. The goal is to ensure that the process of adding a new block to the blockchain requires a lot of work. That helps to ensure that any hacker tampering with the transactions needs not only to mess with the transactions but also win the “race” of bitcoin mining.
So how does it work?
Basics of cryptography
SHA-256 – the mining algorithm used by bitcoin – is a one-way cryptographic algorithm. When you pass a word through SHA-256 you will be given back an unrecognizable string of letters and numbers called a “HASH”.
For example, the SHA-256 of the word “BUTTERFLY” (source) is “8c62ace4f9ef8ccd08ca6fb992a8524bb7dbdc0530654bd254c9da07a660949a” (HASH). This seemingly random string of letters and numbers has three important properties:
With this information, we can now start piecing together the mining process.
The mining process
Bitcoin mining involves three variables: the block, the mining difficulty and a random number. Here’s how it all comes together:
Imagine our block consists of the word “BUTTERFLY” discussed earlier. In reality, the block would contain a list of recent, unverified transactions, but let’s keep it simple. In order for the block to be solved, bitcoin uses a deceptively simple test: If the HASH result of the block starts with a certain number of zeros, the block is considered verified. This number of zeros is the “mining difficulty” and is increased as more miners join the bitcoin network. For our example, let’s say that we have a mining difficulty of just two, ie, our HASH must start with two zeros.
The problem: “BUTTERFLY” will always return the same HASH, and it doesn’t start with two zeros. So what we need is the third variable, a random number (called a NONCE). We take this number, combine it with “BUTTERFLY”, and HASH again. If it doesn’t start with two zeros, we change the number and try again, and because changing one small number changes the whole HASH result, there is no way to predict the number we’ll need to solve this!
We repeat this process over and over until we find a number that, when combined with “BUTTERFLY”, gives us a HASH that starts with two zeros. That number is the solution to the block. Here are some tries:
This arduous process of randomly trying to find a number that gives the solution is what makes bitcoin mining such a computationally expensive process and as more miners join the network the harder it gets. As of November 2017, a regular home computer working alone, ie, not an application-specific integrated circuit (ASIC) and not part of a cloud mining network, would take 2.7 million years to mine one block.
This has led to the rise of ASIC computers built specifically for mining, and to an increase in cloud mining.
Leave a request