Take the 2-minute tour ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

Possible Duplicate:
What exactly is Mining?

What are the exact computations dies Bitcoin is performing during the mining?

I understood that it has to do something with hashes and proof-of-work.

And as far as I got, here is an idea:

SHA-256(something) = specific string

where specific string starts with some zeros, but what is this something?

share|improve this question

marked as duplicate by Stephen Gornick, Serith, ripper234, D.H. Sep 20 '12 at 8:35

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Do you mean when mining? Could you please edit your question to clarify that –  Highly Irregular Sep 19 '12 at 22:40
    
I edited the question a bit to clarify the problem and conform with Higly Irregular's comment. I hope it is more acceptable to the community now. –  ThePiachu Sep 20 '12 at 6:27

1 Answer 1

Bitcoin hashes the block headers through SHA-256(SHA-256(header)) hashing. The result of that hash has to be smaller than the current target, which is commonly represented by difficulty.

Those computations are performed many, many times during mining, so there are some slight optimisations for the process. Namely, the use of midstate. Generally, before the header can be hashed, it needs to be split in half due to the SHA-256 algorithm (which operates on data smaller than the header). Half of that data does not change with iterations over the nonce, so it is useful to calculate the midstate of that half of the hashing to use in the algorithm, saving you some computational time during each check.

Asides from that, there is more complexity to it (ah, the damned endianness and so forth), but this should make things clearer for you.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.