Bitcoin Forum
June 22, 2024, 07:52:48 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Choosing the most difficult block chain when a client signs in. How?  (Read 713 times)
thebookofsouls (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
September 05, 2015, 03:37:24 PM
Last edit: September 05, 2015, 03:59:42 PM by thebookofsouls
 #1

In this answer: http://bitcoin.stackexchange.com/a/760/28219

It is said:

Quote
Because of all this work, when a Bitcoin client signs on to the network it can trust the block chain that was most difficult to produce (since this is evidently the one that was being worked on by the most miners).

Unfortunately there is nothing evident for me there  Cool

Can someone explain how can a block chain be more difficult to solve than another one?
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
September 05, 2015, 03:42:08 PM
 #2

The hash of the block must be less than the target (typically represented as having more leading 0's but that is technically incorrect). The block hash is a 256 bit number in hexadecimal form and so is the target. In order to be more difficult, the hash must be less than that target. As the difficulty increases, the target decreases, thus restricting the range of acceptable hashes. As the range decreases, it becomes more difficult to find a hash that matches the criteria.

This should help as well: https://en.bitcoin.it/wiki/Difficulty

thebookofsouls (OP)
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
September 05, 2015, 03:54:36 PM
 #3

The hash of the block must be less than the target (typically represented as having more leading 0's but that is technically incorrect). The block hash is a 256 bit number in hexadecimal form and so is the target. In order to be more difficult, the hash must be less than that target. As the difficulty increases, the target decreases, thus restricting the range of acceptable hashes. As the range decreases, it becomes more difficult to find a hash that matches the criteria.

This should help as well: https://en.bitcoin.it/wiki/Difficulty

I did not ask about difficulty. I asked about block comparison when there is a branch, in other words, when there are two possible block chains.

EDIT: This guy attempted to answer, but not very well.

Quote
Block difficulty is determined only by the sum speed of miners working on that chain particular chain, kept track of by evaluating the the spacing of the timestamps of blocks in a 2 week period. It's worthwhile to think about the block chain as a tree that just happens to have a very strong main branch, where branches are weighed by how much work went into creating them rather than their length.

                                                     
Quote
           +---> 9 +---> 9 
9 +----> 9 |  
           +---> 1 +---> 1 +---> 1 +---> 1 +---> 1 
            
Here we have two competing tips of the chain, one with a cumulative difficulty of 36 (9+9+9+9, and one with a cumulative difficulty of 25 (9+9+1+1+1+1+1). Although the top section of the fork has less blocks, it has a higher difficulty than the bottom fork and so is regarded as the current "best" side of the chain.

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3430
Merit: 6720


Just writing some code


View Profile WWW
September 05, 2015, 03:59:19 PM
 #4

The hash of the block must be less than the target (typically represented as having more leading 0's but that is technically incorrect). The block hash is a 256 bit number in hexadecimal form and so is the target. In order to be more difficult, the hash must be less than that target. As the difficulty increases, the target decreases, thus restricting the range of acceptable hashes. As the range decreases, it becomes more difficult to find a hash that matches the criteria.

This should help as well: https://en.bitcoin.it/wiki/Difficulty

I did not ask about difficulty. I asked about block comparison when there is a branch, in other words, when there are two possible block chains.


That is related to difficulty. If the difficulty for a block is higher than another block, it is more difficult. The difficulty is encoded into blocks as the "bits" field.

The longest blockchain is the blockchain with the highest combined difficulty. I think it is just the sum of all of the difficulties of all of the blocks.

Pages: [1]
  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!