Pages:
Author

Topic: Bitcoin mining solving equations, what it actually is? (Read 2193 times)

legendary
Activity: 868
Merit: 1006
It probably doesn't get any better than this in trying to explain what's going on in bitcoin's mining:

https://www.youtube.com/watch?v=y3dqhixzGVo

So now you know what to do if you want to do it manually.
This is a great insight into how much stress the mining machines go through. Imagine having to do that millions of time daily. That shows how secure the network is against attackers.
legendary
Activity: 1204
Merit: 1028
It probably doesn't get any better than this in trying to explain what's going on in bitcoin's mining:

https://www.youtube.com/watch?v=y3dqhixzGVo

So now you know what to do if you want to do it manually.
sr. member
Activity: 364
Merit: 252
- snip -
SHA256(SHA256(H, N)) < T, where H is the header, N is the solution (included as part of the header), and T is the target.
- snip -
- snip -
So when you write SHA256(H, N), is that a function of the two variables, H and N?

I suppose you could describe it that way.  More specifically:

SHA256 is the 256 bit SHA-2 hash of the block header.  You can read all about it here:
http://en.wikipedia.org/wiki/SHA-2

H is the block header (without the nonce solution)
N is the nonce solution that the miner is searching for.  It is actually part of H.

You can read about the block header here:
https://en.bitcoin.it/wiki/Protocol_documentation#Block_Headers

You see there that the header contains the nonce stored in the 77th through 80th bytes.

The miner builds the block header.  Then hashes the header using the SHA256 algorithm.

If the result is less than the current target (described as 'T' by odolvlobo), then the miner is done and has successfully "solved" the block.

If the result is NOT less than the current target, then the miner increments the nonce value and tries again.

The miner repeats this process until either:

  • They find a nonce that results in a SHA256 hash that is less than the target
  • They have tried ALL 4,294,967,296 possible nonce values and none of them resulted in a SHA256 hash that is less than the target

If they have tried all the possible nonce values and nonce of them work, then they build a new (different) block header, and try again.



Thanks for the clarification.  I'll do some reading on the links you shared, but it's making a lot more sense Smiley
hero member
Activity: 518
Merit: 500
Bitcoin miners are working on a very complicated mathematical puzzle that seeks the answer to: "What do we do with this extra electricity?"
A good time to wish everyone a happy earth day?
legendary
Activity: 3472
Merit: 4794
- snip -
SHA256(SHA256(H, N)) < T, where H is the header, N is the solution (included as part of the header), and T is the target.
- snip -
- snip -
So when you write SHA256(H, N), is that a function of the two variables, H and N?

I suppose you could describe it that way.  More specifically:

SHA256 is the 256 bit SHA-2 hash of the block header.  You can read all about it here:
http://en.wikipedia.org/wiki/SHA-2

H is the block header
N is the nonce solution that the miner is searching for.  It is actually part of the block header.

You can read about the block header here:
https://en.bitcoin.it/wiki/Protocol_documentation#Block_Headers

You see there that the header contains the nonce stored in the 77th through 80th bytes.

The miner builds the block header.  Then hashes the header using the SHA256 algorithm.

If the result is less than the current target (described as 'T' by odolvlobo), then the miner is done and has successfully "solved" the block.

If the result is NOT less than the current target, then the miner increments the nonce value and tries again.

The miner repeats this process until either:

  • They find a nonce that results in a SHA256 hash that is less than the target
  • They have tried ALL 4,294,967,296 possible nonce values and none of them resulted in a SHA256 hash that is less than the target

If they have tried all the possible nonce values and none of them work, then they build a new (different) block header, and try again.

full member
Activity: 238
Merit: 100
Bitcoin miners are working on a very complicated mathematical puzzle that seeks the answer to: "What do we do with this extra electricity?"

That cracked me up

sr. member
Activity: 364
Merit: 252
The mathematical problem/puzzle/equation that must be solved is this:


Find a number such that the double SHA-256 hash of the block header, which includes the number, is less than the target.


The target is determined by the difficulty.


Interesting.  You've explained this in a way that isn't difficult to understand.

Would you be able to give a sample of what the number, hash of the block header and target would look like in an equation?

SHA256(SHA256(H, N)) < T, where H is the header, N is the solution (included as part of the header), and T is the target.

Here is the current target (in hex): 0x00000000000000001717F0000000000000000000000000000000000000000000

If you look at block #353192 (https://blockchain.info/block-height/353192) you will see that N is 3813908736 and the result of SHA256(SHA256(H, 3813908736)) is 0x0000000000000000092f8a4cec04d9a6a9976139db98362656182fc4470b845e, which is less than the target.

Actually, that is a simplified explanation. There are other fields in the header that are modified to get a successful result: the timestamp and the merkle root values in the header are also adjusted.

Thanks, I appreciate the explanation Smiley

So when you write SHA256(H, N), is that a function of the two variables, H and N?
hero member
Activity: 518
Merit: 500
Trust me!
There are very helpful and correct answers in this thread, but there's one thing I have to add: It's being done this ways because verifying such a hash is incredibly easy (just put the input into the hashing function and you check whether the result qualifies as a valid hash) but finding the inputs that will qualify for those valid results can only performed via trying over and over again. Hard to find, but simple to verify.
legendary
Activity: 1512
Merit: 1000
Bitcoin miners are working on a very complicated mathematical puzzle that seeks the answer to: "What do we do with this extra electricity?"

This is the best explanation what I ever heard Smiley.
member
Activity: 82
Merit: 10
The mathematical problem/puzzle/equation that must be solved is this:


Find a number such that the double SHA-256 hash of the block header, which includes the number, is less than the target.


The target is determined by the difficulty.


Interesting.  You've explained this in a way that isn't difficult to understand.

Would you be able to give a sample of what the number, hash of the block header and target would look like in an equation?

SHA256(SHA256(H, N)) < T, where H is the header, N is the solution (included as part of the header), and T is the target.

Here is the current target (in hex): 0x00000000000000001717F0000000000000000000000000000000000000000000

If you look at block #353192 (https://blockchain.info/block-height/353192) you will see that N is 3813908736 and the result of SHA256(SHA256(H, 3813908736)) is 0x0000000000000000092f8a4cec04d9a6a9976139db98362656182fc4470b845e, which is less than the target.

Actually, that is a simplified explanation. There are other fields in the header that are modified to get a successful result: the timestamp and the merkle root values in the header are also adjusted.

Here's an ELI5 - PLEASE correct me if I'm wrong, but remember I'm putting it in the most simplistic terms:

As a miner you're putting together transactions and you need to find the hash of the whole block of transactions (this is very easy for computers to do).  This hash will be included in the next block to prove that it's part of the "chain."

Take a look at this picture (a digest can be considered the same as a hash):


See how drastically the numbers change even if one character is changed?  That's why double spending is difficult, because you have to alter ALL of the hashes in the next blocks - this makes bitcoin secure against double spends.

Now, bitcoin achieves decentralization in this through a protocol called proof-of-work.  It adds an extra step in this hashing.  Right now you have to find a hash that's LESS THAN this number: 0x00000000000000001717F0000000000000000000000000000000000000000000.  Basically we have to find a number with 17 0's in front of it.

Now remember how easy it is for the hash to drastically change (adding/removing ONE character)?  Well how to the miners find their hash AND make sure it's less than the target hash number.  How do we do this?  There's no "equation" for figuring this out, so computers just "guess."  It truly is a lottery and makes it decentralized because it appears to be random.

Within the block is a "nonce."  This is the number that the miner increments until it magically finds the hash we're looking for.  The nonce is the "proof-of-work."

TL;DR - miners are trying to find a certain value for their hash; they can only achieve this through guessing.  Changing the nonce, changes the hash.  They're cycling through nonce values until one satisfies the target hash value.  Nonce is the proof-of-work and helps achieve decentralization.
legendary
Activity: 4466
Merit: 3391
The mathematical problem/puzzle/equation that must be solved is this:


Find a number such that the double SHA-256 hash of the block header, which includes the number, is less than the target.


The target is determined by the difficulty.


Interesting.  You've explained this in a way that isn't difficult to understand.

Would you be able to give a sample of what the number, hash of the block header and target would look like in an equation?

SHA256(SHA256(H, N)) < T, where H is the header, N is the solution (included as part of the header), and T is the target.

Here is the current target (in hex): 0x00000000000000001717F0000000000000000000000000000000000000000000

If you look at block #353192 (https://blockchain.info/block-height/353192) you will see that N is 3813908736 and the result of SHA256(SHA256(H, 3813908736)) is 0x0000000000000000092f8a4cec04d9a6a9976139db98362656182fc4470b845e, which is less than the target.

Actually, that is a simplified explanation. There are other fields in the header that are modified to get a successful result: the timestamp and the merkle root values in the header are also adjusted.
mkc
hero member
Activity: 517
Merit: 501
Bitcoin miners are working on a very complicated mathematical puzzle that seeks the answer to: "What do we do with this extra electricity?"

This is pretty funny, I like it. and what do we do with extra computing power?
sr. member
Activity: 285
Merit: 250
Turning money into heat since 2011.
Bitcoin miners are working on a very complicated mathematical puzzle that seeks the answer to: "What do we do with this extra electricity?"
sr. member
Activity: 364
Merit: 252
The mathematical problem/puzzle/equation that must be solved is this:


Find a number such that the double SHA-256 hash of the block header, which includes the number, is less than the target.


The target is determined by the difficulty.


Interesting.  You've explained this in a way that isn't difficult to understand.

Would you be able to give a sample of what the number, hash of the block header and target would look like in an equation?
hero member
Activity: 574
Merit: 500
Quote
they get rewarded in bitcoins for solving every problem, he said these problems to solve are given by big drug development companies or defense sector companies, etc,
How could it be? Bitcoin is open source and no one can individual is able to  change the protocol or the blockchain secured by the total network.
legendary
Activity: 1302
Merit: 1008
Core dev leaves me neg feedback #abuse #political
The mathematical problem/puzzle/equation that must be solved is this:


Find a number such that the double SHA-256 hash of the block header, which includes the number, is less than the target.


The target is determined by the difficulty.

Thank you.

But what is the benefit and real world application of this, does any research facility get benefited out of this?

the benefit is network security.  solving a problem is the proof of work that acts as a sort of timestamping mechanism for consensus within a distributed system. 
full member
Activity: 238
Merit: 100
None. Your friend is misinformed.

There are other coins that solve more practical problems, such PrimeCoin, which finds a certain kind of prime number, and FoldingCoin, which is rewarded for folding proteins.

Ok thank you for clearing it up  Smiley
legendary
Activity: 4466
Merit: 3391
None. Your friend is misinformed.

There are other coins that solve more practical problems, such PrimeCoin, which finds a certain kind of prime number, and FoldingCoin, which is rewarded for folding proteins.
full member
Activity: 238
Merit: 100
The mathematical problem/puzzle/equation that must be solved is this:


Find a number such that the double SHA-256 hash of the block header, which includes the number, is less than the target.


The target is determined by the difficulty.

Thank you.

But what is the benefit and real world application of this, does any research facility get benefited out of this?
legendary
Activity: 4466
Merit: 3391
The mathematical problem/puzzle/equation that must be solved is this:


Find a number such that the double SHA-256 hash of the block header, which includes the number, is less than the target.


The target is determined by the difficulty.
Pages:
Jump to: