Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: eideteker on March 23, 2011, 03:24:23 PM



Title: Simple question - what is the root of the "math" that we are doing?
Post by: eideteker on March 23, 2011, 03:24:23 PM
I've only been mining a couple weeks now, but with two GPUs and two CPU threads going I've amassed some coinage.  I posted on a popular forum's distributed computing section what everyone thought of bitcoin and I've received some troubling replies.  The one that gets me the most (and the one that I can't seem to find an answer to) is this: just what is all this hashing for?  Is it really merely to find the next block, are we unknowingly cracking for some devious entity?  It would appear that they will not accept the former as an answer, even though they all run F@H and WCG clients and can't truly trace the math they are doing either.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: gohan on March 23, 2011, 03:35:35 PM
It's just plain silly to make such claims when every bit of specification and all the code is open. What miners do is so basic that anyone with a bit of programming knowledge can have at least a coarse idea of the task being done by looking at the code. So I wouldn't trouble myself over it. :D

From https://en.bitcoin.it/wiki/Blocks :

Each block contains all recent transactions, a nonce (random number), and the hash of the previous block. A block is "solved" (published and considered valid by peers) when the SHA-256 hash of the entire block is below the current target. This is very unlikely to occur after being hashed only once, so the nonce must be incremented and the block re-hashed millions of times until it does.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: Garrett Burgwardt on March 23, 2011, 03:36:17 PM
You're running SHA-256 (http://en.wikipedia.org/wiki/Sha256) calculations, trying to find a hash that is below a certain target number (correct me if I'm wrong on the hash part, I'm not 100% on whether we hash numbers or find the number to match the hash).

So in effect you're making rainbow tables, which is encoded in the blockchain. It's an inefficient and unoptimized table though, so it doesn't really matter.

No shady stuff here :)

This is all determinable by looking at the source code, btw. You don't need to believe me.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: barbarousrelic on March 23, 2011, 03:41:15 PM
I'm a little confused - for one set of data and one method of hashing, isn't there only one possible hash? What does it mean then to try to find a hash below a certain value?  From what I understand about hashes, either it is or it isn't below that value, and no amount of retrying can change that.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: wb3 on March 23, 2011, 03:42:36 PM
Still,

He makes a point. It would be a shame to to have all that hashing go to waste. I would like to look for collisions or at least report the collisions.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: Garrett Burgwardt on March 23, 2011, 03:45:46 PM
I'm a little confused - for one set of data and one form of hashing, isn't there only one possible hash? What does it mean then to try to find a hash below a certain value? Either it is or it isn't below that value, from what I understand about hashes.

You're right - but most hashes are above the target, as in, for function hash(x) on [a,b], the function will be mostly >target (for higher difficulties, anyway).

That's why we have to do so much hashing to find a block. I'm personally running about 900 million hashes per second, and I rarely find a block.

So in short, you're right, that's why we have to hash so many numbers.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: wb3 on March 23, 2011, 03:47:51 PM
I'm a little confused - for one set of data and one form of hashing, isn't there only one possible hash? What does it mean then to try to find a hash below a certain value? Either it is or it isn't below that value, from what I understand about hashes.

Yes but because a little change in the input can cause a big change in the output.

For example:

Hash of "1" might be 393rnfn8448rhir83ru923ur093

Hash of "2" might be y5jnj5gj438483483948hgjg348

What there looking for by increasing difficulty in a solution is out of all the people solving hashes is when someone finds a hash of say:

00000000483th48ghjvn4uf9fuh4u49

The odds of finding a hash with 7 zeros can be calculated, but finding them takes time.

Just examples;


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: ffe on March 23, 2011, 03:51:40 PM
I'm a little confused - for one set of data and one method of hashing, isn't there only one possible hash? What does it mean then to try to find a hash below a certain value?  From what I understand about hashes, either it is or it isn't below that value, and no amount of retrying can change that.

Yes. Only one possible hash. In fact very probably a useless hash because it is larger than the target difficulty. That's why the block has a random number that you can change. It's called the nonce. If a hash fails to be below the difficulty threshold, you increment the nonce and try again. You get a different hash and a new shot at having the hash below the difficulty.

You'll probably fail again and have to increment the nonce again. Guess what. You're mining! After billions of tries you run across a nonce that makes the block hash to a value less than the difficulty and you've made yourself 50 bitcoins.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: barbarousrelic on March 23, 2011, 03:54:26 PM
I'm a little confused - for one set of data and one method of hashing, isn't there only one possible hash? What does it mean then to try to find a hash below a certain value?  From what I understand about hashes, either it is or it isn't below that value, and no amount of retrying can change that.

Yes. Only one possible hash. In fact very probably a useless hash because it is larger than the target difficulty. That's why the block has a random number that you can change. It's called the nonce. If a hash fails to be below the difficulty threshold, you increment the nonce and try again. You get a different hash and a new shot at having the hash below the difficulty.

You'll probably fail again and have to increment the nonce again. Guess what. You're mining! After billions of tries you run across a nonce that makes the block hash to a value less than the difficulty and you've made yourself 50 bitcoins.


Ahh, I understand now.

so it calculates hash(lastblock+random_num) and checks to see if it is less than the difficulty. If it's above, it changes the random number and tries again.

Does it increment the nonce by 1 each time, or does it pick a completely random nonce each time?


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: eideteker on March 23, 2011, 03:55:43 PM
What miners do is so basic that anyone with a bit of programming knowledge can have at least a coarse idea of the task being done by looking at the code.

This is the main problem - they don't have any programming knowledge (caveat: neither do I), and they are also rather closed minded.

Quote from: TheKid
This is all determinable by looking at the source code, btw. You don't need to believe me.

That's nice and all, and I do accept that since it is open source there is no hidden agenda, but trying to get these people on board is mind-numbing.  One poster likened bitcoin to money-laundering by selling IEDs.  ::)


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: theymos on March 23, 2011, 04:24:44 PM
Does it increment the nonce by 1 each time, or does it pick a completely random nonce each time?

It increments, but there's other unique data in the block that ensures you're not re-doing work that's already been done.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: Jered Kenna (TradeHill) on March 23, 2011, 05:03:48 PM

 One poster likened bitcoin to money-laundering by selling IEDs.  ::)

Wow that's funny as hell but about the harshest comparison I could think of.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: gohan on March 23, 2011, 06:08:23 PM
This is the main problem - they don't have any programming knowledge (caveat: neither do I), and they are also rather closed minded.
Well, you don't have to know anything, that's the point. It being an open technology ensures that people who know can and do audit it. It is not an obscure piece of program we're talking about, Bitcoin community includes tens, maybe hundreds of programmers from various parts of the world. You don't also need know these facts about Bitcoin, since all open projects function this way.

It's very hard to deal with close minded people. I once met an IT manager at a bank who told me they didn't use opensource, because, it being open meant it wasn't secure enough. Well, first of all, your whole banking system runs on opensource you fucking idiot, your bank only uses Windows to give access to your dumb employees. *rumble rumble rumble*


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: wb3 on March 23, 2011, 06:20:49 PM
This is the main problem - they don't have any programming knowledge (caveat: neither do I), and they are also rather closed minded.
Well, you don't have to know anything, that's the point. It being an open technology ensures that people who know can and do audit it. It is not an obscure piece of program we're talking about, Bitcoin community includes tens, maybe hundreds of programmers from various parts of the world. You don't also need know these facts about Bitcoin, since all open projects function this way.

It's very hard to deal with close minded people. I once met an IT manager at a bank who told me they didn't use opensource, because, it being open meant it wasn't secure enough. Well, first of all, your whole banking system runs on opensource you fucking idiot, your bank only uses Windows to give access to your dumb employees. *rumble rumble rumble*


Yea,

Companies are smart enough to know not to trust third party proprietary software (something might be hidden in there). They will trust their own software with hidden things, just not others.

OpenSource for the most part is probably the safest software, although be mindful of the amount of people working with it. OpenSource with just 3 people supporting it, will not necessarily be safe for the novice. You must look at the code before you use it.

BitCoin will probably, if successful, be the most safest form of software because so many people want to find a flaw or exploit to get rich quick.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: compro01 on March 23, 2011, 10:45:26 PM
so it calculates hash(lastblock+random_num) and checks to see if it is less than the difficulty. If it's above, it changes the random number and tries again.

pretty much.

actually, it's hash(hash(last_block)+hash(transactions)+current_time+current_target+random_num) and it checks whether it is less than the current target.

the wiki has a small explanation here (https://en.bitcoin.it/wiki/Block_hashing_algorithm).


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: 0x6763 on March 24, 2011, 07:29:19 PM
This is the main problem - they don't have any programming knowledge (caveat: neither do I), and they are also rather closed minded.

The closed-minded ones will be left behind economically.  Maybe one day they will notice and realize they made a very expensive mistake.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: Jered Kenna (TradeHill) on March 24, 2011, 07:32:58 PM
One thing that kind of scares me is the whole "someone else called 911" effect.
There's probably a better name for it than what I'm calling it.
Basically you see a wreck with people hurt and you don't call because you assume someone else did, the problem is everyone else assumes the same and no one calls.

You could have this problem with open source especially when less people understand the code than people that have cell phones.
Obviously the more popular the software is the more likely it's analyzed carefully but it also means the average person is less worried to look for themselves.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: eMansipater on March 24, 2011, 08:18:04 PM
One thing that kind of scares me is the whole "someone else called 911" effect.
There's probably a better name for it than what I'm calling it.
Basically you see a wreck with people hurt and you don't call because you assume someone else did, the problem is everyone else assumes the same and no one calls.

You could have this problem with open source especially when less people understand the code than people that have cell phones.
Obviously the more popular the software is the more likely it's analyzed carefully but it also means the average person is less worried to look for themselves.
The bystander effect (http://en.wikipedia.org/wiki/Bystander_effect) is the one you're looking for.


Title: Re: Simple question - what is the root of the "math" that we are doing?
Post by: Jered Kenna (TradeHill) on March 24, 2011, 10:01:33 PM
One thing that kind of scares me is the whole "someone else called 911" effect.
There's probably a better name for it than what I'm calling it.
Basically you see a wreck with people hurt and you don't call because you assume someone else did, the problem is everyone else assumes the same and no one calls.

You could have this problem with open source especially when less people understand the code than people that have cell phones.
Obviously the more popular the software is the more likely it's analyzed carefully but it also means the average person is less worried to look for themselves.
The bystander effect (http://en.wikipedia.org/wiki/Bystander_effect) is the one you're looking for.

Thanks  ;)

Learned a couple new rules / effects on here so far, probably pick up more later on.
Pretty intelligent board.