You can think of hashing as a 'mathematical equation' where you produce a (random) output depending on the input.
"Random" makes it sound like it is different every time. If you use the exact same input, you will get the exact same output, every time you calculate it. It might be better to describe it as "unpredictable". There is no known way to predict what the output will be without actually performing the calculation. Even the smallest possible change (one bit) to the input will completely change the output in unpredictable ways.
Now, when you mine, you are basically calculating hashes (with the TX's as input)
More specifically, the BLOCK HEADER as the input. The 80 byte block header consists of 6 pieces of information:
- The 4 byte version number
- The 32 byte SHA256 hash of the previous block in the chain
- The 32 byte Merkle Root (calculated by hashing the transactions that are included in the block)
- The 4 byte timestamp (represented as number of seconds since Midnight the morning of January 1, 1970)
- The 4 byte representation of current mining difficulty
- The 4 byte nonce (a value that has no meaning and exists solely so that you can change the input to the mining function)
The miner manipulates the value of the nonce prior to each hashing attempt so that they can get a new hash result.
until you have found a hash with X leading 0's. How much 0's are needed is defined by the difficulty of the network.
Actually, you are looking for a hash that has a lower value than the current difficulty target. Smaller targets do result in more leading zeros (0000123 has 4 leading zeros and is less than 0001234), but it is possible that two values could have the same number of leading zeros and only one of them is a valid proof-of-work (imagine that the target is 0004567, in that case 0005678 and 0003210 BOTH have 3 leading zeros, but only one of them is lower than the target)
This difficulty adjusts every 2 weeks to get a 6 blocks per hour 'speed'.
Actually, the difficulty adjusts every 2016 blocks. If the blocks are being solved at an average rate of 10 minutes per block, then that works out to 20160 minutes (which is 14 days). If blocks are being solved faster than an average of ten minutes each, then the adjustment will happen sooner. If blocks are being solved slower than an average of ten minutes each, then the adjustment will happen later. The adjustment is proportional to the difference between 20160 minutes and the actual amount of time that it takes to solve the 2016 blocks. That way the new difficulty should result in an average amount of time to solve a block which is closer to 10 minutes.
Each time you mine a block the first transaction in this block is the coinbase transaction (has nothing to do with coinbase.com).
This coinbase transaction contains the freshly mined BTC's to the miners address.
Correct. It is also sometimes called the "generation transaction" or the "block reward". In addition to the block subsidy, aka "freshly minted BTC's" (currently 12.5 bitcoins), this transaction ALSO includes the sum of all the transaction fees of all the transactions in the block.
The description "coinbase transaction" existed prior to the Coinbase business. Since the business was built as a way to buy and sell bitcoins, they used an existing bitcoin word as the name of their business.
This is also true of blockchain.info. Bitcoin, and the bitcoin blockchain, existed before the blockchain.info website. Since the website was created as a way to see information about the bitcoin blockchain, they used the existing bitcoin word as the name of their website.
Basically its a probability game. The miner with the highest hashrate (most calculations per second) has the highest chance of mining a block (calculating a valid hash) proportionally.
Correct.