What is Bitcoin mining?
In fiat money systems, governments print more money when they need to. But in bitcoin, money isn’t printed at all – it is mined. Using computers and specialized software miners solve math problems that process bitcoin transactions and are rewarded with bitcoins in exchange.
How does mining work?
People send bitcoins to one and another through the bitcoin network and it’s the miner’s job to verify every transaction made. In turn, they are rewarded with transaction fees and a subsidy of newly created coins called block rewards.
Making a hash of it!
Any transaction that is successfully processed is added to the general ledger. The general ledger is a long list of blocks referred to as the blockchain. Every successful transaction between bitcoin addresses can be explored at any point on the network.
This general ledger is a long list of blocks, known as the ‘blockchain’.
Any completed transaction is added to the blockchain, creating a list of every that has ever taken place on the bitcoin network. An updated copy is given to everyone who participates, so they’re kept in the loop.
But the blockchain has to be trusted and we must make sure it hasn’t been tampered with. This is where the miners come in.
Every time a block of transactions is created miners put it through a predefined process. They take the information that was on the block and apply a math formula to it, turning it into a sequence of seemingly random numbers and letters called a hash. This hash is stored along with each block at the end of the blockchain at that particular time.
Since each block’s hash is produced using the hash of the block that precedes it, it becomes a digital wax seal. As if it was tampered with, everyone would know and simply discard the block.
You can’t fake a transaction by changing a block that’s already on the blockchain as if someone checked the block’s authenticity they’d find the hash was different from the ones already stored along with the block in the blockchain.
Competing for coins
So, miners compete with each other using software written specifically to mine blocks and ‘seal off’ blocks that are legitimate.
Every time they seal off a block they get a reward in bitcoins, the blockchain is updated and everyone on the network is notified. That’s the incentive for miners to keep mining and keep the transactions running smoothly.
Hashes are actually very easy for computers to produce which is why the bitcoin network has to make it more difficult. If they didn’t everyone would be hashing hundreds of blocks each second and all the bitcoins would be mined within hours. The bitcoin protocol makes this process harder by demanding something called ‘proof of work’.
This means that any old hash won’t do. A block’s hash needs to have certain characteristics such as having some zeroes at the start. No one can tell what a hash is going to look like before producing it, and as soon as you throw in a new piece of data, the hash will be different.
So, in a nutshell, the aim of mining is to use your computer until it comes up with the right hash value and you will have mined the block, gained the reward and validate the transactions.