I read almost every answer on Bitcoin Stack Exchange and bitcoin wiki but there are still things that trouble.
I would really love to understand it.
I have no IT background and therefore I'm unable to read code and come up with answers to my questions.
Questions are:
1. One has no way of predicting what a hash function will spit out, that's why you add nonce to transactions and voila you are the winner if you get a hash below certain number.
Now the question is: Is it possible for every nonce coupled with transactions to produce a number greater then required? What happens then?
2. It's often cited that if you don't include transaction fee the miners won't include the transaction for a long time and if you do include the fee it will get 1 confirmation every 10 minutes. How do miners "know" that transaction fee is included if they work on hashes of transactions?
3. How does pool mining work?
I understand that each individual miner is handed a piece of the puzzle to solve.
Each pool miner isn't a node in the network.
Pool software is a node in the network
So how does pool software "hand out" tasks?
Does it say to individual miner in the pool: here, you try these transactions with nonces 1-1000000 and to other miner you try nonces 1000001-2000000?
Also if miner finds a nonce that solves a block what is to prevent that pool miner saying: "Screw the pool I'm having 25 BTC for myself and I'll broadcast the nonce and the hash?
How does pool handle that problem, after all the pool cannot simply make miners do some useless proof-of-work. The pool being a node has to come up with solution to be rewarded?
4. When you are mining you are combining transactions + nonce to create the winning hash, but transactions are constantly flowing in. How is that handled?
Thanks!
I also apologize if the answers are readily available, I couldn't find satisfactory answers.