Bitcoin Forum
May 03, 2024, 06:02:29 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: what is this confusing sentence of mining difficulty.  (Read 135 times)
cafter (OP)
Full Member
***
Offline Offline

Activity: 448
Merit: 222



View Profile WWW
August 20, 2023, 02:17:33 PM
 #1

I am confused in this sentence...
what changes after 14 days? and what is mining difficulty target, tried to read many times but all gone over head Grin
1714716149
Hero Member
*
Offline Offline

Posts: 1714716149

View Profile Personal Message (Offline)

Ignore
1714716149
Reply with quote  #2

1714716149
Report to moderator
1714716149
Hero Member
*
Offline Offline

Posts: 1714716149

View Profile Personal Message (Offline)

Ignore
1714716149
Reply with quote  #2

1714716149
Report to moderator
TalkImg was created especially for hosting images on bitcointalk.org: try it next time you want to post an image
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714716149
Hero Member
*
Offline Offline

Posts: 1714716149

View Profile Personal Message (Offline)

Ignore
1714716149
Reply with quote  #2

1714716149
Report to moderator
1714716149
Hero Member
*
Offline Offline

Posts: 1714716149

View Profile Personal Message (Offline)

Ignore
1714716149
Reply with quote  #2

1714716149
Report to moderator
hosseinimr93
Legendary
*
Offline Offline

Activity: 2394
Merit: 5235



View Profile
August 20, 2023, 03:10:16 PM
Last edit: August 20, 2023, 03:35:05 PM by hosseinimr93
 #2

To mine a block, miners must find a block header which is actually a hexadecimal number. The condition for the block header to be valid is that if it is hashed twice through SHA-256 function, the result must be below a certain number. That certain number is called target.

The smaller the target, the more difficult it's to mine a block. So, the target would increase, if the average block time is more than 10 minutes and it would decrease, if the average block time is less than 10 minutes.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
philipma1957
Legendary
*
Offline Offline

Activity: 4116
Merit: 7827


'The right to privacy matters'


View Profile WWW
August 20, 2023, 03:36:31 PM
 #3

the mining gear spins an invisible code base wheel of fortune. if it spins a number high enough it hits a block.

so with hardly any gear in the world the difficulty number can be low easy to reach.

so pretend difficulty is 10 the machine mining would be slow as fuck since you want the machine to hit a block every 10 minutes.

So the shit all works and a block is being made 1 time every ten minutes on average.

If no one adds more gear the diff never changes.

but now I put two miners on doing the twice the work. blocks are getting made every 5 minutes until the difficulty goes from say 10 to 20.

And since both the gear and and the difficulty doubled the time per block  stays balanced at 10 minutes.

of course the difficulty is now over 50trillion as there are a lot of mining units.

▄▄███████▄▄
▄██████████████▄
▄██████████████████▄
▄████▀▀▀▀███▀▀▀▀█████▄
▄█████████████▄█▀████▄
███████████▄███████████
██████████▄█▀███████████
██████████▀████████████
▀█████▄█▀█████████████▀
▀████▄▄▄▄███▄▄▄▄████▀
▀██████████████████▀
▀███████████████▀
▀▀███████▀▀
.
 MΞTAWIN  THE FIRST WEB3 CASINO   
.
.. PLAY NOW ..
kano
Legendary
*
Offline Offline

Activity: 4480
Merit: 1800


Linux since 1997 RedHat 4


View Profile
August 20, 2023, 10:36:08 PM
 #4

Well, there's also this page I wrote to explain mining, that includes a relevant comment Smiley
https://kano.is/index.php?k=mining

Pool: https://kano.is - low 0.5% fee PPLNS 3 Days - Most reliable Solo with ONLY 0.5% fee   Bitcointalk thread: Forum
Discord support invite at https://kano.is/ Majority developer of the ckpool code - k for kano
The ONLY active original developer of cgminer. Original master git: https://github.com/kanoi/cgminer
ranochigo
Legendary
*
Offline Offline

Activity: 2954
Merit: 4165


View Profile
August 21, 2023, 04:10:56 AM
 #5

Difficulty is a representation of the target, and they are not directly interchangeable.

Think of mining as a game of probability. The more narrow the acceptable range, the harder it gets because your range of acceptable value gets smaller. Hence, you would need more tries to be able to hit a number within that range. If it gets harder and you can only guess at the same speed, your rate of getting the number correct gets lesser. Hence, smaller target = higher difficulty.

Note that the hashes are actually displayed as big endian when you're looking at the block explorers but is in actuality little endian when you're looking in the code. Talking about the number of leading zeros would be correct if you look at blockheaders in hexadecimal and in big endian.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
nc50lc
Legendary
*
Online Online

Activity: 2408
Merit: 5581


Self-proclaimed Genius


View Profile
August 21, 2023, 07:30:17 AM
 #6

I am confused in this sentence...
learnmeabitcoin has a beginner and technical articles regarding 'target' and 'difficulty'.

The explanation in the beginner page should be enough to explain how difficulty works: https://learnmeabitcoin.com/beginners/difficulty
After that, go to the technical part for more information about the target: https://learnmeabitcoin.com/technical/target

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10530



View Profile
August 22, 2023, 05:01:25 AM
Merited by BlackHatCoiner (4)
 #7

Imagine that you are rolling a 6 sided die to get numbers between 1 and 6, you can set a condition to only accept numbers that are smaller than or equal to 5. So the number 5 becomes your "target". Now each of your rolls have a high chance of giving you a valid number (1, 2, 3, 4, 5). To make this harder you decrease this target to something like 3. Now each of your rolls have a lower chance of giving you a valid number (1, 2, 3) so you need to roll more times to get what you need.

In bitcoin mining instead of "rolling the die" we compute a hash which is also random and instead of a small range of numbers like the die example, it gives us a big number in a much bigger range between 0 and 2256.
Our "target" is similarly a big number between 0 and 2256; to make mining harder (ie. increase difficulty) it goes down (towards zero) and to make mining easier (ie. decrease difficulty) it goes higher (towards 2256).

We readjust this target every 2016 blocks in a way that it takes 2 weeks to mine them. Meaning if it took less than 2 weeks to mine the previous 2016 blocks we increase the difficulty and if it had taken more we decrease it.
The target value is deterministic (reproducible by everyone) because we all have the same blocks and use the same algorithm to compute it using the time value already inside the block headers.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
BlackHatCoiner
Legendary
*
Offline Offline

Activity: 1512
Merit: 7340


Farewell, Leo


View Profile
August 23, 2023, 04:10:28 PM
 #8

By the way, "leading zeroes" is a simplified way of describing the target, but it is wrong, and has to stop. The software doesn't check the leading zeroes, and there are times when the leading zeroes are the same, but the target changes. (i.e., 0x0001 and 0x000f both have the same leading zeroes)

Note that the hashes are actually displayed as big endian when you're looking at the block explorers but is in actuality little endian when you're looking in the code.
Which code are you referring to? There are various parts of the repository, to which large numbers are represented in big endian. The hashing is performed using the little endian representation, as outlined by the protocol, if that's what you meant.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
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!