ADS

There are generally two types of articles out there describing how bitcoins are mined: the dense and technical, or the simple and vague. This article will attempt to strike a balance between the two by starting with the foundations of Bitcoin and working up.
You probably know that mining creates new bitcoins, but its underlying purpose is actually to verify transactions, keep the record of those transactions up to date, and secure the bitcoin network from thieves and hackers.

The blockchain

Jake Smith (@BeijingBitcoins), author of the Bitcoin News Roundup newsletter, says, “Many people who denounce bitcoin as a scam or ‘internet funny money’ fail to recognize the fact that it is in fact a revolutionary new invention, perhaps as important as the invention of the internet or email protocols.” To understand Bitcoin mining, you first must understand the blockchain, which is one of the defining qualities that makes Bitcoin so unique.
The blockchain is a record of every single Bitcoin transaction that has ever taken place. Ever. It serves as a public ledger for everyone to see. When you download and install the original Bitcoin client on a computer, you also download the blockchain, which constantly expands as more transactions take place around the world. Note that the blockchain is getting quite big at this point, so most modern Bitcoin wallets don’t contain the entire thing.
“Casual users have absolutely no reason to ever download the blockchain. I’m as hardcore of a user as they come and I’ve never even downloaded it,” Smith says. “One should only intend to download the whole thing if they plan on running a node or mining.”
The blockchain may as well be written in stone, because it’s exactly the same on everyone’s computer who has the Bitcoin client installed. “It’s impossible to go back in time and reverse transactions or edit the information,” Smith explains. When you want to send bitcoins to another user, the miners all verify that the address you are sending the coins from actually contains enough bitcoins to complete the transaction. Smith says, “It’s possible to create a transaction input that makes it look like I’m, for example, sending you five coins when I have zero coins. But as soon as that goes through the miners, it will be rejected as I do not have the balance to cover it.”
Every 10 minutes or so, new transactions are added to the blockchain in blocks. Each new block contains two important things: a list of every single transaction that took place around the world in the last 10 minutes, plus a code – called a hash – that references the block that came before it, thus the “chain” part of the blockchain.
It’s the job of miners to take these two pieces of information and condense them into a new hash that fits a certain criteria (it must start with a certain number of zeros), which takes significant computational power. The difficulty of doing so increases (more zeros needed) for every 2016 blocks added, or about once every two weeks. Essentially, they are trying to solve, as Smith puts it, “an arbitrary problem in order to find this ‘magic number’ with an ever-increasing difficulty to ensure that as more computing power is thrown at the network, there is still only an average block time of around 10 minutes.”
These hashes are much easier to compare rather than trying to keep track of every individual transaction in the world. And because each one references the hash that came before it, it revalidates every single transaction repeatedly down to the original “genesis” block.

Risks and rewards

Bitcoin faces two plausible attacks: traders who try to spend or sell the same bitcoins twice, and malicious miners who try to inject fake blocks into the system so they can receive new bitcoins. Mining is a way to secure the network from both these attacks.
The “double spending” problem is minimized because only one of the two transactions will ultimately make it into the blockchain. Even if both are verified at first, miners continue to validate them as more blocks are added until one or the other wins out. This is why many exchanges wait until a block has been validated six times (takes about one hour) before accepting a trade.
Injecting fake blocks requires more trouble than it’s worth, so long as there are more miners than hackers verifying the real transactions.
In return for their service, miners who successfully “solve” a block are rewarded with 25 bitcoins plus some transaction fees. This number is cut in half every 210,000 blocks, or about once every four years.

How to start

These days, mining bitcoins usually requires special hardware. When the cryptocurrency was in its infancy, it could be mined using personal computers because the difficulty was very low. But as more miners enter the fray and computing power rises, the system automatically makes solving blocks more difficult in order to control the influx of new bitcoins onto the network.
ASIC mining is the preferred method these days. It’s a microchip specially designed just for solving the hashing algorithm used by Bitcoin (SHA-256, which is used by people around the world for encrypting information). The software for mining is typically open source and free. The software connects the users to their mining pools, runs the algorithm to solve the hash, deposits the miners’ earnings into their bitcoin wallets.

No comments

Powered by Blogger.