The process of securing the blockchain is called mining. Thousands of dedicated computers and high-end computing devices are continuously attempting to compute a valid block hash and add a new block of transactions to the blockchain. The Bitcoin software run by miners enforces the rules of Bitcoin, rejecting any invalid transactions or blocks, such as those that might try to use bitcoins that have already been spent.

The lottery of block-finding is extremely difficult and competitive, so that it is more profitable for a would-be attacker to simply make new blocks than to attempt to replace past blocks or “erase” stored transactions. To compensate for a growing computing power of miners, the difficulty of finding a block hash automatically adjusts about every two weeks to maintain an average of six blocks per hour.

Mining is also the method by which new bitcoins are created. As an incentive to encourage a higher difficulty against attack, mining a block includes a reward – newly created bitcoins paid to the miner. The amount generated per block started at 50 bitcoins in 2009, but the reward amount is halved approximately every four years (every 210,000 blocks). This formula ensures a maximum money supply of 21 million bitcoins will be distributed.

While mining was originally performed using general-purpose computers and the reference Bitcoin client, and then high end graphics cards (GPUs), it is no longer practical or energy efficient to mine using less than specialized hardware devices designed only for mining (using FPGA and now ASIC technology).

Since it may take years for an individual miner to find a Bitcoin block and claim the full reward, most miners pool their resources into a mining pool, to receive regular reward payments. A pool is an independently run organization running Bitcoin that coordinates computing resources and pays out fractional rewards to individual miners.

㋔ Geek Facts

Each bitcoin block has a double-SHA256 cryptographic hash that is the main “block hash” – a hash of the contents of the block (technically, the top hash of a Merkle tree of transactions in the block). Hashing algorithms such as SHA256 create a digital fingerprint of data that cannot be easily falsified, as their output is unpredictable and irreversible by design. This is the puzzle that Bitcoin mining uses to secure the blockchain – since the output of SHA256 is unpredictable, it is very hard to find a hash that looks like something you specify.

Bitcoin’s mining challenge is to find a block hash that starts with many zeros; the more zeros desired at the beginning of a 256-bit hash (and the smaller the value), the more difficult it becomes to find one. 256-bit hash output is a random-looking 64-character hexadecimal number. A completely different hash will be obtained by only changing a small amount of data in a block; miners change a special area of block data called a nonce, and then check if the hash of that data is a “winner”. Only after discovering a hash of a group of transactions that is smaller than the current difficulty target can a transaction block be added to the blockchain. This proof-of-work system makes falsifying or altering the Bitcoin blockchain computationally difficult.

Next: Transaction Fees >>