Pages:
Author

Topic: When a block is solved, is everyone else's work wasted? - page 2. (Read 987 times)

newbie
Activity: 19
Merit: 0
That clears things up for me I think.  I had thought you could just change the nonce until you eventually found the right hash (that's what I meant by checking the same block over and over - changing the nonce and nothing else).  I didn't realize you could go all the way through every possible nonce value and still not find a good hash.  Thanks!

Anybody have an answer to my last question on double hashing?

Hello
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 (first round on sha-256)
d7914fe546b684688bb95f4f888a92dfc680603a75f23eb823658031fff766d9 (2nd round of sha-256, from hashing the above value)

However the wiki page above says the 2nd round should yield this value:
9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50

What am I doing wrong?
legendary
Activity: 3472
Merit: 4794
If you re-hash the exact same block, you will get the exact same hash.  That is useless.

To get a different hash result you HAVE to change the data you are hashing.  Generally this is done by modifying a piece of data in the block header called a nonce.  Incrementing the nonce results in a slightly different block header which then results in a completely different hash.

Miners are so fast now (and difficulty is so high), that they typically try every possible nonce without finding a valid solution.  Then the miner HAS TO modify the transactions and rebuild the block so they can try again.

So miners (or pools) already have to rebuild the entore block MANY times before a solution is even found.

There is no "making progress" towards a solution.  Every attempt has as good of a chance of being the right solution as every other attempt.  Think of it like rolling dice.  If 2 people each roll a die until one of them rolls a 1, are all the previous rolls "wasted"?  Has anyone's chances of rolling a 1 gotten better (or worse) just because a 1 has (or hasn't) been rolled yet?
newbie
Activity: 19
Merit: 0
So in response to your answer to my question #1. Do you create an entirely new block every time you attempt to find a new, valid hash for it?  Again, that seems like a waste. If you try one hash and it doesn't work, you move on to the next because you know the old one doesn't work. So your odds improve every time - unless you change your block every time. Then it's just playing the lottery over and over again. Or maybe I'm falling for the gambler's fallacy?

So I'm seeing 2 scenarios.  Scenario 1, Slush tries to figure out the same block over and over again until BTCGuild finds the solution to a block.  Then Slush needs to grab a new set of unconfirmed transactions, update the previous block hash to the one that BTCGuild just solved, and then start over again, trying the hash over and over again.  For scenario 2, Slush forms a block, tries a hash solution, then forms a new block, tries a hash solution, etc. until he wins the lottery.  Which is it?  I just can't help but see wasted effort every time Slush has to form a new block without solving the old one.
rme
hero member
Activity: 756
Merit: 504
I have several questions, but the topic is my biggest:

1) When a block is solved, does everyone else have to start over, create a new block, and begin looking for the right hash again?  For example, Slush's pool, ASICminer, and BTCGuild are all mining.  Slush solves a block, so ASICminer and BTCGuild both forget their current block, make a new one, and start over again.  Is that right? Seems a waste that way, and actually better to have 2-3 big pools rather than 30 or more smaller ones.
Blocks are created thousands of time in a second, but they do not have the right hash to be valid blocks (so you have to try again).
Any block contains last block hash so if a new block is found you have to change your blocks (the ones you are generating), that does not interrupt you because you still have the same probabilities.



2) How are the transactions chosen to be put in a block? Do you just basically grab whatever transactions are floating out there that are not in a block, put them together, and start trying to find the right hash solution?
There is a list of unconfirmed tx in every Bitcoin client (you can see it on http://blockchain.info/unconfirmed-transactions).
If you are mining you include all the tx that can fit into a block (up to 1MB right now). You want to profit so you include the ones that have higher fees.


3) If you can just put any transactions you want in a block, what is the incentive to include any transaction that does not include a fee?
You can decide, if you have space left in a block (up to 1MB) you can include no-fee transactions, but if a block can only have 500tx (example, not real data) and you have 500tx with fee and 100 without you will only include the ones that have. (Its up to the miner but they all want money).

Thanks!  I've done some searching of the forums, wiki, etc. and haven't found those answers on my own.

Answered in bold
newbie
Activity: 19
Merit: 0
I have several questions, but the topic is my biggest:

1) When a block is solved, does everyone else have to start over, create a new block, and begin looking for the right hash again?  For example, Slush's pool, ASICminer, and BTCGuild are all mining.  Slush solves a block, so ASICminer and BTCGuild both forget their current block, make a new one, and start over again.  Is that right? Seems a waste that way, and actually better to have 2-3 big pools rather than 30 or more smaller ones.

2) How are the transactions chosen to be put in a block? Do you just basically grab whatever transactions are floating out there that are not in a block, put them together, and start trying to find the right hash solution?

3) If you can just put any transactions you want in a block, what is the incentive to include any transaction that does not include a fee?

4) Double SHA-256 hash for hello here https://en.bitcoin.it/wiki/Protocol_specification I can't repeat.  The first round I get the same, but the 2nd round I get d7914fe546b684688bb95f4f888a92dfc680603a75f23eb823658031fff766d9 instead.  What am I doing wrong?

Thanks!  I've done some searching of the forums, wiki, etc. and haven't found those answers on my own.
Pages:
Jump to: