4 ms·
Yes, but the number of possible "solutions" (valid or invalid) is so large that it's extremely unlikely that 2 people are getting the same invalid solutions (as
by Klathmon 9y ago
Yes, but the number of possible "solutions" (valid or invalid) is so large that it's extremely unlikely that 2 people are getting the same invalid solutions (assuming the software is working correctly). so you don't need any coordination.
And "extremely unlikely" doesn't quite get across the magnitude here. We are talking about the likelihood of 2 people generating the same SHA256 hash of what is basically an absurdly large random number.
Trying to mine a block is basically just generating an SHA256 hash of (the previous block + a nonce) that has a given number of 0's on the front of it. (this is crazy oversimplified) The nubmer of zeros is basically the difficulty.
So everyone starts off trying to generate a SHA256 hash of "ABCD" and a random number, that has at least 4 zeros on the front. So a mining pool is setup that says anyone that generates a SHA256 hash of the same thing with 1 or more zeros on the front gets a "share", and when anyone generates an SHA256 hash with 4 or more zeros on the front, the pool submits that share, then gives the profits to everyone that was able to generate "shares" based on how many they generated.
- wallacoloo 9y agoDifficulty can't actually correspond to the number of leading zeros required in the hash, can it? Then there would only be 256 levels of difficulty, and the average block time would have to double whenever difficulty increases. Yet I see this "leading zeros" explanation everywhere. So maybe it is the case, but if so, why was this way chosen rather than just requiring that the hash be less than some value, with that value being a function of difficulty? That would give you more granularity at very little additional complexity.
- Klathmon 9y agoThe "number of leading 0's" is just a gross oversimplification of the actual difficulty mechanism. It's a lot easier to explain, and it's somewhat correct (it's easy to look at the hash for a block and see that it has a bunch of zeros at the front) The reality is closer to what you say at the end there, it is calculated so that the resulting hash must be under a given value, and is pretty damn granular. Sadly many people trip over the idea of one hash being "less" than another, and it's just easier to go with the "number of zeros" explanation rather than spend time explaining how a hash just represents a bigass number. For example, the current difficulty as of this comment is 1873105475221.611
- wallacoloo 9y ago> many people trip over the idea of one hash being "less" than another, and it's just easier to go with the "number of zeros" explanation rather than spend time explaining how a hash just represents a bigass number. Aha! I knew there was a reason people prefer the leading zeros explanation. Thanks for pointing it out.