What computations does Btcoin perform during mining?

-1

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?

Salvador Dali

Posted 2012-09-19T22:21:27.543

Reputation: 3 050

Question was closed 2012-09-20T08:35:18.880

Do you mean when mining? Could you please edit your question to clarify thatHighly Irregular 2012-09-19T22:40:47.950

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 2012-09-20T06:27:25.010

Answers

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.

ThePiachu

Posted 2012-09-19T22:21:27.543

Reputation: 41 594