In this thread I would like to gather all of my bitcoin questions I have. As many as I can think of, like how mining works, how bitcoin transaction works etc.
1) Okay so the first question I have is about blocks. If you go here:
https://blockchair.com/bitcoin you will see a transaction live count. It gets increased and decreased as well.
Why it does? Are miners involved in this?2)
Why block generation time is always standard? Every day 144 blocks are created (since 210240 every 4 years, I did the maths). Why? I've never seen such question anywhere. I think on our wiki it says new block every 10 minutes.
3) Mining is the main source of questions. To start with, miners want to mine for 2 reasons. For guessing the hash of a block meaning that they will earn 12.5
BTC and for earning bitcoins from transactions fees.
After a lot of research I have understood that each block's hash has to do with the previous block and some other things (like SHA256(some stuff in here including the prevBlockHash)).
What exactly are we trying to guess? And even we if we guess that "thing" correctly,
who promises me that it will write to the blockchain that "this guy mined 12.5BTC from x block".And then
how my blockchain file will be shared to all the other blockchain files of the world? So the network will confirm that I really earnt 12.5BTC.
Now about the transaction fee. When I send 50BTC to an address with a fee of 0.002BTC,
does this mean that I write publicly something to the last block?. Since there is no main database of bitcoin transactions,
how will the blockchain updates that I want to send x number of bitcoins to an address? And then miners see the last block's transactions and choose what transaction to solve. I know that if they solve the transaction hash (?) they will get the fee as a reward.
But what exactly are they trying to do in order to solve it?4)
What is a target and why the block's header must be equal or lower than this number?In our wiki we have written what's a target:
https://en.bitcoin.it/wiki/TargetThe thing I don't get is here:
Each hash basically gives you a random number between 0 and the maximum value of a 256-bit number (which is huge). If your hash is below the target, then you win. If not, you increment the nonce (completely changing the hash) and try again.
If my hash is below the target?? The hash is a string and the target is a 256-bit number right? How to compare a string with an int?
Examples
(Hash: 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
Target: 0000000000000000001320bc0000000000000000000000000000000000000000)
5) If I want to send 50
BTC to an address with a fee of 0.0002 do I spend 50.0002
BTC and the receiver gets 50
BTC or do I send 50
BTC and the receiver gets 49.9998
BTC?
These are my main questions of bitcoin, I know that I may have made some misunderstandings. Please be patient with me., I may think of others too, because that's not something quick, queries get bornt over time. The above questions have been googled, believe me too much, but I get answers that are not enough to solve the problems of my head. Trying to attach all this information the internet gives me and I always fail...
Note that I'm not stinking my merits to whoever solves my questions. Of course I will reward him. That's the point of merits anyway.