Questions tagged [difficulty]

This tag should be used for questions regarding difficulty which encodes the likelihood of one hash to succeed at mining a block. Indirectly, it is a measure of the total hashing power of all miners for a given cryptocurrency.

Difficulty is a measure of the likelihood that a given hash is a valid hash for a block. It is calculated by taking the target at difficulty 1 divided by the current mining target. The difficulty is directly correlated to the total mining power of all miners on the network. The difficulty will increase as more hash rate is brought online and will decrease when hash rate decreases.

348 questions
28
votes
3 answers

What is "difficulty" and how it relates to "target"?

I don't understand what "difficulty" means and how it really relates to "target". I understand what "target" is - it tells the miners, how small the resulting hash should be. (Basically, how many zeroes are there at the beginning, altough not…
Karel Bílek
  • 2,695
  • 3
  • 24
  • 45
9
votes
2 answers

How many zeroes does the current target have?

I'm trying to get my head around the difficulty setting of Bitcoin. How can I calculate how many zeros the target string needs to start with?
Alice
  • 91
  • 1
  • 1
  • 3
8
votes
1 answer

Why is target stored in the block at all?

Currently, target is stored in each block. Why is that? Why it is not simply computed by each client based on the previous timestamps from previous blocks? Why it has to be stored within the block? In other words, doesn't allowing miner to choose…
Mitar
  • 183
  • 3
7
votes
1 answer

What does the nBits value represent?

When a miner hashes a blocksheader and it produces a hash that is lower than the value represented by nBits then the PoW is considered solved. What exactly does this mean? For example a SHA256 hash has the following structure:…
no nein
  • 297
  • 3
  • 10
6
votes
1 answer

Why didn't the difficulty adjust for the first 30,240 blocks?

I'm working on showing the difficulty adjustments over time, and I've noticed that the first difficulty adjustment did not take place until block 32,256: http://learnmeabitcoin.com/explorer/node/difficulty/ Why is this?
inersha
  • 3,063
  • 1
  • 17
  • 41
5
votes
1 answer

How is nbits calculated?

When generating a new block, how is the nbits field in block header calculated? Is nbits calculated for every new block like: nbits=nbits of last block * (timstamp of lastblock-timestamp of (lastblocknum-2016))/20160 Or, nbits is only updated…
user75243
  • 51
  • 1
5
votes
2 answers

Why is the difficulty adjustment restricted to a factor of 4?

What does this protect against? And why 4 in particular? I know an adjustment of this magnitude is not likely to take place at this stage, but I'm wondering why this was implemented in the first place.
inersha
  • 3,063
  • 1
  • 17
  • 41
4
votes
2 answers

understanding bits and difficulty in a block header

This block: https://blockchain.info/block/00000000000000000025c089d0a7b2bf6241888c4dd90ab7a4c4baa6a2823551 Shows difficulty at 3,007,383,866,429.73, and bits at 392009692. If I want to see how many zeros need to be in the hash, I believe I can just…
patrick
  • 233
  • 2
  • 4
4
votes
0 answers

Formula for Bitcoin Difficulity

I'm wondering if anyone knows a formula for how to calculate the mining difficulty based on the current hash rate. For an example, if the BTC network would reach 20 million TH/s. Thank You!
user67258
4
votes
1 answer

Is there a rationale for the compact representation of the target?

In Bitcoin, the target is a 256-bit unsigned integer stored using a compact representation similar to a 32-bit floating-point with the following parameters: 1 sign bit (is there any use?) 8-bit exponent with offset binary 3 (why?) base 256 (by…
elias19r
  • 58
  • 6
4
votes
1 answer

What is the lowest possible value for target?

Similar question was asked here but the answer doesn't really provide an answer. This answer says that the lowest possible value for target is "all zeros plus a one". Pieter Wuille in the comment denied it and wrote that the target can even be…
LeaBit
  • 930
  • 1
  • 13
3
votes
2 answers

How many correct hashes are there giving a difficulty?

I asked a question about mining difficulty in this SO post, Nate explained that the estimated total amout of hashes being calculated to date is 100000000000000000000000000 which is about 0.0000000000000000000000000000000000000000000000001% of the…
Cheng
  • 135
  • 4
3
votes
2 answers

Is it possible to calculate the difficulty purely by the number of blocks generated in e.g. 3 month and the staring difficulty?

The background of this question is wether the distribution of the block generation does matter? Lets say we have a period of 12 weeks. If the number of blocks created in this time is 6*2016 then the difficulty should not change. If the number of…
user599464
  • 446
  • 4
  • 11
3
votes
1 answer

Bitcoin difficulty - why leading 0s?

I do a sort of bitcoin 101 presentation for folks where I work. In one of the recent sessions, someone asked why the proof of work difficulty requires a minimum number of leading 0s. Why not 1s or something else? Not understanding the math behind it…
septerr
  • 173
  • 5
2
votes
1 answer

Difficulty target representation in bitcoin wiki

The bitcoin wiki describes difficulty target representation as follows: How is difficulty stored in blocks? Each block stores a packed representation (called "Bits") for its actual hexadecimal target. The target can be derived from it via a…
hello.wjx
  • 121
  • 2
1
2 3