Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: bensam12345 on April 21, 2015, 05:09:24 PM



Title: Bitcoin mining solving equations, what it actually is?
Post by: bensam12345 on April 21, 2015, 05:09:24 PM
One of my friend told me that mining equipment s of Bitcoin are used to solve major mathematical equations and problems and 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,  who cannot afford to have a super computer to solve the problem, was he right in what he said or am I missing something, are bitcoins given as rewards for solving such problems?, I need to get clarity on this right now once and for all.


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: odolvlobo on April 21, 2015, 05:14:40 PM
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.


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: bensam12345 on April 21, 2015, 05:18:38 PM
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?


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: odolvlobo on April 21, 2015, 05:20:33 PM
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.


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: bensam12345 on April 21, 2015, 05:22:15 PM
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  :)


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: jonald_fyookball on April 21, 2015, 11:50:57 PM
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. 


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: H.W.Z on April 22, 2015, 02:36:30 AM
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.


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: freeyourmind on April 22, 2015, 03:48:00 AM
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?


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: BitBlitz on April 22, 2015, 03:55:44 AM
Bitcoin miners are working on a very complicated mathematical puzzle that seeks the answer to: "What do we do with this extra electricity?"


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: mkc on April 22, 2015, 03:59:36 AM
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?


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: odolvlobo on April 22, 2015, 07:19:47 AM
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.


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: Jakesy on April 22, 2015, 12:26:51 PM
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):
http://www.extremetech.com/wp-content/uploads/2014/03/500px-Cryptographic_Hash_Function.svg_.png

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.


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: Snail2 on April 22, 2015, 12:32:24 PM
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 :).


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: ensurance982 on April 22, 2015, 02:02:16 PM
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.


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: freeyourmind on April 22, 2015, 09:59:19 PM
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 :)

So when you write SHA256(H, N), is that a function of the two variables, H and N?


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: bensam12345 on April 22, 2015, 10:04:37 PM
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

http://img1.wikia.nocookie.net/__cb20140909012954/degrassi/images/c/c5/Ashton-kutcher-laughing-top-10-vine-videos.gif


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: DannyHamilton on April 23, 2015, 01:18:14 AM
- 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.



Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: TheGr33k on April 23, 2015, 02:34:07 AM
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?


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: freeyourmind on April 24, 2015, 02:17:35 PM
- 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 :)


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: BillyBobZorton on April 24, 2015, 02:28:44 PM
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.


Title: Re: Bitcoin mining solving equations, what it actually is?
Post by: manselr on April 24, 2015, 03:37:52 PM
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.