Bitcoin Forum
May 07, 2024, 10:24:41 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Randomness of hash and a few other Q  (Read 913 times)
NeoCortX (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0



View Profile WWW
December 19, 2012, 08:50:18 PM
 #1

I read something like the following, and I'm wondering if it's correct:

When mining, the hash is not known beforehand, but some kind of product is known. I think the product is the number of 0's before the rest of the hash string. So for example this hash:
http://blockchain.info/block/000000000000039ce32a9b18b1c676f14658ee02ae15dd5791f8604ae2d31968
will only be valid when it has 13 0's before the rest of the string.
This means that except from all the 0's in the beginning, there is no known method for predicting the content of the rest of the string before it's been generated.

Thanks for any feedback.

By the way, what is the function of the Merkle Root?

And another: It seems that going from 13 to 14 0's in the beginning of the hash is a quite large adjustment; about 8%. How can the network adjust difficulty just a few percent up and down?

Thanks again.
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715120681
Hero Member
*
Offline Offline

Posts: 1715120681

View Profile Personal Message (Offline)

Ignore
1715120681
Reply with quote  #2

1715120681
Report to moderator
grau
Hero Member
*****
Offline Offline

Activity: 836
Merit: 1021


bits of proof


View Profile WWW
December 19, 2012, 08:55:17 PM
 #2

It is not the number of 0 that is set as target but a number that the result must be less than. This allows lower granularity of adjustment.

The merkle root is simplified a checksum of the block content that is included into the data the hash has to be found upon, therefore it serves as a proxy for the block content. it has other neat properties too, but this should answer your question.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
December 19, 2012, 09:16:28 PM
 #3

As grau pointed out it isn't the number of zeros that matter but the exact target.

For any difficulty the target value can be computed.  They have an inverse relationship.  As difficulty rises the target gets smaller (lower %of hashes will be below the target hence it is "harder" to find a valid hash).

Right now.

The current difficulty is 3370181.7992778
The current target is 00000000000004FA620000000000000000000000000000000000000000000000

So for example a hash beginning with 00000000000005 would be invalid as would a hash beginning with 00000000000004FA63 however a hash beginning with 00000000000003 would be valid despite all three hashes having the same number of zeros.

You example hash is valid because it is smaller than the target
Code:
000000000000039ce32a9b18b1c676f14658ee02ae15dd5791f8604ae2d31968 <- block hash
00000000000004FA620000000000000000000000000000000000000000000000 <- target (for difficulty 3370181.7992778)

The target for difficulty 1 is:
Code:
00000000FFFF0000000000000000000000000000000000000000000000000000

The smallest hash is:
Code:
0000000000000000000000000000000000000000000000000000000000000000

The largest hash is:
Code:
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

Relationship between difficulty, number of hashes to solve a block, and the target.
You will notice in the range of 0000... to FFFF .... roughly 1 in 2^32 hashes will be below the difficulty 1 target.  It requires roughly 2^32 hashes to find one which is valid at difficulty 1.   Current difficulty is 3370181.7992778 the current target is 3,370,181x smaller than the difficulty 1 target.  On average it will require (2^32) * (3370181.7992778) hashes to find one smaller than the current target.


NeoCortX (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 0



View Profile WWW
December 19, 2012, 09:34:48 PM
 #4

Thanks, that's really clear and good answers.
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!