Bitcoin mining is more like a gigantic lottery where individuals compete with their mining hardware against everyone on the network to earn bitcoins. Efficient Bitcoin mining hardware will attempt more tries per second to win this lottery while the Bitcoin network adjusts itself roughly every two weeks to keep the rate of finding a winning block hash to every ten minutes. Transactions are secured in Bitcoin mining and recorded in Bitcon’s public ledger, the block chain. By conducting a random lottery where electricity and specialised equipment are the price of admission, the cost of interupting the Bitcoin network escalates with the amount of hashing power that is being used by mining participants.
Video courtesy of: www.BitcoinMining.com
An individuals Bitcoin mining hardware runs a cryptographic hashing function (two rounds of SHA256) on what is called a block header during mining. For every new hash that’s tried, the mining software will use a different number as a random element of the block header, this is called the nonce. The hashing function will yield a hash which looks something like this depending on the nounce and what else is on the block:
To keep blocks coming roughly every 10 minutes, the difficulty is adjusted using a shared formula every 2016 blocks. The network tries to change it such that 2016 blocks at the current global network processing power take about 14 days. That’s why, when the network power rises, the difficulty rises as well.