Mining Bitcoin Step by Step
Table of Contents
1. Introduction
1.1 What is Bitcoin mining? Mining is the process of spending computing power to process transactions, secure the network, and keep everyone in the system synchronized together. It can be perceived like the Bitcoin data center except that it has been designed to be fully decentralized with miners operating in all countries and no individual having control over the network. This process is referred to as “mining” as an analogy to gold mining because it is also a temporary mechanism used to issue new bitcoins. Unlike gold mining, however, Bitcoin mining provides a reward in exchange for useful services required to operate a secure payment network. Mining will still be required after the last bitcoin is issued.
An interesting overview of the basic background to Bitcoin mining, what it is, and how it compares to gold mining. The same principle is applied to Bitcoin, the only difference being that the Bitcoin mineral is the computational time and electricity instead of rocks and dirt.
1.1 What is Bitcoin mining?
Bitcoin mining is the process through which bitcoins are released to come into circulation. Basically, it involves solving a computationally difficult puzzle to discover a new block, which is added to the blockchain. It also involves verifying the legitimacy and uniqueness of the transaction, which is already put in a block. By verifying the transaction, it helps to remove the double spending problem that has been solved in the digital currency before using hard-earned money to buy an item or service in the real world. Bitcoin mining is integral because it reinforces the blockchain and secures the network. It is especially important in light of the impending halving, which is sure to attract more miners to the network. Bitcoin mining is a very competitive industry, so a regular personal computer with a decent graphics card or GPU can’t get any share of BTC. This is mainly because of the emergence of ASIC miners, which have provided an exponential increase in mining power. This has caused there to be several dominant mining pools, which have been proven to compromise the independent thoughts and decisions of miners. Another disadvantage is that the electricity expenses, other than an ASIC miner, are no longer profitable compared to what the miners can mine. This may cause a change in the mining pool and independent mining dynamic.
1.2 Importance of Bitcoin mining
So what does all this have with Bitcoin mining? This is where the nature of mining comes in. In order to monitor the transfer and then prevent the double spending of digital money, a system would need to be put in place that logs all information regarding a payment. Then this information would need to be checked against other information to ensure that the payment has not been double spent. Finally, the system would need to be able to reveal the information at any time. This is what I call a global transaction ledger. With the current technology, this sort of thing would be quite a difficult task and even with the use of a SQL database, it would be hard to achieve efficiently. Finally, given that there is a big chance it could be a target for attack, it is something that would be best implemented on a secure private network. Step in Bitcoin, a global public transaction ledger is exactly what is on the cards. Now you still may be wondering where does mining fit into all this and why is it so important? Well, that question will be answered in the next section of the guide.
The main problem with a double spending protocol is the risk that a person could pay another in a form of money and then proceed to take back or cancel the payment. In our current society, if this was to occur, banks and other financial institutions have systems in place that can prevent such an action taking place. This can be done with relative ease as accounts can be monitored and if a transaction like the one mentioned before takes place, it can be seen and if the second payment was to be returned, then the person who made the first payment can be reimbursed at the cost of the other person. This willingness to reimburse is what keeps the economy oiled and the transfer of money a smooth and easy process. In order for a similar thing to happen with digital cash, a monitoring service would need to be implemented. This would require a third party to have access to all the information regarding a payment and would need to oversee all transactions to ensure that they are not double spent. This method obviously has its downfalls as it is not only intrusive and time-consuming but it is also not something that people are willing to trust others with their money. This situation has the potential to put the third party in a position where they themselves could take the money that they are meant to be monitoring.
2. Preparing for Mining
Understanding hardware requirements At the time of writing, it is said that mining Bitcoin requires a huge amount of computational power. In the early days of Bitcoin, it was possible to mine with your computer CPU or high-speed video processor card. Today that’s no longer possible. Custom Bitcoin ASIC chips offer performance up to 100x the capability of older systems and have come to dominate the Bitcoin mining industry. Bitcoin software is still optimized for CPUs, but in most cases, the network is dominated by some High-Performance computing, so using your GPU might pay off, but this only works if you have a good GPU, and time is probably best spent on learning and trading mining algorithmically. FPGA’s and ASIC’s can unfortunately generate an extremely high amount of heat and noise. They also generate quite a high electricity bill, so it is vital to consider the cost-to-benefit ratio. Electricity costs are a significant factor and were recently around 3-6% of the total cost of “mine” a bitcoin. Take a look at the cost of electricity in your region, do some research. High-end GPUs generate a lot of heat, so in general, if the mining rig is substantial enough, a system of fans or air conditioning is required. At the time of networking, set up the miners to a pool such as Slush’s pool. Register a worker, and create a ‘d’ file where the configuration information is to be input. Now run your miners using the ‘d.bat’ file, and you will be ready to start making some digital currency. It is a good idea to configure your miners to automatically start mining on start-up. Choosing the right mining software Now that you have said goodbye to the world’s most unprofitable computer hardware, it’s time to fire up your favorite search engine! Search for Bitcoin mining software, and you will find many options and have quite a few more replies if you ask in the Bitcointalk forum’s. Now it is important to keep in mind that the type of software you use will have a significant impact on the net profit of mining. Step one is to run software like GUIMiner or Diablominer, which was knowledgeably written in Python by Con. Both have a GUI and offer high performance. However, what you export in usability you lose in customizability. After getting used to the above, try learning how to use poclbm (which is also written in Python). Now a certain point of mining expertise is required for the following. The general consensus is that command-line mining is a lot more efficient. The highest performance Bitcoin miner is still Ufasoft’s CPU miner.
2.1 Understanding hardware requirements
There are several factors to consider before mining. First, fix the hardware specifications that you will use. Currently, there are ASIC miners (mining specifically using hardware), and GPU and CPU mining, which is mining using a graphics card or CPU. Then consider the low electrical power. Large electricity affects the costs and benefits of mining, so look for hardware that is power efficient. In the mining process, mainly using the CPU from the computer that has high power consumption. But the development of technology for mining now mostly uses GPU, which has greater hash power and can be used for a long time compared to CPU. Then the important things are the cost you are willing to spend, and lastly, calculate the profits and losses that we will get.
Mining is a process that helps manage bitcoin transactions and create a new bitcoin. The goal for understanding hardware requirements is to have a convenient tool for the mining process, a low-cost bill, and a hope to get more coin. It is because mining is a competitive thing and people want to make money in an easy way. When it was first done, it ran on the CPU. Then we can improve the system using the GPU, and it gives us more speed and effectiveness. Now, to make a big effective mining, we can build our own system that is specified just for mining.
2.2 Choosing the right mining software
Each option has its own advantages and disadvantages, some more complicated than others, so be sure to do your research before making a final decision. The first and most obvious step in the process is to obtain a Bitcoin wallet. Because Bitcoin is an internet-based currency, you need a place to keep your Bitcoins. Go to the homepage and download a client. The process of making a wallet is quite simple and they offer many different types of wallets: mobile, web-based, desktop, and hardware. For the purpose of this article, I suggest using a simple web-based wallet like Blockchain.info because it’s very straightforward and you won’t need a lot of space. Once you have your wallet, go to the Bitcoin official website and download the client. The client is what will be doing the work on your computer. It will be both the “bitcoin” and “bitcoind” executables that you see in your folders. This not only makes you the client but also the server, so you need to make it run 24/7 to keep the process going. Lastly, it also allows you to interact with the bitcoin network, much like a web browser interacting with a web page. Go ahead and install the application. This is perhaps the easiest step in the whole process.
2.3 Setting up a Bitcoin wallet
Before you start mining for bitcoin, you will need to set up web services which will allow you to engage with the network in order to create and obtain a bitcoin wallet. There are several ways to do this, but one of the simplest is to use a web wallet service. The recommended web wallet is [Link] All you have to do is sign up, log in, go to the wallet, and a bitcoin address will be given to you which you can use to receive bitcoin from anyone/anywhere. Answering the question, “What is the best way to obtain a web wallet?”, Daniel Friscia from the Bitcoin Magazine suggests: “The best way to obtain a web wallet is to just download the Bitcoin QT client from Bitcoin.org, and this will let you create a wallet in the best and most secure way.” The more secure method of setting up your wallet is to download the bitcoin client and set up a wallet on your own computer. The client can be found at [Link] Once your wallet is set up, you’ll have an address in which you can create on the spot to receive bitcoin from anyone/anywhere. With this address, you can even print out a QR code to go with it and sell things in person (or just have friends/family) send you bitcoin on the spot with their mobile phone. This method also allows you to backup your wallet, so that you can save it somewhere secure and never have to worry about losing your bitcoin balance. An important note here is to encrypt your wallet with 2 or more different passwords to ensure the highest safety measure. Be sure to actually remember your passwords though, or even write them down and store them in a safe place, as it can be easy to forget a password for an infrequently used wallet.
3. Mining Process
This is the real process of mining bitcoin. Mining is one of the biggest jobs in bitcoin that could generate more profit for the worker. But it really needs more time and patience for the result. The steps to mining bitcoin are joining the mining pool, configuring the hardware, starting the mining process, and monitoring and optimizing the mining performance. The key to successfully mining bitcoin is the determination of the mining pool. Because the pool will determine the outcome that will be earned, it is better to join large mining pools if you have greater power. However, every person has a different reason for choosing a smaller pool, such as the small fee. In comparison, regular mining will take a long time to generate 50 BTC if only using a computer. In addition to the choice of pool, configure your mining hardware. Ensure that the hardware and software you have meet the specifications that support the mining process. ASIC Bitcoin Miner is quite widely used nowadays because it is more efficient in terms of electric power. Using a graphic card can also be used, but the amount of K/H that can be mined is much smaller than using ASIC. After that, determine what software will be used. There are various types of software that can be used, but the most popular ones are GUIminer and DiabloMiner. But before using GUIminer, make sure to configure the server pool settings. The next step is to test the mining hardware you have. This is done to find out the rate of speed and amount of power consumed by your hardware. To calculate the power used, see the first time you turn on your computer and when it is used for mining. Right-click on the taskbar and then open Task Manager, then click on the ‘performance’ tab. Set CPU Usage and Memory Usage to see the additional rates. If CPU Usage is 100%, it means that the power used is equal to the amount specified on the mining per month. After testing, the next step is to make settings on your hardware in the mining software that you use. The last step is to prepare mentally and be patient, and then start mining!
3.1 Joining a mining pool
First, to join a mining pool, you will need to make a mining account. You will want to join a pool with low fees. It’s also good to find a mining pool that is geographically close to you because it will make the time for the data to travel back and forth between your computer and the pool server much faster, and this will improve your internet connection. Step 2 is to download some Bitcoin mining software. There are many different types of software that work with different hardware specifications including the official bitcoin client, bitminer, bfgminer, and cgminer. Step 3 is to create workers. A worker is the name given to a specific computer which is mining bitcoins. Then you will need to create a worker on your pool’s website for each computer. This way you can monitor each worker separately. Step 4, and last but not least, is to enter your wallet address on the account. Now you are ready to start mining. Step 5 is simply to leave your computer on and the software running. Your computer will start solving complex mathematical problems, which is the reason you want a simplified problem. This is the only and only way how bitcoins are generated!
Step by step this is how it happens.
One way in which you can make your mining experience more profitable is to join a mining pool. 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. Step by step this is how it happens. Imagine that you have a machine that mines gold. That makes you and the other members of the pool plan. You are all trying to solve the same mathematical problem. The more computing power you contribute, then the greater your share of the reward.
3.2 Configuring mining hardware
Once you have your mining hardware up and running, the next step is to set up and configure your hardware. For GPU-based hardware, you would need to install a compatible version of OpenCL. However, if you are using an FPGA board, you would need to install OpenCL for Altera, which will only work on Windows. If you are an Ubuntu user, you would have to create a Windows partition or run a virtual Windows machine. For GPU and CPU hardware, you will need to modify the config.h file provided in the AMD-APP-SDK that you would have downloaded earlier. The changes are similar to those in the CPU_Miner_Setup. If you are using x86_64 hardware and CPU, you should use the 64-bit generated binaries for your own Linux binary compatibility layer. This would be generated using the -m64 flag when compiling. Once your kernel is modified or if you are running an OpenCL FPGA board, the next step is to create a “.bin” file which contains the compiled kernel. Upon completion, the kernel.cl file will be compiled into a “bitstream” that is loaded onto the FPGA. When your configuration files are in place, you can move on to testing your OpenCL code. To do this, run your mining application with the -n <index> -v <ver> -f <file> command. This will run a test of your OpenCL and verify that any kernel is working fine. With the Verbose command, OpenCL will output your platform and device with their respective indexes. On a successful kernel compile, the output response will mention the correct compilation with the runtime of the kernel. This marks the completion of configuring and setup for your hardware, and you can now move on to the start of the mining process.
3.3 Starting the mining process
All transactions are broadcast between users and usually begin to be confirmed by the network through mining within 10-20 minutes. This process is irreversible.
A transaction is a transfer of value between Bitcoin wallets that gets included in the blockchain. Bitcoin wallets keep a secret piece of data called a private key or seed, which is used to sign transactions, providing a mathematical proof that they have come from the owner of the wallet. The signature also prevents the transaction from being altered by anybody once it has been issued.
The blockchain is a shared public ledger on which the entire Bitcoin network relies. All confirmed transactions are included in the blockchain. It allows Bitcoin wallets to calculate their spendable balance so that new transactions can be verified, thereby ensuring they’re actually owned by the spender. The integrity and the chronological order of the blockchain are enforced with cryptography.
Once you have installed a Bitcoin wallet on your computer or mobile phone, it will generate your first Bitcoin address and you can create more whenever you need one. You can disclose your addresses to your friends so that they can pay you and vice versa. In fact, this is pretty similar to how email works, except that Bitcoin addresses should only be used once.
3.4 Monitoring and optimizing mining performance
Before making any large changes to settings in your mining software, you’ll want to be confident that the changes are actually worth the effort. Taking detailed notes of your mining output and hourly earnings is one good place to start. The more data you record and compare, the more precise of an idea you’ll have on how to improve your mining performance.
Monitoring the mining process is more complicated and less intuitive than it might seem. You’ll need to keep a watch on many different things at once: the general statistics of your mining pool, the hourly rate at which you are garnering coins, the number of coins coming from each individual block, and the current reward for each coin. Some of this can be done simply through observation of your mining pool’s interface. However, to more closely monitor these and other aspects of your mining performance, you’ll need to obtain and install some additional software.
This final step of the mining process is possibly the most important, yet least understood part of mining. It involves continuously checking your mining progress and making changes to improve it.
4. Rewards and Conclusion
A block reward is the amount of bitcoins that miners are eligible to receive upon completion of creating a new block, usually consisting of a set number of coins. The block reward is halved every 210,000 blocks, or roughly every 4 years. In 2009, it was 50. In 2013, it was 25. It is currently 12.5, and it will continue to halve until it reaches 0. At which point, there will be a total of 21 million bitcoins in circulation. It is often claimed that the block reward halving represents deflation for the coin. While it’s true that the amount of new coin decreases relative to total existing supply, the new coins created per block will actually approach zero. This creates a sustained level of ‘deflation’. But it’s not a severe deflationary spiral as the one described by the quantity theory of money. Step by step, the rate at which new currency is created will approach zero. At the same time, the percentage of lost coins will diminish relative to the remaining supply, which in effect will not result in a decrease of the real money supply. In the long run, we can expect lost coins to be roughly replaced by increased security on the coins that are still in circulation. This is a valuable equilibrium to aim for.
4.1 Understanding block rewards
When a block of transactions is created, miners bundle that block with the answer to the puzzle and the previous block’s hash into a new hash. That new hash is placed at the end of the new block and is now a part of the block’s identifying information: it is part of the next block’s puzzle. So, changing the previous block could alter the puzzle’s solution, requiring work to be redone on that new block. Any changes to the current block could also alter the puzzle’s solution, so the current block would also have to be redone. Thus, the more blocks that are added after a specific block, the more work would be required to alter that block. This work done in the past is what gives blockchains their characteristic “unalterable” state. As you know, throughout the first four years of Bitcoin, the amount of bitcoins awarded to miners was 50 per block. In November 2012, after the second halving event, the reward was 25 bitcoins per block and in July 2016, it was halved again to its current rate of 12.5 bitcoins per block. The next halving event expected is around 2020-2021 and will reduce the reward to 6.25 bitcoins per block. The decreasing nature of these block rewards will have a major impact on the future profitability of Bitcoin mining. Up until now, miners have had the luxury of receiving bitcoin that were freshly minted into existence, effectively doubling their profits. Consequently, the reduced availability of new bitcoins may bring about a deflationary spiral where increased price cutting competition leads to a contraction of the industry.
4.2 Mining profitability and costs
By finding the function for the break-even point, we can specify another value to represent the break-even point of the function and solve for the number of blocks. Using any historical data on difficulty levels, one can approximate any future increases and when the break-even point will occur to see if there is any long-term profitability for the given mining rig.
This means that a simple and accurate way of projecting the long-term profitability of a mining rig is to sum the value of a linear function that starts with the value of a block at the time of difficulty rate increase and becomes zero when the last bitcoins are mined, per the equation y = mx + b, where y = profits, x = blocks mined, m = slope, and b = y-intercept. The bitcoins generated by the function represent an integral from that function, which will be the total profit from when the last bitcoins are mined, and the break-even point is when the integrated value equals the total cost of the mining rig.
In order to determine the first of the two factors, you will need to consider the hash rate for your mining rig. Any increase in the difficulty level will offset the value of the block. When a block is devalued, it is essentially the same as increasing the difficulty level on the next batch of work (i.e. now it will take more time to earn the same value of Bitcoin for the block). Because of this and the fact that the total number of bitcoins is capped at 21 million, it does not necessarily mean that an increase in the difficulty rate means that there is more Bitcoin to be mined. Any difficulty level increase will cause an approximate linear decrease in profits for any mining rig.
It is difficult to accurately measure the profit margins on a mining operation. This is due to the fact that the value of Bitcoin is always changing. There are two factors that you will want to consider when figuring out if Bitcoin mining can be profitable for you. The first is whether you can manage to mine any bitcoins using any of the various mining rigs available. The second is whether you can trust a ROI which is usually measured in weeks to months, but it is never fully guaranteed.
4.3 Conclusion and future of Bitcoin mining
As block rewards continue to decrease, the early years of mining will be far more effective than the latter. The halving of the rewards is seen as a deflationary measure because it enforces scarcity to the currency. If the rewards were higher, there may be potential for the currency to be devalued as the rate of coins would be too high. In the end, the halving will lead to an effective zero of new coins being created and when rewards end, transaction fees can be used to compensate miners. This system could also encourage individuals or mining pools to prioritize and exclusively mine off of fees. The security of the network is always dependent on the incentives for malicious party to disrupt the network. In the case of bitcoin, it would take an irrational amount of money to attack the network in comparison to the potential gains from double spending and undermining the system. High double-spending cost and low menace value, allowed to continue because of the ability to pay for the costs using block rewards and inflation, all point to security levels increasing in the short run but eventually stabilizing. All analysis on the future of mining is speculative at best. The possibility of technological improvement makes it so efficient and cheap to mine that the electricity costs are trivial. High energy efficiency will lead to less heat generation and a lower environmental impact. Or perhaps mining rig production will divert resources away from wasteful proof-of-work systems. These are alternative methods to mining, for the same rewards, on the same network. Measures could be implemented to decrease mining centralization, which may be a source of inefficiency, but it is arguable if centralization can be avoided in any competitive free market system. At the current rate, it is believed that individual hobby mining will operate below profitability, with most operations being squeezed into free electricity in hope of future price appreciation. Step by step, the density of data centre operations will increase to fit the competing requirements of economies of scale, combined with the race to the technology frontier. This is until profitability converges with the near-zero price of new coins and a primarily transaction fee-based reward. The future is uncertain, but ultimately, it will be the free market that determines the most efficient use of resources to maximize utility.