30 April 2017

Bitcoin Mining


bitcoin value





Bitcoin Mining - We should have a gentleman’s agreement to postpone the GPU arms race as long as we can for the good of the network. It’s much easer [sic] to get new users up to speed if they don’t have to worry about GPU drivers and compatibility.


It’s nice how anyone with just a CPU can compete fairly equally right now. —Satoshi Nakamoto, December 12, 2010, the same day the Nakamoto account posted its “final” message.



Mining Bitcoin was once seen as the path to near-instant riches without any investment. By the time people realized it was something akin to that, it stopped being that. These days, mining is probably the least-effective way to obtain and invest in Bitcoin.





As I covered previously, mining is the process that confirms Bitcoin transactions. Participants in the network solve increasingly difficult mathematical equations to find what is called a “block” roughly every 10 minutes. Each block has a group of transactions as well as a condensed version of the previous block. If anything in the chain of blocks is changed, it will change the hash of the next block and therefore every block after it.

So changing a previous transaction is not an easy task and would require recomputing the entire chain from that point. Therefore, participants can be assured that the longest chain is the correct one. This is how Bitcoin works and these miners are rewarded a small number of bitcoins every time they correctly solve a block, through a combination of transaction fees and new bitcoins being created (until the 21 million bitcoin limit is reached).





How complex the mathematical equations are is determined by the amount of total computing power—called hashing power—on the network. The difficulty of mining is adjusted every 2,016 blocks based on how quickly the last 2,016 blocks were solved. Once it became clear that there was something to this magical Internet money, people started jumping in and mining with ever-improving hardware.

It quickly became an arms race with the first weapon coming in the form of gaming-focused video cards, then computers designed specifically to mine, and eventually chips specifically made for mining called ASICs (application-specific integrated circuits).





Bitcoin quickly went from a distributed digital currency that anyone could mine and that embodied Satoshi Nakamoto’s directive that “one CPU equals one vote” (i.e., that everyone with a computer could have an equal say in the validity of the blockchain and an equal chance at being rewarded bitcoins) to a fairly centralized and extremely competitive environment where only those who can afford to compete are able to.





I am not saying that Bitcoin has failed to embody Nakamoto’s original vision, just that the specific aspect of mining hasn’t lived up to the hopes of Bitcoin’s creator. Even in 2010, Nakamoto and the rest of the community were aware of the coming arms race. We don’t know what he would have thought of the ASIC farms that dominate the mining market today but it is clear that the current mining situation is far from his original hope of one-CPU-one-vote that was laid out in the original Bitcoin white paper.





Anyone can still mine, technically, but it is unlikely to bring in any rewards even if one uses a high-powered computer. What will happen instead is the miner will consume a lot of electricity and possibly damage the computer’s CPU or GPU by overworking it. This warning does not stem from an overabundance of caution. I myself used my PC to CPU-mine some altcoins for a story and my computer’s CPU has had overheating problems ever since. I’m not alone in that experience.

Users can contribute by running a full node, which is basically just a Bitcoin wallet that has the entire Bitcoin blockchain downloaded and helps double-check transactions already confirmed by miners. They do not participate in the arms race and therefore do not reap any mining rewards but there has been some talk of adding a reward incentive for them.





Running a full node is recommended for someone looking to contribute to the Bitcoin network in a charitable way. It also comes with certain advantages for privacy-minded folk. If you run your own node, you can be sure that the node is not acting maliciously as you will be submitting your own transactions to the network, rather than depending on a third party.





As for mining, it is not for those light in the wallet. It takes a four- or five-figure investment to have any hope even of recouping your investment because of the arms race. Even if you manage to do so, the profits will still be razor-thin and any mishap in the form of hardware, power, or connectivity issues could make them thinner still. As the difficulty goes forever upward, the needed investment to turn a profit will only increase. Keep these warnings in mind.



If you are still determined to turn electricity into Bitcoin, you can do so and there are a few different ways of doing it.





First, if you don’t have cheap electricity, don’t bother with mining. It is difficult enough to turn a profit with cheap or even free electricity. Trying to do it somewhere with prohibitively expensive electricity is impossible. Mining is all about competing, and it is difficult to compete with people who have much lower expenses.





The avenues open to potential miners are getting more restricted every day. There are technically three options: solo mining, pool mining, and cloud mining. Cloud mining, is really a fancy way of saying you are paying someone else to mine for you. Solo mining is only for hard-core masochists who would rather take the virtually impossible long shot of solving a block without the benefit of the massive hashing power obtained when joining a pool.





Most mining is done in pools. Pool mining is when a group of miners decides to group their hashing power together and share the rewards. This approach depends on some trust, since the individual miners have to trust that the pool operator will divvy out the rewards appropriately. Dishonesty would be noticed fairly quickly, however, and would do irreparable damage to the pool’s reputation. The pool itself might even evaporate overnight and participants switch to another, more reputable pool.





Pool mining and solo mining both depend on some technically challenging software that runs in command-line on both Windows and Linux. Some other software adds a pretty user interface, but the general idea is to run your miner with as little extra software taking up computational power as possible. CGMiner is the most popular version out there. It takes a little knowledge to get it running, but it isn’t too daunting of a task.





The first step is to find a reliable and safe version of the software. Mining software can sometimes set off false positives for virus scanners. Because of this, mining software is often packaged with actual malware by third parties. This is why it is extremely important to download your mining software only from official and trusted sites.





Before setting up a miner at home, you should read an online guide from the pool you choose in order to make sure everything is set up to match their specifications. I include a quick guide here for the curious. One thing to keep in mind is that while mining is relatively simple, it isn’t designed for the computer-illiterate. There seems to be a perception in the community that mining shouldn’t be made easier for mainstream users, since more people will mean more competition and more difficulty, and that will decrease the profits that miners can get with their current hardware.





Mining isn’t really that difficult, though. Practically anyone can do it by following a few simple steps. Just don’t expect a pretty user interface that makes things simple. Most proof-of-work coin mining will work based on very similar methods but always make sure to consult your pool’s guide.





Step one is to download mining software: CGMiner or BFGMiner. For the purposes of this guide, I will focus on CGMiner but the BFGMiner process is virtually identical. I will cover the process for Windows first.





After downloading the software, join a pool, create a “worker,” and give it a name on the pool’s website. Find the site’s mining IP address—it should be readily visible on the pool’s website. If you can’t find it, check the site’s FAQ page. It should be a TCP address.





Next, open up a text document in Notepad or similar program and type the following:


cgminer -o stratum+tcp://[enter pool URL here]:[enter port number here] -u [pool username].[pool worker name] -p [Enter your pool account password here]


Click “Save As” and change the file extension from .txt to “All files.” Name it “StartMining.bat” and save it in the same folder as your CGMiner. You can now click that file and your miner should start mining automatically.





You should see a continuously updated log file of your progress and a summary of your hash rate. From this screen, you can also update your mining details and manage what pools you are mining into.





If you would prefer to solo mine rather than mine into a pool, that process is simple as well (minus the hardware requirement). First, you will need to download Bitcoin Core, or Bitcoin-Qt. This requires downloading the entire blockchain, which will not be a quick process. The blockchain has been experiencing rapid growth and sits at more than 52GB at the moment. By the time this book is published, the blockchain will be even larger. The process is peer-to-peer, but you likely won’t see speeds matching those of well-seeded torrents by downloading through the network. You can speed things up by downloading the first 20GB or so from a server, but plan for the download to take a day or even two.





Once you download the blockchain, you will have to make a small adjustment to the Bitcoin software to get mining started.





You can technically mine with just your CPU and a wallet but that is a quick way to burn out your CPU (with GPU-focused coins such as Bitcoin, anyway). 


For those who are interested in the process (or for those who want to solo mine a CPU-focused altcoin), however, here is how it is done:


Open or create a file called “Bitcoin.conf” in Notepad. You can find it in the programs folder APPDATARoamingBitcoin. Add these eight lines:


server=1


listen=1


daemon=1


rpcuser=[Any name you want]


rpcpassword=[Any password you want]


rpcallowip=localhost


rpcport=127.0.0.1


port=[The port you want to use to talk to the Bitcoin network; 8332 should work]





Now, with your wallet fully synced and the Bitcoin.config file correctly edited, open the wallet software and click Help, then Debug Window, and then Console.





With the console command line open, type in set generate true -1 and the mining should start. To check whether it is running properly, type getmininginfo and information about current coin difficulty, current block, and your hashrate should be displayed.





There is also another option for the less technically inclined. GUIMiner is a piece of software that makes mining slightly more user-friendly. The blockchain still has to be downloaded but after the download, users simply have to download GUIMiner, run the program, and follow the simple steps the program will lay out. Use the information from the CGMiner guide and check the Devices section to make sure the program recognizes the GPU you want to use for mining.





If you want to get serious about mining—either solo mining or pool mining—you will have to invest a few thousand dollars in hardware. This is still no guarantee of easy profits and unless you have free or extremely cheap electricity, your money is almost assuredly better spent differently.





If you do have cheap electricity, you will have to buy some hardware. KnCMiner and Spondoolies are the two remaining enthusiast-level Bitcoin-mining companies, since both ButterFly Labs and GAW Miners have been taken down following a flurry of controversies. There have also been complaints about these two remaining companies, however. As is my general advice in all matters related to cryptocurrency, do your research before investing significant amounts of money.





Before buying any hardware, it’s essential to check a Bitcoin-mining difficulty calculator to figure out your likelihood of reaching profitability. These are websites and apps that ask you to put in your electricity costs, expected hashing power, and expected difficulty, and will calculate your expected profits. Simply Googling “Bitcoin mining calculator” should provide several suitable options.





I do not recommend buying used hardware. Mining is extremely tough on hardware and it is impossible to figure out how much damage has been done to the CPU and GPU of devices by looking at a picture on a seller’s website. Hardware with a shorter-than-expected shelf life can ruin an investment.





Cloud Mining




There is one method of Bitcoin mining that allows you skip all that hassle—but it comes with its own risks and, like every other method of mining, isn’t recommended. Few cryptocurrency advocates would call it mining at all. This method, which I introduced earlier, is cloud mining.



Cloud mining is a scheme that is rapidly gaining both popularity and notoriety. Proponents of cloud mining, who mostly consist of companies trying to sell you on the idea, will say it allows investors to mine Bitcoin without having to worry about the headaches that come with mining on their own. The companies will be the ones dealing with things such as electricity costs, machine upkeep, and technical problems.





Cloud mining works like this: mining companies build giant warehouse-sized mining farms, sell or lease little pieces of those farms to customers, and in theory—after taking their own fee—pay customers based on the hashing percentage they own.





What you are essentially doing is paying someone else to mine for you. At this point you are no longer mining yourself. Instead, cloud-mining customers are investing into someone else’s mining operations and have to hope that the operation will be more profitable than the fees paid and that the mining owner won’t skim money off the top.





Of course, you can’t even be sure that the company is mining at all. It is possible for cloud-mining companies to use the blockchain to prove they are actually mining and paying those profits to customers, but some don’t. If the company does not prove it has the hashing power it says it has, don’t go anywhere near it. Without that evidence, it is impossible to know whether what you are investing in is an actual mining operation and not a Ponzi scheme. 





Cloud-mining companies have been caught paying off older investors with new customers’ purchases, which is the very definition of a Ponzi scheme.





Some people contend that cloud mining doesn’t make sense. If mining is more profitable than the fees gathered from customers, the reasonable question to ask is, why wouldn’t the companies instead mine with that hardware themselves rather than pass those profits on to customers? Cloud-mining companies often say they use the money as start-up capital, but few, if any, have ever shown evidence to support this claim.

Typically, cloud-mining companies already own the hardware before they begin taking orders. And if that is the case, why not just mine with the already available hardware? If the company believes in Bitcoin mining and its long-term profitability—and says so in sales pitches—it simply doesn’t make sense from a business perspective to send those profits elsewhere.





However, I don’t want to suggest that all cloud-mining companies are scammers. I am only saying their business model is a little questionable and a lot of them are, in fact, scammers. So why do it? Well, there aren’t many other options. Solo mining is out of the question and even pool mining requires hardware that can hardly be called consumer grade. Again, I recommend that new users stay away from mining. It is too competitive to turn a profit and the difficulty is on a steady march upward.





Bitcoin mining is so difficult, even some mining companies stopped for a while. In January 2015, when the price dropped below $200 for the first time since 2013, mining difficulty did not match up with the price and the already thin profits for most miners disappeared. Many cloud-mining companies turned their users’ accounts off, stating that the maintenance fees charged to customers were set to outpace the likely reward.

As the price rebounded, so did mining profitability, and things have seemingly settled down since then. Still, this episode made it very clear that Bitcoin mining is not for the faint of heart. It should only be tackled by those who have the resources and gumption to deal with the unstable market. Eventually, had the price remained depressed, the difficulty would have dropped, but the price soon rebounded.





I don’t mean to say that mining itself is out of reach for the average user, just that Bitcoin mining is no longer feasible. One way to turn electricity into Bitcoin is to mine an alternative currency with a lower difficulty level and then trade that currency for Bitcoin. This approach still isn’t a path to quick riches, but the potential for profit is much higher than it is in Bitcoin mining. Early Bitcoin miners profited from the increase in Bitcoin’s price more than the increase in hashing power; the same concept can be applied to altcoins.





Like Bitcoin, most altcoins are secured through a proof-of-work method. There are three main algorithms that coins run, and hardware designed to work for one coin can be repurposed for any coin with the same algorithm. The three most popular algorithms are SHA-256, Scrypt, and X11. SHA-256 is Bitcoin’s algorithm and can be seen as the “basic” algorithm of cryptocurrencies—although it is anything but simple.

Scrypt was the community’s first attempt at heading off GPU mining rigs (i.e., mining rigs with multiple, powerful graphics processing units) and ASICs, and it is used by Litecoin and dozens of other currencies. Despite its best attempts, Scrypt ASICs have still managed to hit the market. X11, along with its offshoots X5, X6, X12, etc., is a CPU/GPU hybrid that is again designed to slow the growth of ASIC miners; its most popular coin is Dash (formerly Darkcoin).





There are a lot of people with expensive but obsolete hardware out there and many of them are looking to point that hashing power at something. That is one reason why the altcoin-mining space is getting more competitive. SHA-256 ASICs that are no longer effective at mining Bitcoin can be pointed toward currencies with a smaller network and lower difficulty.

The problem is that although that machine may be underpowered for the Bitcoin network, it can be extremely overpowered for smaller altcoins. This can and has led to the usually temporary centralization of mining operations for various coins. That has spread fears of a 51% attack occurring on these far less secure networks but no major accounts of such attacks have been reported so far.





Another reason for the increase in altcoin-mining difficulty has been the rise of multipools. These mining pools will focus on all the coins of a certain algorithm (SHA-256, Scrypt, etc.) and then mine the one that has the best combination of price and difficulty. The pool will switch automatically when another coin becomes more profitable. Generally, these pools will then dump those coins for Bitcoin or another digital currency of the user’s choice.





This kind of action isn’t always welcomed by the developers and communities of these smaller coins, which sometimes have their difficulty levels thrown out of whack thanks to the temporary and massive spike in mining power on the blockchain. These complaints have for the most part subsided as software was created to help ease the burden put on smaller coins. Meanwhile, coin developers realized that discouraging people from mining their coin was not only ineffective in getting them to stop but also ran counter to the political ideologies of much of the cryptocurrency community.





When picking a coin to mine, there are a few things to consider. First, is the coin pre-mined and if so, is it a reasonable pre-mine? A pre-mine is exactly what it sounds like. Before a coin launches, the developer creates a lot of that particular coin and puts it under his or her personal control. There are several uses for this fund, including paying developers or growing the community.





There is nothing wrong with setting aside some coins before the genesis block—the first block in a coin’s blockchain—if those funds are actually going to be used to fund coin development and it is a reasonable amount. If the pre-mine is larger than a few percentage points, then it is likely that the developer is running a pump-and-dump scheme. A typical suspicious pre-mine will consist of a large percentage of the coin’s total distribution, ensuring that even low prices will result in a significant profit for the creator.





The pre-mine “trick” isn’t used that often anymore, because most of the community has gotten wise to it. The blockchain doesn’t lie and will reveal any major holders of the coin and how much they hold. Some developers have tried to hide the pre-mine in the genesis block and then just ensure they get to mine that block, but even this tactic is an old one and is quickly noticed by members of the BitcoinTalk forums these days.





After you determine that a coin doesn’t have a pre-mine or that its pre-mine was transparent and reasonable—pure proof-of-stake coins need some pre-mine in order to kick off the currency—then the next thing to look at is how likely the coin is to get on an exchange. Most altcoins see their biggest jump in value when they get on a major exchange and the public’s interest is at its highest. Typically, early miners sell their coins at this stage and it is rare that an altcoin reaches those initial heights ever again. Therefore, when looking for a coin to mine, a good tactic is to mine a coin without exchange support and then sell it for Bitcoin once it gets on a major market.





Coins are more likely to be accepted to exchanges if they have an active development team and dedicated community that isn’t shy about promoting the coin by Tweeting at exchange owners and asking them to put their coin on the site. Although harassing exchange owners is not recommended, following social media is a good way to guess what coins will be added next.





If you are an early miner of a coin that becomes successful enough to get on the major exchanges, it is possible to make a profit after trading it into Bitcoin.





When Bitcoin was in its infancy, confirming transactions by mining was one of the easiest and cheapest ways to obtain Bitcoin. Today, it is arguably the most difficult and expensive way. Mining, regardless of whether you are mining Bitcoin or an altcoin, takes time, electricity, and technical knowledge. Purchasing coins is far more effective than trying to create bitcoins out of electricity. Unless you have free electricity, a huge bank account, or a lot of trust in a cloud-mining service, mining probably isn’t for you.

You might also like

Previous
Next Post »