Bitcoin mining is the method with which users are able to receive new bitcoins, provided to the users as a reward for mining. This is the method by which bitcoin is able to both track and verify transactions as well as produce new bitcoins.
To mine bitcoin, a user needs to have a computer to run the mining software, modules and hardware. With this gear, the user will listen for transaction broadcasts through the peer-to-peer network and perform the appropriate tasks to process and confirm these transactions. This confirmation will then be added to the public ledger, or blockchain.
The new bitcoins are rewarded to the miner who first solves the mathematical problem, or puzzle, to complete the block gets to place the next block on the blockchain and claim the reward, which includes the transaction fees associated with the transactions compiled in the block as well as newly released bitcoin.
The mathematical problems that users are trying to solve are cryptographic has functions. Simply put, this is a one-way encryption without a key. It receives an input and produces a random, fixed length hash value. Any change to the input will result in a completely different hash value, which makes the blockchain secure since nobody can repeat inputs (such as, for example, try to spend the same bitcoin twice). Since the output of these hash values are random, it is theoretically impossible to predict the hash value – thus allowing bitcoin to use these as proof of work and validation. Miners are trying to find the input that matches to the hash value.