Thank you mikeywith for your detailed explanation.
Nop, when the last block has been mined, every miner is trying to mine A block, it just so happens that it gets the number n+1,
I don't understand this.
So, it's possible that a miner is trying to mine block number n+2, while block number n is the last block and the block number n+1 has not been mined.
Am I getting you correctly? If so, how is that possible? How can you mine block number n+2 without knowing the hash of block number n+1?
Isn't that all miners are trying to mine the block number n+1 and they start to mine block number n+2 once they receive block number n+1 and confirm that it's valid?
This isn't how it works, using the word faster is simply wrong here, it makes it sound like mining is just like a car race where when one car reaches the finish line, everyone goes back to the start line and races for another round, this obviously isn't the case, because if it was, then all blocks would have been won by the fastest miner, which is what you would expect in a car race whereby the faster car would always win the race, mining is not like that and that's why a miner with a tiny fraction of hashrate can find block n+1 "before" the large pools who have the remaining 99.9999999999999999% of the hashrate.
Sorry, I still don't understand why the word "faster" isn't correct here.
To me, mining is like a race, but it's not that there's a fastest car that always wins the race. Sometimes car A wins the race, sometimes car B wins the race and so on.
Let's say there are only two miners. You and me. You have 70% of the total hash power and I have 30% of the total hash power.
Now we both are trying to mine a block. I am trying to be faster than you and be the one who mine the block. I have 30% chance to mine the block (or 30% chance to reach the finish line before you).
Sometimes I am faster than you and sometimes you are faster than me.
I think what makes all the confusion is the block height because blocks go in order "chain", it gives the illusion that if someone found block n+1 it means they won against everyone else and then everything magically resets and they head for another round of block n+2 which as I explained isn't the case, simply everyone is randomly and independently solving blocks, it just so happen that blocks found are labeled/named/numbered in a series of n+1,,,, etc.
You are right. I also think that that's where my confusion comes from.
I still can't understand how is it possible that a miner can try to mine block number n+2 while block number n+1 hasn't been mined yet.