There are many descriptions of what mining is, but none of them describe it exactly. From what I gather:
Mining means finding a nonce c such that for some information s the hash value h(s||c) begins with a certain number of zeros (h is sha-256, || concatenation).
The "information" is given here. The nonce is an integer that is incremented in the mining process. But it seems that it's not s||c that is hashed, but rather there is some double hashing going on, but of what, h(s)||c, h(s||c), h(s)||h(c)? I can't deduce it from the Python code in the previous link (NB: I'm code illiterate).
Also the nonce isn't just initialized at zero and then incremented until there's success:
To avoid risking wasting work in this way, there needs to be a random starting point, and so the work becomes to find H(s,x,c)/2^(n-k) = 0 where x is random (eg 128-bits to make it statistically infeasible for two users to maliciously or accidentally start at the same point), and c is the counter being varied, and s is the service string. (source)
But that's the article describing hashcash, and who knows bitcoin might not have implemented the hashcash protocol as it was proposed.
So my question is, what is the exact protocol? I'd go and read the source code if I could but like I said I'm not code literate. Surely the answer must be possible to formulate concisely, something like:
Compute h(s||c) where c runs over 0,1,... until value begins with 15 zeros.
Hash s and obtain x in manner X, then compute h(h(s)||c) where c runs over x,x+1,..., until value begins with 17 zeros.
Sorry if this has been asked before, if so clearly I'm googling the wrong words, thanks.