Bitcoin Forum
May 11, 2024, 04:03:23 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Counting Number of 0s to solve the block is still valid.  (Read 124 times)
supermankid (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 12


View Profile
June 18, 2022, 08:05:14 AM
 #1

A while ago, I asked a question related to the possible amount of solutions for the current difficulty limit (19 0s as first part of blocks hash). (in one of the answer) I was told that the current method does not use the method that matches the exact number of zeros but rather "The actual problem is to find a hash (treated as a number) that is less than or equal to the target value."

Now after a bit of rethinking and calculations, I have come to the following conclusion that the following statements are correct.

1) Bitcoin still counts the number of zeros.
2) The problem is to find the has that is less than or equal to target value
3) Statement 1) and 2) are actually the same

1. For example(for simplicity, lets assume the blocks has is just one hex -SHA-1 system.
so. block + block + timestamps + nonce =>hash =>  [0-f]hex => [0000-1111]binary
lets say required 0 is 1 => possible solutions are => (0000,0001,0010,0011,0100,0101,0110,0111)
first zero is fixed and the permutation of the remaining 3 places on binary => 2^3 => 8
So, Bitcoin still counts the number of zeros.

2. Now to calculate this using the number less than method. (still requires 1 zero on the 1st position of hash)
=> required hash must be less than or equal to 0111 so, (0,1,2,3,4,5,6,7) in hex => total solutions => 8

now translate that into modern day situation on 6 June 2022. =>
Blocks solution=> 000000000000000000019a43a23165642477bc987310552d0a2c5fb9e7d288dc

Using Method 1.
Number of required 0s => 19=>  0000000000000000000  
Places that can be changed to match the solution=> 19a43a23165642477bc987310552d0a2c5fb9e7d288dc
In binary places that can be matched => (64-19)*4=> 180
Possible solution => Permutation of 180 binary position => 2^180 => 1.53 × 10^54 (decimal)


Using Method 2.
Number of required 0s => 19=>  0000000000000000000  
The solution should be thus less than or equal to 0000000000000000000ffffffff(64-19fs) => 19 time 0 + 45 times f
The maximum number is the number of (zeros+fffffff...........)
Possible solution => 45 times f => fffffffffffffffffffffffffffffffffffffffffffff_16 => 1.53 × 10^54 (decimal)
(This number or less than this will solve the block)

So, @odolvlobo, I still stand by the statement that it is counting the number of zeros is valid. It is just an another way of looking at it. Both are essentially same methods. Only different way of perceiving the techniques.

[Note: I also understand that second method is implemented in software for calculation but in principle, it is solving the method 1 or method 2 whichever way we look at it. Isn't  that so?]


1715443403
Hero Member
*
Offline Offline

Posts: 1715443403

View Profile Personal Message (Offline)

Ignore
1715443403
Reply with quote  #2

1715443403
Report to moderator
1715443403
Hero Member
*
Offline Offline

Posts: 1715443403

View Profile Personal Message (Offline)

Ignore
1715443403
Reply with quote  #2

1715443403
Report to moderator
1715443403
Hero Member
*
Offline Offline

Posts: 1715443403

View Profile Personal Message (Offline)

Ignore
1715443403
Reply with quote  #2

1715443403
Report to moderator
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.
1715443403
Hero Member
*
Offline Offline

Posts: 1715443403

View Profile Personal Message (Offline)

Ignore
1715443403
Reply with quote  #2

1715443403
Report to moderator
1715443403
Hero Member
*
Offline Offline

Posts: 1715443403

View Profile Personal Message (Offline)

Ignore
1715443403
Reply with quote  #2

1715443403
Report to moderator
1715443403
Hero Member
*
Offline Offline

Posts: 1715443403

View Profile Personal Message (Offline)

Ignore
1715443403
Reply with quote  #2

1715443403
Report to moderator
o_e_l_e_o
In memoriam
Legendary
*
Offline Offline

Activity: 2268
Merit: 18512


View Profile
June 18, 2022, 01:35:35 PM
Last edit: June 19, 2022, 04:54:49 AM by o_e_l_e_o
Merited by pooya87 (2)
 #2

1) Bitcoin still counts the number of zeros.
2) The problem is to find the has that is less than or equal to target value
3) Statement 1) and 2) are actually the same
They are not the same.

Let's say the target is 0100.
I find a block with hash 0101.
My block hash is higher than the target, but has the same number of zeroes.
If you are looking for a number which is less than or equal to that target, my block is invalid.
If you are counting the zeroes, my block is valid.

Using Method 1.
Using Method 2.
Your two methods just perform the same calculation in different ways. Both count the zeroes first and then remove the zeroes from the 64 hex characters, and then use the remaining 45 characters to work out the number of possibilities.
supermankid (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 12


View Profile
June 18, 2022, 05:37:23 PM
 #3

I see. Things are clear now. Thanks.
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!