I am currently looking on how does Bitcoin work, and I would like to sum things up with your help. The point is, if I ever want to write my own mining agent, what do I have to understand in order to do so ?
First Point: The Data
Through my research, I didn't really understand WHO gives the current hash to work on. I know that it is working as a P2P network, and I think, but not sure, that all clients connected to the network are aware of the transactions.
But what should I do if I want to have access to the latest OFFICIAL (might not be the best word) block, without being in a mining pool ?
Second Point: The Computation
If I undestood this part, I have to try every nonce until sha256(sha256(data + nonce)) meets the requirements from Bitcoin.
Third part, submitting the answer
Assuming I found the right nonce, how can I submit my result. But I didn't find how I can do that.
I want to make this point clear, I want to be SOLO, not mining solo, but if I wanted to write my own mining program, how could I do that WITHOUT being in a mining pool and finding information all by myself.
Thanks for your answers.