Bitcoin Forum
November 11, 2024, 07:16:54 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: When you start working on a block, why others won't do same thing?  (Read 3734 times)
PRCman (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
May 26, 2011, 01:31:47 PM
 #1

if after you start working on it, others won't be able to work on it, how long can you do that?

If you machine need 10 years to finish that, that means, the block belongs to you for 10 years (others can't working on that?)
SomeoneWeird
Hero Member
*****
Offline Offline

Activity: 700
Merit: 500


View Profile
May 26, 2011, 01:57:21 PM
 #2

No, everyone is working on the same block at the same time, it's just the first person to finish it gets the 50 coins, (if it's a pool, then it gets split up).

AFAIK anyway.
Garrett Burgwardt
Sr. Member
****
Offline Offline

Activity: 406
Merit: 256


View Profile
May 26, 2011, 02:05:31 PM
 #3

No, everyone is working on the same block at the same time, it's just the first person to finish it gets the 50 coins, (if it's a pool, then it gets split up).

AFAIK anyway.

There's no progress toward a block, so 'finishing' is a bad word to use.

PRCman (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
May 26, 2011, 02:07:45 PM
 #4

No, everyone is working on the same block at the same time, it's just the first person to finish it gets the 50 coins, (if it's a pool, then it gets split up).

AFAIK anyway.

There's no progress toward a block, so 'finishing' is a bad word to use.




I don't understand
Dobrodav
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250



View Profile
May 26, 2011, 02:37:19 PM
 #5

Wining in the lottery. Not a job done.
In other worlds, in theory - you can solve the block from first attempt.

nathanrees19
Full Member
***
Offline Offline

Activity: 196
Merit: 100



View Profile
May 26, 2011, 02:58:56 PM
 #6

No, everyone is working on the same block at the same time

Well, everyone is working on the same numbered block, but each person is trying to make a block that pays BTC to them (or their pool).

I don't understand

It's like rolling a giant die with billions of sides (numbered 1 to billions), and trying to get it to land on 42. The chance is the same each roll.
compro01
Hero Member
*****
Offline Offline

Activity: 590
Merit: 500



View Profile
May 26, 2011, 05:10:07 PM
 #7

nonce=0
while (block_hash>target)
{
block_hash=hash(hash(transactions), previous_block_hash, nonce, (other stuff not relevant to this discussion))
increment nonce
}

basically, this is what every miner is doing, over and over, millions/billions of times per second.  we're not coordinating on this, we're just running this over and over looking for a block with a hash lower than the target.  we only talk to others if we find a block hash that meets that criteria or someone tells us that one was found.

due to the way a hash function works (a property called the avalanche effect.  google it if interested), every time the nonce gets changed, the hash output changes dramatically to effectively a random number.
SomeoneWeird
Hero Member
*****
Offline Offline

Activity: 700
Merit: 500


View Profile
May 26, 2011, 09:40:51 PM
 #8

due to the way a hash function works (a property called the avalanche effect.  google it if interested), every time the nonce gets changed, the hash output changes dramatically to effectively a random number.

Not so different to MD5 if anyone else is wondering.
compro01
Hero Member
*****
Offline Offline

Activity: 590
Merit: 500



View Profile
May 26, 2011, 11:52:16 PM
 #9

due to the way a hash function works (a property called the avalanche effect.  google it if interested), every time the nonce gets changed, the hash output changes dramatically to effectively a random number.

Not so different to MD5 if anyone else is wondering.

exactly like MD5.  MD5 is a hash function and a popular one.  it's not suitable for security use anymore (collisions can be found), though it's just fine for corruption detection.

We just use SHA-256 instead, which is far stronger and should remain so for the foreseeable future.
frozen
Full Member
***
Offline Offline

Activity: 196
Merit: 100



View Profile
May 27, 2011, 12:20:06 AM
 #10

I think this might be a fair analogy:

1) In your hand you have 10 quarters
2) Toss the quarters into the air
3) Are all 10 of them heads up? If no, try again. If yes, collect 50BTC.

After doing this procedure 10 times, you aren't any "closer" than you are if you do it 100 times. So there's no progress towards it. All that can be done is doing the flips as many times as possible in the shortest amount of time.

The difference is that instead of 10 quarters, you're working with millions, maybe billions of quarters. And you don't need them all to come up heads, only a set number of them (i.e. the difficulty).

SomeoneWeird
Hero Member
*****
Offline Offline

Activity: 700
Merit: 500


View Profile
May 27, 2011, 02:02:09 AM
 #11

due to the way a hash function works (a property called the avalanche effect.  google it if interested), every time the nonce gets changed, the hash output changes dramatically to effectively a random number.

Not so different to MD5 if anyone else is wondering.

exactly like MD5.  MD5 is a hash function and a popular one.  it's not suitable for security use anymore (collisions can be found), though it's just fine for corruption detection.

We just use SHA-256 instead, which is far stronger and should remain so for the foreseeable future.

Yeah, I was just saying that MD5 uses the  avalanche effect aswell.
PcChip
Sr. Member
****
Offline Offline

Activity: 418
Merit: 250


View Profile
May 27, 2011, 02:14:41 AM
 #12

So when one person in China finds block number 700000,  how is the p2p lag between china and america dealt with such that someone in Texas stops working on that 700000'th block and moves on to the next one in the series?

Or does it even matter?

If it doesn't matter, and only based on local difficulty in the p2p network, then are there situations where there are pockets of lower difficulty in the p2p network where some people can still mine for coins easier than someone on the other side of the world?

Legacy signature from 2011: 
All rates with Phoenix 1.50 / PhatK
5850 - 400 MH/s  |  5850 - 355 MH/s | 5830 - 310 MH/s  |  GTX570 - 115 MH/s | 5770 - 210 MH/s | 5770 - 200 MH/s
SomeoneWeird
Hero Member
*****
Offline Offline

Activity: 700
Merit: 500


View Profile
May 27, 2011, 02:16:29 AM
 #13

So when one person in China finds block number 700000,  how is the p2p lag between china and america dealt with such that someone in Texas stops working on that 700000'th block and moves on to the next one in the series?

Or does it even matter?

If it doesn't matter, and only based on local difficulty in the p2p network, then are there situations where there are pockets of lower difficulty in the p2p network where some people can still mine for coins easier than someone on the other side of the world?

The first person the network successfully confirms as completing the block, gets the 50 coins.

So if china finishes a block 2 minutes before the USA, but there is 5 minutes lag time between the network, the USA will get the 50 coins (or the person who finished the block).
anisoptera
Member
**
Offline Offline

Activity: 308
Merit: 10



View Profile
May 27, 2011, 02:29:14 AM
 #14

So when one person in China finds block number 700000,  how is the p2p lag between china and america dealt with such that someone in Texas stops working on that 700000'th block and moves on to the next one in the series?

Or does it even matter?

If it doesn't matter, and only based on local difficulty in the p2p network, then are there situations where there are pockets of lower difficulty in the p2p network where some people can still mine for coins easier than someone on the other side of the world?

If they don't find a block by the time they hear about China's block, they eventually stop working on it because they know it's not the longest chain.

If they do find a block before then, they publish theirs, but only the people who haven't already received the other block start working on a block on top of that one (the others have already started working on China's block).

Whoever finds a block first publishes it, and whichever block was "underneath" that one wins the previous contest. If the same thing happens again, then it continues to a third "round", until finally one of the chains is definitively the longest. This will happen even in high-latency networks because once one "side" gets much more than half of the network behind it, the split will even itself out.

In general, honest nodes will have included all transactions in those blocks anyway - just a different address gets the generation fee.

melter
Member
**
Offline Offline

Activity: 84
Merit: 10

The Premier Digital Asset Management Ecosystem


View Profile
May 27, 2011, 02:34:54 AM
 #15

wait, so If I have 2 cards in my computer, working as 2 separate workers, are they basically competing against each other? That is, are they doing the exact calculations at the exact same time, or will they be doing different/random calculations in an attempt to find the block?

kjj
Legendary
*
Offline Offline

Activity: 1302
Merit: 1026



View Profile
May 27, 2011, 02:38:36 AM
 #16

The longest chain wins.

If two different blocks are broadcast from opposite sides of the network in less than the propagation delay, some nodes will have one block, and the rest will have the other.  At this point, neither block is more or less valid than the other.  We'll call the last agreed block "A", and the new ones "B" and "X".

Code: (view from X side of network)
 -> A -> X (main)
       \
         \-> B (side)

Nodes will start working on the next block to follow the one they have.  It is this next block that decides which branch will be the main branch.  The successor to block B will be block C, and the successor to X will be Y.

If block C is found before block Y, the nodes that had previously considered block X to be correct will roll their copy of the chain back to the branch point, and promote the side chain to the main chain, including the new block C.  When this happens, all transactions that were in block X, but not blocks B or C, will be put back into the pool to get processed next.

Code: (view from X side of network, after block C is accepted)
 -> A -> X (side)
       \
         \-> B -> C (main)

This is rare.  Even more rare is for the situation to go onto a second or third round.  The split will not be even, and will get even more lopsided as the rounds progress.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
Ian Maxwell
Full Member
***
Offline Offline

Activity: 140
Merit: 101



View Profile WWW
May 27, 2011, 02:48:39 AM
 #17

wait, so If I have 2 cards in my computer, working as 2 separate workers, are they basically competing against each other? That is, are they doing the exact calculations at the exact same time, or will they be doing different/random calculations in an attempt to find the block?
There's no competition in the sense you're thinking. Within one difficulty period, your mining will result in the same number of bitcoins regardless of whether there are 1 or 10,000,000 other miners on the network.

Mining is competitive only because the network periodically adjusts itself by increasing the difficulty of the hashing work to be done, based on how quickly it has been done in the past. The more miners there are, the faster the work will get done. The faster the work gets done, the harder it will become in the future.

Ian Maxwell
PGP key | WoT rating
PRCman (OP)
Newbie
*
Offline Offline

Activity: 42
Merit: 0


View Profile
May 27, 2011, 05:22:24 AM
 #18

wait, so If I have 2 cards in my computer, working as 2 separate workers, are they basically competing against each other? That is, are they doing the exact calculations at the exact same time, or will they be doing different/random calculations in an attempt to find the block?
There's no competition in the sense you're thinking. Within one difficulty period, your mining will result in the same number of bitcoins regardless of whether there are 1 or 10,000,000 other miners on the network.

Mining is competitive only because the network periodically adjusts itself by increasing the difficulty of the hashing work to be done, based on how quickly it has been done in the past. The more miners there are, the faster the work will get done. The faster the work gets done, the harder it will become in the future.

I don't understand, why in computing period, there is no compation, won't 2 miners caculate several same has values while they are mining?


PcChip
Sr. Member
****
Offline Offline

Activity: 418
Merit: 250


View Profile
May 27, 2011, 05:46:59 AM
 #19

kjj, I have two questions about the situation you're describing:

1.) So if two blocks are found at the same time, on opposite sides of the world, you're saying eventually when it all settles down, one person is going to lose their 50btc?

       (also what do you mean by "will be put back into the pool?" )


2.) I completely understand why with the current extreme difficulty this rarely happens, however back when the difficulty was much easier, and GPU miners had just came out so people were hitting jackpots all the time, would you say this happened much more often back then?

Legacy signature from 2011: 
All rates with Phoenix 1.50 / PhatK
5850 - 400 MH/s  |  5850 - 355 MH/s | 5830 - 310 MH/s  |  GTX570 - 115 MH/s | 5770 - 210 MH/s | 5770 - 200 MH/s
Ian Maxwell
Full Member
***
Offline Offline

Activity: 140
Merit: 101



View Profile WWW
May 27, 2011, 06:57:15 AM
 #20

I don't understand, why in computing period, there is no compation, won't 2 miners caculate several same has values while they are mining?

You misunderstand because you think there is some sort of extended work involved in finding a valid hash. There isn't. Each hash attempt takes something like 2-3 billionths of a second, and either succeeds or fails immediately.

As others said, it's like rolling a die over and over again until you get a 1. Only instead of the die having six sides it has 1.8 trillion. A difficulty increase is like adding more sides to the die. If you can roll the die faster you can get 1 more often, but other players/miners don't help or hinder you in this.

Ian Maxwell
PGP key | WoT rating
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!